cancel
Showing results for 
Search instead for 
Did you mean: 

JCO 3 environment's threads can not be stopped

Former Member
0 Kudos

I have an adapter to accept the xml message from sap, I encounter the issue, when I stop the server and notifiy the ServerDataProvider to delete the connection resource, and unregister the provider too. but the following exception will be throw in jco trace. my EAI server cannot be stopped gracefully.

JCoTimeoutChecker [15:48:39:294]: [JCoAPI] unexpected exception in wait java.lang.InterruptedException

at java.lang.Object.wait(Native Method)

at com.sap.conn.jco.rt.AutoJobRunner.run(AutoJobRunner.java:107)

at java.lang.Thread.run(Thread.java:595)

Hope from the reply from you guys.:)

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi guys,

I don't know if this is the right place to report the problem but I searched for a similar topic and found this one so I place it here:

I have a similar requirement to SAP JCo and encounter the same problem that quan tang has. I want to use JCo within an Apache Tomcat web application and need to be able to gracefully undeploy the classes of the web applications class loader. Therefore it is necessary to terminate all threads that have the web applications' context class loader otherwise we will have a memory leak when stopping the web application because the web application class loader cannot be freed by the garbage collector as the JCoTimeoutChecker thread still holds a reference to it via the context class loader member variable.

If someone wants to reproduce the problem just create a simple web application which initializes the SAP JCo 3 by calling

Environment.registerDestinationDataProvider(DestinationDataProvider)

.

Start Tomcat, restart the web application through the Tomcat Manager and Tomcat will output an error message like the following one:

As a work around you can move the SAP JCo from the web applications library folder to Tomcats shared library folder. Then you are able to apply Tomcats shared class loader and you will be able to restart you web application without getting that error.

But in my opinion this is not the cleaniest way to handle this and I also think that every thread should terminate upon an Interruption event (like an InterruptedException) to be able to terminate gracefully.

SCHWERWIEGEND: The web application [/test] appears to have started a thread named [SoftReferenceMapCleanThread] but has failed to stop it. This is very likely to create a memory leak.

Hope for a fix one day.