Author: markt
Date: Wed Mar 30 12:48:13 2011
New Revision: 1086935
URL: http://svn.apache.org/viewvc?rev=1086935&view=rev
Log:
Correct fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50991
Stop resource after app has finished with them but before they are unbound
Modified:
tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?rev=1086935&r1=1086934&r2=1086935&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Wed Mar 30
12:48:13 2011
@@ -5437,15 +5437,16 @@ public class StandardContext extends Con
if (log.isDebugEnabled())
log.debug("Processing standard container shutdown");
- fireLifecycleEvent(Lifecycle.CONFIGURE_STOP_EVENT, null);
-
- // JNDI resources are unbound in CONFIGURE_STOP_EVENT so it is now
- // safe to stop the resources which will trigger the close method
if
- // present
+ // JNDI resources are unbound in CONFIGURE_STOP_EVENT so stop
+ // naming resoucres before they are unbound since NamingResoucres
+ // does a JNDI lookup to retrieve the resource. This needs to be
+ // after the application has finished with the resource
if (namingResources != null) {
namingResources.stop();
}
+ fireLifecycleEvent(Lifecycle.CONFIGURE_STOP_EVENT, null);
+
// Stop the Valves in our pipeline (including the basic), if any
if (pipeline instanceof Lifecycle) {
((Lifecycle) pipeline).stop();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]