Remy Maucherat wrote:
[EMAIL PROTECTED] wrote:> glenn 2002/11/12 18:23:11 > > Modified: catalina/src/share/org/apache/catalina/core > NamingContextListener.java StandardContext.java > catalina/src/share/org/apache/naming ContextBindings.java > Log: > Bug fix for BUG #13364 > > A Web Application Context reload by the manager web application > was causing named JNDI resources to disappear. > > A webapp reload needs to dump the webapp classloader, then > recreate. The CL is bound to the naming context so the > reload was issing a NamingContext STOP_EVENT and then a > START_EVENT. This removed all the JNDI named resources > but the code which runs at webapp startup which creates > the JNDI named resources is not run on a reload. > > I fixed this by removing the START and STOP events and > adding BEFORE_STOP_EVENT and AFTER_START_EVENT > lifecycle events whose only purpose is to bind or unbind the > ClassLoader to the JNDI context. This fix seems incorrect to me. The naming context must be destroyed, as the references which are bound in it have been created by the old classloader. The NamingResources object is supposed to contain all the necessary data to recrate the JNDI context. The question, and what I was planning to investigate, is why it doesn't work. I think it did in the past. I'll revert this patch when I find a better fix for the bug.
I investigated the problem as much as I could, and I cannot reproduce the original bug.
The patch introduces wrong behavior as explained, so I am -1 for it, and will revert it.
The original report was that the JNDI resources were disappearing after a reload of a context using the manager.
Here is what I did to try to reproduce it:
- full recompile and start of Tomcat 4.1, after adding a user for the manager webapp
- use of the JNDI servlet to display the naming environment of the "examples" context (http://127.0.0.1:8080/examples/servlet/JndiServlet)
- use of the HTML interface to the manager to reload the "examples" context (http://127.0.0.1:8080/manager/html/reload?path=/examples)
- reload was successful
- use JNDI servlet in a different browser (Moz, the first one was in IE); result is the same as the first attempt
So I would like detailed information on:
- what is actually failing
- how to reproduce it
Thanks,
Remy
--
To unsubscribe, e-mail: <mailto:tomcat-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@;jakarta.apache.org>