Summary: | New option to make context startup fail if a load-on-startup servlet fails | ||
---|---|---|---|
Product: | Tomcat 7 | Reporter: | Sylvain Laurent <slaurent> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | ||
Priority: | P2 | ||
Version: | 7.0.53 | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
Attachments: | Patch for tomcat 8 |
It needs a shorter name. what about "failCtxIfServletStartFails" ? ping? committed r1595690 to tomcat 8 trunk, will be available in tomcat 8.0.9. The new flag is named failCtxIfServletStartFails. merged to tomcat 7, will be availble in 7.0.55 |
Created attachment 31563 [details] Patch for tomcat 8 Currently when a servlet with load-on-startup >=0 fails its startup, the context startup is still considered as OK. With some webapps (like spring-based ones with a DispatcherServlet), this makes no sense at all : if the servlet failed its startup, the webapp is unuseable and it would be more sensible to have tomcat mark the context as failed. Such a behavior is not specified in JEE specs, so I propose to have a new optional flag on Context and Host containers. In the attached patch, the flag is named failDeploymentIfServletLoadedOnStartupFails . If specified on Context, it overrides the value potentially specified at the Host level. The proposed patch for tomcat 8 passes checkstyle, provides a unit test and updates documentation. If it's OK with the patch, I'd also like to have it backported to tomcat 7.