Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=42934
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 9 May 2008 20:21:20 +0000 (20:21 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 9 May 2008 20:21:20 +0000 (20:21 +0000)
Trigger contextInitialized() before sessionDidActivate()
TCK tests all pass but I want to give this a little longer in trunk before proposing it for 6.0.x

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

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

index 18f59aa..0d721f2 100644 (file)
@@ -4269,14 +4269,6 @@ public class StandardContext
                 }
 
                 
-                // Start manager
-                if ((manager != null) && (manager instanceof Lifecycle)) {
-                    ((Lifecycle) getManager()).start();
-                }
-
-                // Start ContainerBackgroundProcessor thread
-                super.threadStart();
-
                 mainOk = true;
 
             }
@@ -4333,13 +4325,28 @@ public class StandardContext
                 lifecycle.fireLifecycleEvent(AFTER_START_EVENT, null);
             }
             
-            // Configure and call application event listeners and filters
+            // Configure and call application event listeners
             if (ok) {
                 if (!listenerStart()) {
                     log.error( "Error listenerStart");
                     ok = false;
                 }
             }
+            
+            try {
+                // Start manager
+                if ((manager != null) && (manager instanceof Lifecycle)) {
+                    ((Lifecycle) getManager()).start();
+                }
+    
+                // Start ContainerBackgroundProcessor thread
+                super.threadStart();
+            } catch(Exception e) {
+                log.error("Error manager.start()", e);
+                ok = false;
+            }
+
+            // Configure and call application filters
             if (ok) {
                 if (!filterStart()) {
                     log.error( "Error filterStart");