tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 27371] - java.lang.ThreadDeath caused by log4j when reloading Tomcat app
Date Sat, 07 Aug 2004 00:55:51 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=27371>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=27371

java.lang.ThreadDeath caused by log4j when reloading Tomcat app





------- Additional Comments From ccorsi@exln.com  2004-08-07 00:55 -------

I was looking at the WebappClassLoader class and it contains a started attribute
that is used to determine that if the WebappClassLoader instance was started
before it can be used to load classes. The started attribute is set using the
classes start and stop methods. The ThreadDeath exception is being thrown
because when the WebappClassLoader instance is calling the loadClass method it
checks that the started attribute is true. If it isn't, it throws the
ThreadDeath exception.

I then looked at the StandardContext class. It contains a method called reload
that is used whenever it wants to reload that particular web application
associated to that instance of StandardContext. I also noticed that the
StandardContext method will associate a single WebappLoader to the
StandardContext instance. This WebappLoader contain the ClassLoader used by this
StandardContext web application. The assignment of the WebappLoader is done only
once and it is done within the start method only. This method initially checks
if the WebappLoader has been associated to the StandardContext. It will then
only assign a WebappLoader to the StandardContext if their was none.

I deduced by looking at these sections of the code that it seems like whenever a
 StandardContext web application is being reloaded. Its WebappLoader
WebappClassLoader start method is not be called before loading any of the web
application classes. It does seem like its stop method is being called whenever
the web application is being stopped.

This is why I believe that the WebappClassLoader is not being properly setup
before being used.

I am basing this on looking at the code only. I have not tried to debug this
case. It is only a theory based on observations and nothing else.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message