From: fhanik Date: Wed, 11 Mar 2009 00:46:54 +0000 (+0000) Subject: Add a system property that lets the startup phase exit if the server encounters an... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=b27d37832946ee60fa694fe619051f1c07da139b;p=tomcat7.0 Add a system property that lets the startup phase exit if the server encounters an exception during the initialization phase. The default is false, which means the behavior from today remains unchanged. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@752323 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/startup/Catalina.java b/java/org/apache/catalina/startup/Catalina.java index 4c66f9b82..38bd41e8e 100644 --- a/java/org/apache/catalina/startup/Catalina.java +++ b/java/org/apache/catalina/startup/Catalina.java @@ -533,7 +533,11 @@ public class Catalina extends Embedded { try { server.initialize(); } catch (LifecycleException e) { - log.error("Catalina.start", e); + if (Boolean.getBoolean("org.apache.catalina.startup.EXIT_ON_INIT_FAILURE")) + throw new java.lang.Error(e); + else + log.error("Catalina.start", e); + } } diff --git a/webapps/docs/config/systemprops.xml b/webapps/docs/config/systemprops.xml index 1cc86ea36..dcbf89a93 100644 --- a/webapps/docs/config/systemprops.xml +++ b/webapps/docs/config/systemprops.xml @@ -360,6 +360,12 @@

If true, use a shared selector for servlet write/read. If not specified, the default value of true will be used.

+ + +

If true, the server will exit if an exception happens + during the server initialization phase. The default is false.

+
+