Author: markt
Date: Sun Jun 23 19:56:10 2013
New Revision: 1495882

URL: http://svn.apache.org/r1495882
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55125
No point starting a process if the Server container fails to start.

Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/Catalina.java
    
tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/LocalStrings.properties
    tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1495880

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/Catalina.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/Catalina.java?rev=1495882&r1=1495881&r2=1495882&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/Catalina.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/Catalina.java Sun Jun 
23 19:56:10 2013
@@ -690,7 +690,13 @@ public class Catalina {
         try {
             getServer().start();
         } catch (LifecycleException e) {
-            log.error("Catalina.start: ", e);
+            log.fatal(sm.getString("catalina.serverStartFail"), e);
+            try {
+                getServer().destroy();
+            } catch (LifecycleException e1) {
+                log.debug("destroy() failed for failed Server ", e1);
+            }
+            return;
         }
 
         long t2 = System.nanoTime();

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/LocalStrings.properties?rev=1495882&r1=1495881&r2=1495882&view=diff
==============================================================================
--- 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/LocalStrings.properties 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/LocalStrings.properties 
Sun Jun 23 19:56:10 2013
@@ -15,6 +15,7 @@
 
 catalina.configFail=Unable to load server configuration from [{0}]
 catalina.noCluster=Cluster RuleSet not found due to [{0}]. Cluster 
configuration disabled.
+catalina.serverStartFail=The required Server component failed to start so 
Tomcat is unable to start.
 catalina.shutdownHookFail=The shutdown hook experienced an error while trying 
to stop the server
 catalina.stopServer=No shutdown port configured. Shut down server through OS 
signal. Server not shut down.
 catalina.stopServer.connectException=Could not contact {0}:{1}. Tomcat may not 
be running.

Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1495882&r1=1495881&r2=1495882&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Sun Jun 23 19:56:10 2013
@@ -82,6 +82,12 @@
         <bug>55110</bug>: Small performance improvements. Patches provided by
         Adrian Nistor. (markt)
       </fix>
+      <fix>
+        <bug>55125</bug>: If the Server container fails to start, don't allow
+        the Catalina wrapper to start (used when running from the command line
+        and when running as a service) since Tomcat will not be able to do any
+        useful work. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Cluster">



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to