tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1055121 - in /tomcat/trunk: java/org/apache/catalina/core/StandardService.java java/org/apache/catalina/util/LifecycleBase.java webapps/docs/changelog.xml
Date Tue, 04 Jan 2011 17:57:17 GMT
Author: markt
Date: Tue Jan  4 17:57:16 2011
New Revision: 1055121

URL: http://svn.apache.org/viewvc?rev=1055121&view=rev
Log:
Re-fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49372
Don't throw an LifecycleException for an invalid transition if a connector fails to start.

Modified:
    tomcat/trunk/java/org/apache/catalina/core/StandardService.java
    tomcat/trunk/java/org/apache/catalina/util/LifecycleBase.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardService.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardService.java?rev=1055121&r1=1055120&r2=1055121&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardService.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardService.java Tue Jan  4 17:57:16 2011
@@ -453,7 +453,10 @@ public class StandardService extends Lif
         synchronized (connectors) {
             for (Connector connector: connectors) {
                 try {
-                    connector.start();
+                    // If it has already failed, don't try and start it
+                    if (connector.getState() != LifecycleState.FAILED) {
+                        connector.start();
+                    }
                 } catch (Exception e) {
                     log.error(sm.getString(
                             "standardService.connector.startFailed",

Modified: tomcat/trunk/java/org/apache/catalina/util/LifecycleBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/util/LifecycleBase.java?rev=1055121&r1=1055120&r2=1055121&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/util/LifecycleBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/util/LifecycleBase.java Tue Jan  4 17:57:16 2011
@@ -97,7 +97,12 @@ public abstract class LifecycleBase impl
         }
         setState(LifecycleState.INITIALIZING);
 
-        initInternal();
+        try {
+            initInternal();
+        } catch (LifecycleException e) {
+            setState(LifecycleState.FAILED);
+            throw e;
+        }
 
         setState(LifecycleState.INITIALIZED);
     }
@@ -213,7 +218,12 @@ public abstract class LifecycleBase impl
         
         setState(LifecycleState.STOPPING_PREP);
 
-        stopInternal();
+        try {
+            stopInternal();
+        } catch (LifecycleException e) {
+            setState(LifecycleState.FAILED);
+            throw e;
+        }
 
         if (state.equals(LifecycleState.MUST_DESTROY)) {
             // Complete stop process first
@@ -221,8 +231,8 @@ public abstract class LifecycleBase impl
 
             destroy();
         } else {
-            // Shouldn't be necessary but acts as a check that sub-classes are doing
-            // what they are supposed to.
+            // Shouldn't be necessary but acts as a check that sub-classes are
+            // doing what they are supposed to.
             if (!state.equals(LifecycleState.STOPPING)) {
                 invalidTransition(Lifecycle.AFTER_STOP_EVENT);
             }
@@ -271,7 +281,12 @@ public abstract class LifecycleBase impl
 
         setState(LifecycleState.DESTROYING);
         
-        destroyInternal();
+        try {
+            destroyInternal();
+        } catch (LifecycleException e) {
+            setState(LifecycleState.FAILED);
+            throw e;
+        }
         
         setState(LifecycleState.DESTROYED);
     }

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1055121&r1=1055120&r2=1055121&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Tue Jan  4 17:57:16 2011
@@ -82,6 +82,12 @@
         the pool when a web application is stopped. (slaurent)
       </add>
       <fix>
+        <bug>49372</bug>: Re-fix after connector re-factoring. If connector
+        initialisation fails (e.g. if a port is alreasy in use) do not trigger
+        an <code>LifecycleException</code> for an invalid state transition.
+        (markt)
+      </fix>
+      <fix>
         <bug>49650</bug>: Remove unnecessary entries package.access property
         defined in catalina.properties. Patch provided by Owen Farrell. (markt) 
       </fix>



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


Mime
View raw message