Add a system property that lets the startup phase exit if the server encounters an...
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 11 Mar 2009 00:46:54 +0000 (00:46 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 11 Mar 2009 00:46:54 +0000 (00:46 +0000)
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

java/org/apache/catalina/startup/Catalina.java
webapps/docs/config/systemprops.xml

index 4c66f9b..38bd41e 100644 (file)
@@ -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);
+                
             }
         }
 
index 1cc86ea..dcbf89a 100644 (file)
       <p>If <code>true</code>, use a shared selector for servlet write/read. If
       not specified, the default value of <code>true</code> will be used.</p>
     </property>
+    
+    <property name="org.apache.catalina.startup.EXIT_ON_INIT_FAILURE">
+      <p>If <code>true</code>, the server will exit if an exception happens
+         during the server initialization phase. The default is <code>false</code>.</p>
+    </property>
+    
 
   </properties>