From: remm Date: Thu, 8 Jun 2006 14:50:07 +0000 (+0000) Subject: - Create clustered managers with the Catalina CL set as the context CL (as classloadi... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=ba99a0fa62e0d08c0f665cdb38eedf295a4b6037;p=tomcat7.0 - Create clustered managers with the Catalina CL set as the context CL (as classloading may occur). - Should fix 39699. git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@412764 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/core/StandardContext.java b/java/org/apache/catalina/core/StandardContext.java index 65fed7144..400273b2b 100644 --- a/java/org/apache/catalina/core/StandardContext.java +++ b/java/org/apache/catalina/core/StandardContext.java @@ -69,6 +69,7 @@ import org.apache.catalina.Lifecycle; import org.apache.catalina.LifecycleException; import org.apache.catalina.LifecycleListener; import org.apache.catalina.Loader; +import org.apache.catalina.Manager; import org.apache.catalina.Wrapper; import org.apache.catalina.deploy.ApplicationParameter; import org.apache.catalina.deploy.ErrorPage; @@ -4128,6 +4129,22 @@ public class StandardContext if (log.isDebugEnabled()) log.debug("Processing standard container startup"); + // Acquire clustered manager + Manager contextManager = null; + if (manager == null) { + if ((getCluster() != null) && distributable) { + try { + contextManager = getCluster().createManager(getName()); + } catch (Exception ex) { + log.error("standardContext.clusterFail", ex); + ok = false; + } + } else { + contextManager = new StandardManager(); + } + } + + // Binding thread ClassLoader oldCCL = bindThread(); @@ -4184,17 +4201,8 @@ public class StandardContext lifecycle.fireLifecycleEvent(START_EVENT, null); // Configure default manager if none was specified - if (manager == null) { - if ((getCluster() != null) && distributable) { - try { - setManager(getCluster().createManager(getName())); - } catch (Exception ex) { - log.error("standardContext.clusterFail", ex); - ok = false; - } - } else { - setManager(new StandardManager()); - } + if (contextManager != null) { + setManager(contextManager); } // Start manager