Hello List,

A colleague of mine is having an issue with his application deployed in
a Tomcat 5.5.27 (jdk1.5.0_15) on a Debian Linux.

The application makes a connection to service running on a WebLogic
server. Therefor, he needs to include the weblogic.jar library in his
application.

When redeploying the application, he is seeing the following errors in
catalina.out:

INFO: Illegal access: This instance of the web application has already
been stopped. Could not load weblogic.common.T3MiscLogger. 
java.lang.IllegalStateException
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1272)
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1232)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at
weblogic.time.common.internal.TimeTable.execute(TimeTable.java:227)
        at
weblogic.time.common.internal.TimeEventGenerator.run(TimeEventGenerator.java:117)
        at java.lang.Thread.run(Thread.java:595)
11-feb-2009 8:43:23 org.apache.catalina.loader.WebappClassLoader
loadClass
INFO: Illegal access: This instance of the web application has already
been stopped. Could not load weblogic.common.T3MiscLogger.  
java.lang.IllegalStateException
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1272)
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1232)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at
weblogic.time.common.internal.TimeEventGenerator.run(TimeEventGenerator.java:127)
        at java.lang.Thread.run(Thread.java:595)
11-feb-2009 8:44:08 org.apache.catalina.loader.WebappClassLoader
loadClass


The only way to solve this is to restart Tomcat.
In order to help him out, I googled for the problem and found a thread
on this mailinglist dated 2007 and responded by Chuck:

http://www.nabble.com/App-reloading-classloading-issue--td12944398.html

Note that the error mentioned in above URL isn't exactly the same, but
it concerns the same library (weblogic.jar), thus I suspect the problem
is either the same or related.
 
Quoting Chuck's response:

"I suspect that the prior instance of the webapp is actually still 
around, or at least its classloader and some undersirably persistent 
objects are.  When you restart the webapp, another classloader is 
created for it, and its references to 
weblogic/rmi/extensions/server/Stub are not castable to instances of
the 
same class from the first classloader.  If you can figure out where the 
references to the prior instances are being maintained, perhaps you can 
clear them out and allow the older webapp to be completely removed. 
(Injudicious use of ThreadLocal is a common cause of this problem.)  A 
profiler may help to determine objects are still around from the old 
copy of the webapp."

I understand what the problem might be, but I don't understand how I
should go about solving this (without having to restart Tomcat) or how
to avoid this from happening. Actually, I'm wondering if someone could
explain the cause of classloaders not being cleaned up when destroying a
webapp.

First of all, I'm not sure how I can figure out where the references to
the prior instances are being maintained, and secondly, I don't know how
to clean them up (both are closely related if you ask me :-) )

My first thought was to take thread dumps, but there aren't showing up
any previous instances of the webapp.

I don't have any experience with profilers, but I can try to use
VisualVM (which has a profiler-like tab) to take a look at all the
objects being instantiated. 
Say I find any references to Weblogic, how should I go about having them
removed automatically each time the application is being redeployed?

Thanks.





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to