tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Luehe <Jan.Lu...@Sun.COM>
Subject Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/loader
Date Wed, 28 Sep 2005 19:08:13 GMT

Remy Maucherat wrote On 09/28/05 10:18,:
> Jan Luehe wrote:
>>We have seen the ThreadDeath in our callstacks, hence this fix.
> Nobody is reading what I am writing anymore ...

No, I did.

> I wrote:
> The static initializer is called when loading the class, and obviously 
> the webapp CL is not going to load IntrospectionUtils.
> IntrospectionUtils will be loaded once, and its static initializer run 
> once.

Yes, but with lazy resolution, it will be loaded when the
IntrospectionUtils symbol is first encountered, which may
be inside WebappClassLoader.stop().

IntrospectionUtils' static initializer will cause an invocation of
loadClass() on the thread's context classloader, which corresponds to
the WebappClassLoader, whose loadClass() throws ThreadDeath when
its "started" flag has been set to FALSE.

Therefore, we must avoid referencing IntrospectionUtils in
WebappClassLoader.stop() after the "started" flag has been
set to FALSE.

> So I am ok with your fix, but I don't understand how it can occur 
> in regular Tomcat.

It's probably not occurring in standalone Tomcat, but only
in "embedded" Tomcat. In standalone Tomcat, IntrospectionUtils is
probably getting resolved (and its static initializer invoked)
prior to calling WebappClassLoader.stop(),
whereas in "embedded" mode, IntrospectionUtils is first referenced
and loaded by WebappClassLoader.stop().

> The big comment block is quite pointless, as it tries to be 
> informational, but doesn't correspond to reality (I am personally 
> against this kind of "commit message duplication" comment).

Sure, I just thought this line might be an easy candidate for
being moved around if there was no comment.

> As a reminder, CVS shound't be used anymore.



> Rémy
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message