tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 40162] JNDI Environment is null within subthreads in Servlet.destroy()
Date Wed, 15 Jul 2009 02:58:32 GMT

--- Comment #8 from Konstantin Kolinko <>  2009-07-14 19:58:30
PST ---
You cannot do what you are trying.

Once a Web Application is stopped, its resources are to be available for
garbage collection, that includes their classloader, context etc. Thus all
references to them in global objects are being cleared.

In your example you expect that the Runnable will obtain the InitialContext
that belongs to the web application. There is a race condition, but in most
cases it won't be able to obtain it, because to get it you should go through
some static methods, use some global lookup table, and the references there are
already cleared.
And even if it can, I think that there is no guarantee that the Context will be
usable at that time.

To dig into the code, see and
Well, Mark already mentioned those classes.

I do not know, where "shared" code comes into the play. I do not believe that
moving the code into webapp will fix/workaround this.

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

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

View raw message