From: markt Date: Sat, 26 Feb 2011 20:01:10 +0000 (+0000) Subject: Ensure a web application is taken out of service if the web.xml file is not valid. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=44d42f01403564ea22f135933559b2fe8a1d2482;p=tomcat7.0 Ensure a web application is taken out of service if the web.xml file is not valid. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1074914 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/startup/ContextConfig.java b/java/org/apache/catalina/startup/ContextConfig.java index 3170279ea..6e42c4595 100644 --- a/java/org/apache/catalina/startup/ContextConfig.java +++ b/java/org/apache/catalina/startup/ContextConfig.java @@ -1222,7 +1222,9 @@ public class ContextConfig orderedFragments = WebXml.orderWebFragments(webXml, fragments); // Step 3. Look for ServletContainerInitializer implementations - ok = processServletContainerInitializers(orderedFragments); + if (ok) { + processServletContainerInitializers(orderedFragments); + } // Step 4. Process /WEB-INF/classes for annotations // This will add any matching classes to the typeInitializerMap @@ -1274,7 +1276,6 @@ public class ContextConfig } } else { webXml.configureContext(context); - ok = true; } // Always need to look for static resources @@ -1362,7 +1363,7 @@ public class ContextConfig * Scan JARs for ServletContainerInitializer implementations. * Implementations will be added in web-fragment.xml priority order. */ - protected boolean processServletContainerInitializers( + protected void processServletContainerInitializers( Set fragments) { for (WebXml fragment : fragments) { @@ -1393,7 +1394,8 @@ public class ContextConfig log.error(sm.getString( "contextConfig.servletContainerInitializerFail", url, context.getName())); - return false; + ok = false; + return; } finally { if (is != null) { try { @@ -1435,7 +1437,6 @@ public class ContextConfig } } - return true; } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 2154d6efc..f4430f9a8 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -147,6 +147,10 @@ embedded Tomcat instance that includes at least one Context is destroyed without ever being started. (markt) + + Ensure a web application is taken out of service if the web.xml file is + not valid. (kkolinko/markt) +