From: markt Date: Thu, 8 Jul 2010 15:48:48 +0000 (+0000) Subject: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49503 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=2dc88f675a4a0bfca20d1ad4f33c9ff7f249a375;p=tomcat7.0 Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49503 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 --- diff --git a/java/org/apache/catalina/connector/Connector.java b/java/org/apache/catalina/connector/Connector.java index d230a1b97..9fab8124a 100644 --- a/java/org/apache/catalina/connector/Connector.java +++ b/java/org/apache/catalina/connector/Connector.java @@ -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); } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 1a02f4176..632d1bdcc 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -80,6 +80,12 @@ guess user passwords by brute-force. (markt) + 49503: 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) + + 49525: Ensure cookies for the ROOT context have a path of / rather than an empty string. (markt)