// Binding thread
ClassLoader oldCCL = bindThread();
- if (namingResources != null) {
- namingResources.stop();
- }
-
try {
// Stop our child containers, if any
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
+ if (namingResources != null) {
+ namingResources.stop();
+ }
+
// Stop the Valves in our pipeline (including the basic), if any
if (pipeline instanceof Lifecycle) {
((Lifecycle) pipeline).stop();
Also prevent the DefaultServlet from setting a content length header
since this too cannot be reliably determined. (markt)
</fix>
+ <fix>
+ <bug>50991</bug>: Fix regression in fix for <bug>25060</bug> that called
+ close on a JNDI resource while it was still available to the
+ application. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">