You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2015/06/24 14:05:29 UTC

[Bug 57700] Exception in a LifecycleListener on Context makes webapp unreachable in spite of subsequent successful startups

https://bz.apache.org/bugzilla/show_bug.cgi?id=57700

--- Comment #4 from Violeta Georgieva <vi...@apache.org> ---
Hi,

I succeeded to reproduce the scenario on all Tomcat versions.

The issue is the following:
- The implementation of Manager web app invokes HostConfig to deploy the web
application.
...
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:186)
    at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:718)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:941)
...
- In ContainerBase.addChildInternal if the child's start fails then the event
ADD_CHILD_EVENT is not sent.
- MapperListener will not be added to the context's listeners because it will
not receive the event ADD_CHILD_EVENT
- Later on when one tries to start the context again MapperListener will not be
notified.

The test testWebappListenerConfigureFail() is successfull because it explicitly
sets 

((ContainerBase) tomcat.getHost()).setStartChildren(false);

with this flag when ContainerBase.addChildInternal is invoked, the child's
start will be skipped and the event ADD_CHILD_EVENT will be sent.

What do you think if we move the notification for event ADD_CHILD_EVENT before
children start? (see below)

Regards,
Violeta


Index: ContainerBase.java
===================================================================
--- ContainerBase.java    (revision 1686237)
+++ ContainerBase.java    (working copy)
@@ -714,6 +714,8 @@
             children.put(child.getName(), child);
         }

+        fireContainerEvent(ADD_CHILD_EVENT, child);
+
         // Start child
         // Don't do this inside sync block - start can be a slow process and
         // locking the children object can cause problems elsewhere
@@ -728,8 +730,6 @@
                     ("ContainerBase.addChild: start: " + e);
             }
         }
-
-        fireContainerEvent(ADD_CHILD_EVENT, child);
     }

-- 
You are receiving this mail because:
You are the assignee for the bug.

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