Bug 55125

Summary: Tomcat does not shut down if LifecycleListener throws an exception
Product: Tomcat 7 Reporter: Glyn Normington <glyn.normington>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Severity: normal    
Priority: P2    
Version: 7.0.41   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Attachments: Logs

Description Glyn Normington 2013-06-21 11:23:54 UTC
Created attachment 30467 [details]

I needed to shut down Tomcat if an application fails to start. I was advised that a LifecycleListener could shut down Tomcat by throwing an IllegalStateException from its lifecycleEvent method. However, this produces severe errors in the logs, but Tomcat does not shut down.

I saw this behaviour on Tomcat 7.0.41 and 7.0.40 using the test web application from here:


and v1.0.0 of the listener from here:


(v1.1.0 of the listener was re-coded to halt the JVM).

I attach catalina.out.

Mark Thomas suggested I raise this bug, so he believes that Tomcat should shut down.
Comment 1 Mark Thomas 2013-06-23 20:13:35 UTC
This has been fixed in trunk and 7.0.x and will be included in 7.0.42 onwards.