tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1353509 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/connector/ java/org/apache/coyote/ java/org/apache/coyote/ajp/ java/org/apache/coyote/http11/ webapps/docs/
Date Mon, 25 Jun 2012 13:05:07 GMT
Author: markt
Date: Mon Jun 25 13:05:03 2012
New Revision: 1353509

URL: http://svn.apache.org/viewvc?rev=1353509&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53430
Fix problems with missing / wrong version of APR/native library when APR connector is explicitly
configured.
Protocol now declares if it needs the library and the connector ensures it is available if
required.

Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Connector.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/LocalStrings.properties
    tomcat/tc7.0.x/trunk/java/org/apache/coyote/AbstractProtocol.java
    tomcat/tc7.0.x/trunk/java/org/apache/coyote/ProtocolHandler.java
    tomcat/tc7.0.x/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
    tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
    tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

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

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Connector.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Connector.java?rev=1353509&r1=1353508&r2=1353509&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Connector.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Connector.java Mon Jun 25 13:05:03
2012
@@ -970,6 +970,13 @@ public class Connector extends Lifecycle
             setParseBodyMethods(getParseBodyMethods());
         }
 
+        if (protocolHandler.isAprRequired() &&
+                !AprLifecycleListener.isAprAvailable()) {
+            throw new LifecycleException(
+                    sm.getString("coyoteConnector.protocolHandlerNoApr",
+                            getProtocolHandlerClassName()));
+        }
+
         try {
             protocolHandler.init();
         } catch (Exception e) {

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/LocalStrings.properties?rev=1353509&r1=1353508&r2=1353509&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/LocalStrings.properties (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/LocalStrings.properties Mon Jun
25 13:05:03 2012
@@ -22,6 +22,7 @@ coyoteConnector.invalidPort=The connecto
 coyoteConnector.protocolHandlerDestroyFailed=Protocol handler destroy failed
 coyoteConnector.protocolHandlerInitializationFailed=Protocol handler initialization failed
 coyoteConnector.protocolHandlerInstantiationFailed=Protocol handler instantiation failed
+coyoteConnector.protocolHandlerNoApr=The configured protocol [{0}] requires the APR/native
library which is not available
 coyoteConnector.protocolHandlerStartFailed=Protocol handler start failed
 coyoteConnector.protocolRegistrationFailed=Protocol JMX registration failed
 coyoteConnector.protocolHandlerPauseFailed=Protocol handler pause failed

Modified: tomcat/tc7.0.x/trunk/java/org/apache/coyote/AbstractProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/coyote/AbstractProtocol.java?rev=1353509&r1=1353508&r2=1353509&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/coyote/AbstractProtocol.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/coyote/AbstractProtocol.java Mon Jun 25 13:05:03
2012
@@ -149,6 +149,12 @@ public abstract class AbstractProtocol i
     public void setClientCertProvider(String s) { this.clientCertProvider = s; }
 
 
+    @Override
+    public boolean isAprRequired() {
+        return false;
+    }
+
+
     // ---------------------- Properties that are passed through to the EndPoint
 
     @Override

Modified: tomcat/tc7.0.x/trunk/java/org/apache/coyote/ProtocolHandler.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/coyote/ProtocolHandler.java?rev=1353509&r1=1353508&r2=1353509&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/coyote/ProtocolHandler.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/coyote/ProtocolHandler.java Mon Jun 25 13:05:03 2012
@@ -82,4 +82,10 @@ public interface ProtocolHandler {
      * Destroy the protocol (optional).
      */
     public void destroy() throws Exception;
+
+
+    /**
+     * Requires APR/native library
+     */
+    public boolean isAprRequired();
 }

Modified: tomcat/tc7.0.x/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java?rev=1353509&r1=1353508&r2=1353509&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java Mon Jun 25 13:05:03
2012
@@ -49,9 +49,16 @@ public class AjpAprProtocol extends Abst
     }
 
 
-    // ------------------------------------------------------------ Constructor
+    @Override
+    public boolean isAprRequired() {
+        // Override since this protocol implementation requires the APR/native
+        // library
+        return true;
+    }
 
 
+    // ------------------------------------------------------------ Constructor
+
     public AjpAprProtocol() {
         endpoint = new AprEndpoint();
         cHandler = new AjpConnectionHandler(this);

Modified: tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java?rev=1353509&r1=1353508&r2=1353509&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java Mon Jun 25 13:05:03
2012
@@ -53,6 +53,14 @@ public class Http11AprProtocol extends A
     }
 
 
+    @Override
+    public boolean isAprRequired() {
+        // Override since this protocol implementation requires the APR/native
+        // library
+        return true;
+    }
+
+
     public Http11AprProtocol() {
         endpoint = new AprEndpoint();
         cHandler = new Http11ConnectionHandler(this);

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=1353509&r1=1353508&r2=1353509&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Mon Jun 25 13:05:03 2012
@@ -84,6 +84,15 @@
       </fix>
     </changelog>
   </subsection>
+  <subsection name="Coyote">
+    <changelog>
+      <fix>
+        <bug>53430</bug>: Avoid a JVM crash when a connector that requires the
+        APR/native library is explicitly specified and the library, or a recent 
+        enough  version of it, is not available. (markt)
+      </fix>
+    </changelog>
+  </subsection>
   <subsection name="Jasper">
     <changelog>
       <fix>



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


Mime
View raw message