- Create clustered managers with the Catalina CL set as the context CL (as classloadi...
authorremm <remm@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 8 Jun 2006 14:50:07 +0000 (14:50 +0000)
committerremm <remm@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 8 Jun 2006 14:50:07 +0000 (14:50 +0000)
- Should fix 39699.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@412764 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/core/StandardContext.java

index 65fed71..400273b 100644 (file)
@@ -69,6 +69,7 @@ import org.apache.catalina.Lifecycle;
 import org.apache.catalina.LifecycleException;\r
 import org.apache.catalina.LifecycleListener;\r
 import org.apache.catalina.Loader;\r
+import org.apache.catalina.Manager;\r
 import org.apache.catalina.Wrapper;\r
 import org.apache.catalina.deploy.ApplicationParameter;\r
 import org.apache.catalina.deploy.ErrorPage;\r
@@ -4128,6 +4129,22 @@ public class StandardContext
         if (log.isDebugEnabled())\r
             log.debug("Processing standard container startup");\r
 \r
+        // Acquire clustered manager\r
+        Manager contextManager = null;\r
+        if (manager == null) {\r
+               if ((getCluster() != null) && distributable) {\r
+                       try {\r
+                               contextManager = getCluster().createManager(getName());\r
+                       } catch (Exception ex) {\r
+                               log.error("standardContext.clusterFail", ex);\r
+                               ok = false;\r
+                       }\r
+               } else {\r
+                       contextManager = new StandardManager();\r
+               }\r
+        }\r
+        \r
+        \r
         // Binding thread\r
         ClassLoader oldCCL = bindThread();\r
 \r
@@ -4184,17 +4201,8 @@ public class StandardContext
                 lifecycle.fireLifecycleEvent(START_EVENT, null);\r
 \r
                 // Configure default manager if none was specified\r
-                if (manager == null) {\r
-                    if ((getCluster() != null) && distributable) {\r
-                        try {\r
-                            setManager(getCluster().createManager(getName()));\r
-                        } catch (Exception ex) {\r
-                            log.error("standardContext.clusterFail", ex);\r
-                            ok = false;\r
-                        }\r
-                    } else {\r
-                        setManager(new StandardManager());\r
-                    }\r
+                if (contextManager != null) {\r
+                       setManager(contextManager);\r
                 }\r
                 \r
                 // Start manager\r