You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by kk...@apache.org on 2013/01/08 07:52:50 UTC

svn commit: r1430147 - /tomcat/trunk/java/org/apache/catalina/mapper/MapperListener.java

Author: kkolinko
Date: Tue Jan  8 06:52:50 2013
New Revision: 1430147

URL: http://svn.apache.org/viewvc?rev=1430147&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54380
- In MapperListener.lifecycleEvent():
call registerWrapper(), registerContext() only if the parent component has already been started.

Modified:
    tomcat/trunk/java/org/apache/catalina/mapper/MapperListener.java

Modified: tomcat/trunk/java/org/apache/catalina/mapper/MapperListener.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mapper/MapperListener.java?rev=1430147&r1=1430146&r2=1430147&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/mapper/MapperListener.java (original)
+++ tomcat/trunk/java/org/apache/catalina/mapper/MapperListener.java Tue Jan  8 06:52:50 2013
@@ -430,9 +430,19 @@ public class MapperListener extends Life
         if (event.getType().equals(Lifecycle.AFTER_START_EVENT)) {
             Object obj = event.getSource();
             if (obj instanceof Wrapper) {
-                registerWrapper((Wrapper) obj);
+                Wrapper w = (Wrapper) obj;
+                // Only if the Context has started. If it has not, then it will
+                // have its own "after_start" event later.
+                if (w.getParent().getState().isAvailable()) {
+                    registerWrapper(w);
+                }
             } else if (obj instanceof Context) {
-                registerContext((Context) obj);
+                Context c = (Context) obj;
+                // Only if the Host has started. If it has not, then it will
+                // have its own "after_start" event later.
+                if (c.getParent().getState().isAvailable()) {
+                    registerContext(c);
+                }
             } else if (obj instanceof Host) {
                 registerHost((Host) obj);
             }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org