Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49503
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 8 Jul 2010 15:48:48 +0000 (15:48 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 8 Jul 2010 15:48:48 +0000 (15:48 +0000)
Revert the protocol handler component of r940656. Subsequent lifecycle fixes have resolved the issues that required this change

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@961819 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/connector/Connector.java
webapps/docs/changelog.xml

index d230a1b..9fab812 100644 (file)
@@ -840,6 +840,14 @@ public class Connector extends LifecycleMBeanBase  {
         IntrospectionUtils.setProperty(protocolHandler, "jkHome",
                                        System.getProperty("catalina.base"));
 
+        try {
+            protocolHandler.init();
+        } catch (Exception e) {
+            throw new LifecycleException
+                (sm.getString
+                 ("coyoteConnector.protocolHandlerInitializationFailed", e));
+        }
+
         onameProtocolHandler = register(protocolHandler,
                 createObjectNameKeyProperties("ProtocolHandler"));
         
@@ -860,16 +868,6 @@ public class Connector extends LifecycleMBeanBase  {
 
         setState(LifecycleState.STARTING);
 
-        // Protocol handlers do not follow Lifecycle conventions.
-        // protocolHandler.init() needs to wait until the connector.start()
-        try {
-            protocolHandler.init();
-        } catch (Exception e) {
-            throw new LifecycleException
-                (sm.getString
-                 ("coyoteConnector.protocolHandlerInitializationFailed", e));
-        }
-
         try {
             protocolHandler.start();
         } catch (Exception e) {
@@ -883,7 +881,7 @@ public class Connector extends LifecycleMBeanBase  {
                  ("coyoteConnector.protocolHandlerStartFailed", e));
         }
 
-        // MapperListener doesn't follow Lifecycle conventions either
+        // MapperListener doesn't follow Lifecycle conventions
         mapperListener.init();
     }
 
@@ -898,17 +896,7 @@ public class Connector extends LifecycleMBeanBase  {
 
         setState(LifecycleState.STOPPING);
 
-        // Protocol handlers do not follow Lifecycle conventions.
-        // protocolHandler.destroy() needs to be called in connector.stop()
-        try {
-            protocolHandler.destroy();
-        } catch (Exception e) {
-            throw new LifecycleException
-                (sm.getString
-                 ("coyoteConnector.protocolHandlerDestroyFailed", e));
-        }
-
-        // MapperListener doesn't follow Lifecycle conventions either
+        // MapperListener doesn't follow Lifecycle conventions
         mapperListener.destroy();
     }
 
@@ -918,6 +906,14 @@ public class Connector extends LifecycleMBeanBase  {
         unregister(onameMapper);
         unregister(onameProtocolHandler);
         
+        try {
+            protocolHandler.destroy();
+        } catch (Exception e) {
+            throw new LifecycleException
+                (sm.getString
+                 ("coyoteConnector.protocolHandlerDestroyFailed", e));
+        }
+
         if (getService() != null) {
             getService().removeConnector(this);
         }
index 1a02f41..632d1bd 100644 (file)
         guess user passwords by brute-force. (markt)
       </add>
       <fix>
+        <bug>49503</bug>: Make sure connectors bind to their associated ports
+        sufficiently early to allow jsvc and the
+        org.apache.catalina.startup.EXIT_ON_INIT_FAILURE system property to
+        operate correctly. (markt)
+      </fix>
+      <fix>
         <bug>49525</bug>: Ensure cookies for the ROOT context have a path of /
         rather than an empty string. (markt)
       </fix>