tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1353501 - in /tomcat/trunk/java/org/apache: catalina/connector/ coyote/ coyote/ajp/ coyote/http11/
Date Mon, 25 Jun 2012 12:53:28 GMT
Author: markt
Date: Mon Jun 25 12:53:27 2012
New Revision: 1353501

URL: http://svn.apache.org/viewvc?rev=1353501&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/trunk/java/org/apache/catalina/connector/Connector.java
    tomcat/trunk/java/org/apache/catalina/connector/LocalStrings.properties
    tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java
    tomcat/trunk/java/org/apache/coyote/ProtocolHandler.java
    tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java

Modified: tomcat/trunk/java/org/apache/catalina/connector/Connector.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Connector.java?rev=1353501&r1=1353500&r2=1353501&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/Connector.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Connector.java Mon Jun 25 12:53:27 2012
@@ -952,6 +952,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/trunk/java/org/apache/catalina/connector/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/LocalStrings.properties?rev=1353501&r1=1353500&r2=1353501&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/LocalStrings.properties (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/LocalStrings.properties Mon Jun 25 12:53:27
2012
@@ -21,6 +21,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.protocolHandlerPauseFailed=Protocol handler pause failed
 coyoteConnector.protocolHandlerResumeFailed=Protocol handler resume failed

Modified: tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java?rev=1353501&r1=1353500&r2=1353501&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java Mon Jun 25 12:53:27 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/trunk/java/org/apache/coyote/ProtocolHandler.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ProtocolHandler.java?rev=1353501&r1=1353500&r2=1353501&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ProtocolHandler.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ProtocolHandler.java Mon Jun 25 12:53:27 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/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java?rev=1353501&r1=1353500&r2=1353501&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java Mon Jun 25 12:53:27 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/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java?rev=1353501&r1=1353500&r2=1353501&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java Mon Jun 25 12:53:27
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);



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


Mime
View raw message