You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2014/09/18 11:00:15 UTC

svn commit: r1625919 - in /ofbiz/trunk/framework/catalina: ofbiz-component.xml src/org/ofbiz/catalina/container/CatalinaContainer.java

Author: jacopoc
Date: Thu Sep 18 09:00:15 2014
New Revision: 1625919

URL: http://svn.apache.org/r1625919
Log:
Simplified and improved the logic to setup the Tomcat connectors: the logic was overly complex and messed up (probably after all the various upgrades to new Tomcat versions), there were a series of parameters that could not be set, some hardcoded values, some old and no more used (by Tomcat) parameters.
 Improved the information logged about the actual parameters set for the connectors.
Removed Javolution from CatalinaContainer.
Cleaned up the connector configuration file: removed no more used parameters, commented out some parameters (that didn't change the default), commented out some parameters in order to use the Tomcat default values that may improve the performance (e.g. maxThreads in OFBiz was set to a lower value than the default one of newer Tomcat releases and this limits the throughput in default OFBiz setups), updated URLs to Tomcat documentation.

Modified:
    ofbiz/trunk/framework/catalina/ofbiz-component.xml
    ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java

Modified: ofbiz/trunk/framework/catalina/ofbiz-component.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/catalina/ofbiz-component.xml?rev=1625919&r1=1625918&r2=1625919&view=diff
==============================================================================
--- ofbiz/trunk/framework/catalina/ofbiz-component.xml (original)
+++ ofbiz/trunk/framework/catalina/ofbiz-component.xml Thu Sep 18 09:00:15 2014
@@ -66,116 +66,83 @@ under the License.
             <!-- <property name="ssl-accelerator-port" value="8443"/> -->
             <property name="enable-cross-subdomain-sessions" value="false"/>
         </property>
-        <!-- all connectors support type, host, port, enable-lookups -->
         <property name="ajp-connector" value="connector">
-            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/ajp.html for reference -->
-            <property name="allowTrace" value="false"/>
-            <property name="emptySessionPath" value="false"/>
-            <property name="enableLookups" value="true"/>
-            <property name="maxPostSize" value="2097152"/>
+            <!-- see http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html for reference -->
+            <property name="port" value="8009"/>
             <property name="protocol" value="AJP/1.3"/>
-            <property name="proxyName" value=""/>
-            <property name="proxyPort" value=""/>
-            <property name="redirectPort" value=""/>
             <property name="scheme" value="http"/>
             <property name="secure" value="false"/>
             <property name="URIEncoding" value="UTF-8"/>
-            <property name="useBodyEncodingForURI" value="false"/>
             <property name="xpoweredBy" value="true"/>
+            <property name="enableLookups" value="true"/> <!-- set to false to improve performance (false is the default value in Tomcat) -->
             <!-- AJP/13 connector attributes -->
-            <property name="address" value="0.0.0.0"/>
-            <property name="backlog" value="10"/>
-            <property name="maxSpareThreads" value="50"/>
+            <!-- commented out because the values match the Tomcat defaults:
+            <property name="tomcatAuthentication" value="true"/>
+            <property name="allowTrace" value="false"/>
+            <property name="maxPostSize" value="2097152"/>
+            <property name="noCompressionUserAgents" value=""/>
+            <property name="connectionLinger" value="-1"/>
+            <property name="connectionTimeout" value="60000"/>
+            <property name="maxHttpHeaderSize" value="8192"/>
+            <property name="maxKeepAliveRequests" value="100"/>
             <property name="maxThreads" value="200"/>
-            <property name="minSpareThreads" value="4"/>
-            <property name="port" value="8009"/>
+            <property name="minSpareThreads" value="10"/>
+            <property name="acceptCount" value="100"/>
+            <property name="restrictedUserAgents" value=""/>
+            <property name="socketBuffer" value="9000"/>
             <property name="tcpNoDelay" value="true"/>
-            <property name="soTimeout" value="60000"/>
-            <property name="tomcatAuthentication" value="true"/>
+            <property name="threadPriority" value="5"/>
+            -->
         </property>
         <property name="http-connector" value="connector">
-            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference -->
-            <property name="allowTrace" value="false"/>
-            <property name="emptySessionPath" value="false"/>
-            <property name="enableLookups" value="true"/>
-            <property name="maxPostSize" value="2097152"/>
+            <!-- see http://tomcat.apache.org/tomcat-7.0-doc/config/http.html for reference -->
+            <property name="port" value="8080"/>
             <property name="protocol" value="HTTP/1.1"/>
-            <property name="proxyName" value=""/>
-            <property name="proxyPort" value=""/>
-            <property name="redirectPort" value=""/>
             <property name="scheme" value="http"/>
             <property name="secure" value="false"/>
             <property name="URIEncoding" value="UTF-8"/>
-            <property name="useBodyEncodingForURI" value="false"/>
             <property name="xpoweredBy" value="true"/>
-            <!-- HTTP connector attributes -->
-            <property name="acceptCount" value="10"/>
-            <property name="address" value="0.0.0.0"/>
-            <property name="bufferSize" value="2048"/>
+            <property name="enableLookups" value="true"/> <!-- set to false to improve performance (false is the default value in Tomcat) -->
             <property name="compression" value="on"/>
             <property name="compressableMimeType" value="text/html,text/xml,text/plain,text/javascript,text/css"/>
+            <!-- commented out because the values match the Tomcat defaults:
+            <property name="allowTrace" value="false"/>
+            <property name="maxPostSize" value="2097152"/>
             <property name="noCompressionUserAgents" value=""/>
             <property name="connectionLinger" value="-1"/>
             <property name="connectionTimeout" value="60000"/>
-            <property name="disableUploadTimeout" value="false"/>
             <property name="maxHttpHeaderSize" value="8192"/>
             <property name="maxKeepAliveRequests" value="100"/>
-            <property name="maxSpareThreads" value="50"/>
-            <property name="maxThreads" value="100"/>
-            <property name="minSpareThreads" value="4"/>
-            <property name="port" value="8080"/>
+            <property name="maxThreads" value="200"/>
+            <property name="minSpareThreads" value="10"/>
+            <property name="acceptCount" value="100"/>
             <property name="restrictedUserAgents" value=""/>
-            <property name="server" value=""/>
             <property name="socketBuffer" value="9000"/>
-            <property name="strategy" value="lf"/>
             <property name="tcpNoDelay" value="true"/>
-            <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/>
+            <property name="threadPriority" value="5"/>
+            -->
         </property>
         <property name="https-connector" value="connector">
-            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference -->
-            <property name="allowTrace" value="false"/>
-            <property name="emptySessionPath" value="false"/>
-            <property name="enableLookups" value="true"/>
-            <property name="maxPostSize" value="2097152"/>
+            <!-- see http://tomcat.apache.org/tomcat-7.0-doc/config/http.html for reference -->
+            <property name="port" value="8443"/>
             <property name="protocol" value="HTTP/1.1"/>
-            <property name="proxyName" value=""/>
-            <property name="proxyPort" value=""/>
-            <property name="redirectPort" value=""/>
             <property name="scheme" value="https"/>
             <property name="secure" value="true"/>
+            <property name="SSLEnabled" value="true"/>
             <property name="URIEncoding" value="UTF-8"/>
-            <property name="useBodyEncodingForURI" value="false"/>
             <property name="xpoweredBy" value="true"/>
-            <!-- HTTP connector attributes -->
-            <property name="acceptCount" value="10"/>
-            <property name="address" value="0.0.0.0"/>
-            <property name="bufferSize" value="2048"/>
+            <property name="enableLookups" value="true"/> <!-- set to false to improve performance (false is the default value in Tomcat) -->
             <property name="compression" value="on"/>
             <property name="compressableMimeType" value="text/html,text/xml,text/plain,text/javascript,text/css"/>
-            <property name="noCompressionUserAgents" value=""/>
-            <property name="connectionLinger" value="-1"/>
-            <property name="connectionTimeout" value="60000"/>
-            <property name="disableUploadTimeout" value="false"/>
-            <property name="maxHttpHeaderSize" value="8192"/>
-            <property name="maxKeepAliveRequests" value="100"/>
-            <property name="maxSpareThreads" value="50"/>
-            <property name="maxThreads" value="100"/>
-            <property name="minSpareThreads" value="4"/>
-            <property name="port" value="8443"/>
-            <property name="restrictedUserAgents" value=""/>
-            <property name="server" value=""/>
-            <property name="socketBuffer" value="9000"/>
-            <property name="strategy" value="lf"/>
-            <property name="tcpNoDelay" value="true"/>
-            <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/>
             <!-- SSL connector attributes -->
-            <property name="sSLImplementation" value="org.ofbiz.catalina.container.SSLImpl"/>
+            <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
             <property name="algorithm" value="SunX509"/>
             <!-- the clientAuth to "want" in order to receive certs from the client;
                 note that this isn't set this way by default because with certain browsers
                 (like Safari) it breaks access via HTTPS, so until that problem is fixed
-                the default will be false -->
+                the default will be false
             <property name="clientAuth" value="false"/>
+            -->
             <property name="keystoreFile" value="framework/base/config/ofbizssl.jks"/>
             <property name="keystorePass" value="changeit"/>
             <property name="keystoreType" value="JKS"/>
@@ -202,133 +169,40 @@ under the License.
             <property name="access-log-prefix" value="access_log."/>
             <property name="access-log-dir" value="runtime/logs"/>
             <property name="enable-request-dump" value="false"/>
-            <!-- uncomment for cluster support
-            <property name="default-server-cluster" value="cluster">
-                <property name="rep-valve-filter">
-                <property-value>.*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;.*\.png;.*\.css;.*\.ico;.*\.htc;</property-value>
-                </property>
-                <property name="manager-class" value="org.apache.catalina.cluster.session.DeltaManager"/>
-                <property name="debug" value="5"/>
-                <property name="replication-mode" value="org.apache.catalina.tribes.transport.bio.PooledMultiSender"/>
-                <property name="tcp-listen-host" value="auto"/>
-                <property name="tcp-listen-port" value="4001"/>
-                <property name="tcp-sector-timeout" value="100"/>
-                <property name="tcp-thread-count" value="6"/>
-                <property name="mcast-bind-addr" value="192.168.2.1"/>
-                <property name="mcast-addr" value="224.0.0.1"/>
-                <property name="mcast-port" value="45564"/>
-                <property name="mcast-freq" value="500"/>
-                <property name="mcast-drop-time" value="3000"/>
-            </property>
-            -->
-            <!-- <property name="ssl-accelerator-port" value="8443"/> -->
         </property>
-        <!-- all connectors support type, host, port, enable-lookups -->
         <property name="ajp-connector" value="connector">
-            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/ajp.html for reference -->
-            <property name="allowTrace" value="false"/>
-            <property name="emptySessionPath" value="false"/>
-            <property name="enableLookups" value="true"/>
-            <property name="maxPostSize" value="2097152"/>
+            <property name="port" value="8010"/>
             <property name="protocol" value="AJP/1.3"/>
-            <property name="proxyName" value=""/>
-            <property name="proxyPort" value=""/>
-            <property name="redirectPort" value=""/>
             <property name="scheme" value="http"/>
             <property name="secure" value="false"/>
             <property name="URIEncoding" value="UTF-8"/>
-            <property name="useBodyEncodingForURI" value="false"/>
             <property name="xpoweredBy" value="true"/>
-            <!-- AJP/13 connector attributes -->
-            <property name="address" value="0.0.0.0"/>
-            <property name="backlog" value="10"/>
-            <property name="maxSpareThreads" value="50"/>
-            <property name="maxThreads" value="200"/>
-            <property name="minSpareThreads" value="4"/>
-            <property name="port" value="8010"/>
-            <property name="tcpNoDelay" value="true"/>
-            <property name="soTimeout" value="60000"/>
-            <property name="tomcatAuthentication" value="true"/>
+            <property name="enableLookups" value="true"/>
         </property>
         <property name="http-connector" value="connector">
-            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference -->
-            <property name="allowTrace" value="false"/>
-            <property name="emptySessionPath" value="false"/>
-            <property name="enableLookups" value="true"/>
-            <property name="maxPostSize" value="2097152"/>
+            <property name="port" value="8080"/>
             <property name="protocol" value="HTTP/1.1"/>
-            <property name="proxyName" value=""/>
-            <property name="proxyPort" value=""/>
-            <property name="redirectPort" value=""/>
             <property name="scheme" value="http"/>
             <property name="secure" value="false"/>
             <property name="URIEncoding" value="UTF-8"/>
-            <property name="useBodyEncodingForURI" value="false"/>
             <property name="xpoweredBy" value="true"/>
-            <!-- HTTP connector attributes -->
-            <property name="acceptCount" value="10"/>
-            <property name="address" value="0.0.0.0"/>
-            <property name="bufferSize" value="2048"/>
-            <property name="compressableMimeType" value="text/html,text/xml,text/plain"/>
+            <property name="enableLookups" value="true"/>
             <property name="compression" value="on"/>
-            <property name="connectionLinger" value="-1"/>
-            <property name="connectionTimeout" value="60000"/>
-            <property name="disableUploadTimeout" value="false"/>
-            <property name="maxHttpHeaderSize" value="8192"/>
-            <property name="maxKeepAliveRequests" value="100"/>
-            <property name="maxSpareThreads" value="50"/>
-            <property name="maxThreads" value="100"/>
-            <property name="minSpareThreads" value="4"/>
-            <property name="noCompressionUserAgents" value=""/>
-            <property name="port" value="8080"/>
-            <property name="restrictedUserAgents" value=""/>
-            <property name="server" value=""/>
-            <property name="socketBuffer" value="9000"/>
-            <property name="strategy" value="lf"/>
-            <property name="tcpNoDelay" value="true"/>
-            <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/>
+            <property name="compressableMimeType" value="text/html,text/xml,text/plain,text/javascript,text/css"/>
         </property>
         <property name="https-connector" value="connector">
-            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference -->
-            <property name="allowTrace" value="false"/>
-            <property name="emptySessionPath" value="false"/>
-            <property name="enableLookups" value="true"/>
-            <property name="maxPostSize" value="2097152"/>
+            <property name="port" value="8443"/>
             <property name="protocol" value="HTTP/1.1"/>
-            <property name="proxyName" value=""/>
-            <property name="proxyPort" value=""/>
-            <property name="redirectPort" value=""/>
             <property name="scheme" value="https"/>
             <property name="secure" value="true"/>
+            <property name="SSLEnabled" value="true"/>
             <property name="URIEncoding" value="UTF-8"/>
-            <property name="useBodyEncodingForURI" value="false"/>
             <property name="xpoweredBy" value="true"/>
-            <!-- HTTP connector attributes -->
-            <property name="acceptCount" value="10"/>
-            <property name="address" value="0.0.0.0"/>
-            <property name="bufferSize" value="2048"/>
-            <property name="compressableMimeType" value="text/html,text/xml,text/plain"/>
+            <property name="enableLookups" value="true"/>
             <property name="compression" value="on"/>
-            <property name="connectionLinger" value="-1"/>
-            <property name="connectionTimeout" value="60000"/>
-            <property name="disableUploadTimeout" value="false"/>
-            <property name="maxHttpHeaderSize" value="8192"/>
-            <property name="maxKeepAliveRequests" value="100"/>
-            <property name="maxSpareThreads" value="50"/>
-            <property name="maxThreads" value="100"/>
-            <property name="minSpareThreads" value="4"/>
-            <property name="noCompressionUserAgents" value=""/>
-            <property name="port" value="8443"/>
-            <property name="restrictedUserAgents" value=""/>
-            <property name="server" value=""/>
-            <property name="socketBuffer" value="9000"/>
-            <property name="strategy" value="lf"/>
-            <property name="tcpNoDelay" value="true"/>
-            <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/>
-            <!-- SSL connector attributes -->
-            <property name="sSLImplementation" value="org.ofbiz.catalina.container.SSLImpl"/>
+            <property name="compressableMimeType" value="text/html,text/xml,text/plain,text/javascript,text/css"/>
+            <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
             <property name="algorithm" value="SunX509"/>
-            <property name="clientAuth" value="want"/>
             <property name="keystoreFile" value="framework/base/config/ofbizssl.jks"/>
             <property name="keystorePass" value="changeit"/>
             <property name="keystoreType" value="JKS"/>

Modified: ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java?rev=1625919&r1=1625918&r2=1625919&view=diff
==============================================================================
--- ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java (original)
+++ ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java Thu Sep 18 09:00:15 2014
@@ -21,6 +21,7 @@ package org.ofbiz.catalina.container;
 import java.io.File;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -32,8 +33,6 @@ import java.util.concurrent.ScheduledExe
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 
-import javolution.util.FastList;
-
 import org.apache.catalina.Cluster;
 import org.apache.catalina.Context;
 import org.apache.catalina.Engine;
@@ -63,8 +62,6 @@ import org.apache.catalina.tribes.transp
 import org.apache.catalina.tribes.transport.nio.NioReceiver;
 import org.apache.catalina.util.ServerInfo;
 import org.apache.catalina.valves.AccessLogValve;
-import org.apache.coyote.ProtocolHandler;
-import org.apache.coyote.http11.Http11Protocol;
 import org.apache.tomcat.JarScanner;
 import org.apache.tomcat.util.IntrospectionUtils;
 import org.apache.tomcat.util.scan.StandardJarScanner;
@@ -236,25 +233,17 @@ public class CatalinaContainer implement
         // load the web applications
         loadComponents();
 
-        for (Connector con: tomcat.getService().findConnectors()) {
-            ProtocolHandler ph = con.getProtocolHandler();
-            int port = con.getPort();
-            con.setAttribute("port", port);
-            if (ph instanceof Http11Protocol) {
-                Http11Protocol hph = (Http11Protocol) ph;
-                Debug.logInfo("Connector " + hph.getName() + " @ " + hph.getPort() + " - " +
-                    (hph.getSecure() ? "secure" : "not-secure") + " [" + con.getProtocolHandlerClassName() + "] started.", module);
-            } else {
-                Debug.logInfo("Connector " + con.getProtocol() + " @ " + con.getPort() + " - " +
-                    (con.getSecure() ? "secure" : "not-secure") + " [" + con.getProtocolHandlerClassName() + "] started.", module);
-            }
-        }
         // Start the Tomcat server
         try {
             tomcat.getServer().start();
         } catch (LifecycleException e) {
             throw new ContainerException(e);
         }
+
+        for (Connector con: tomcat.getService().findConnectors()) {
+            Debug.logInfo("Connector " + con.getProtocol() + " @ " + con.getPort() + " - " +
+                (con.getSecure() ? "secure" : "not-secure") + " [" + con.getProtocolHandlerClassName() + "] started.", module);
+        }
         Debug.logInfo("Started " + ServerInfo.getServerInfo(), module);
         return true;
     }
@@ -473,87 +462,28 @@ public class CatalinaContainer implement
         if (tomcat == null) {
             throw new ContainerException("Cannot create Connector without Tomcat instance!");
         }
-
-        // need some standard properties
-        String protocol = ContainerConfig.getPropertyValue(connectorProp, "protocol", "HTTP/1.1");
-        String address = ContainerConfig.getPropertyValue(connectorProp, "address", "0.0.0.0");
-        int port = ContainerConfig.getPropertyValue(connectorProp, "port", 0) + Start.getInstance().getConfig().portOffset;
-
-        boolean secure = ContainerConfig.getPropertyValue(connectorProp, "secure", false);
-        if (protocol.toLowerCase().startsWith("ajp")) {
-            protocol = "ajp";
-        } else if ("memory".equals(protocol.toLowerCase())) {
-            protocol = "memory";
-        } else if (secure) {
-            protocol = "https";
-        } else {
-            protocol = "http";
-        }
-
         Connector connector = null;
         if (UtilValidate.isNotEmpty(connectorProp.properties)) {
-            if (address != null) {
-                /*
-                 * InetAddress.toString() returns a string of the form
-                 * "<hostname>/<literal_IP>". Get the latter part, so that the
-                 * address can be parsed (back) into an InetAddress using
-                 * InetAddress.getByName().
-                 */
-                int index = address.indexOf('/');
-                if (index != -1) {
-                    address = address.substring(index + 1);
-                }
-            }
+            String protocol = ContainerConfig.getPropertyValue(connectorProp, "protocol", "HTTP/1.1");
+            int port = ContainerConfig.getPropertyValue(connectorProp, "port", 0) + Start.getInstance().getConfig().portOffset;
 
-            Debug.logInfo("Creating connector for address='" +
-                          ((address == null) ? "ALL" : address) +
-                          "' port='" + port + "' protocol='" + protocol + "'", module);
-
-            try {
-
-                if (protocol.equals("ajp")) {
-                    connector = new Connector("org.apache.coyote.ajp.AjpProtocol");
-                } else if (protocol.equals("memory")) {
-                    connector = new Connector("org.apache.coyote.memory.MemoryProtocolHandler");
-                } else if (protocol.equals("http")) {
-                    connector = new Connector();
-                } else if (protocol.equals("https")) {
-                    connector = new Connector();
-                    connector.setScheme("https");
-                    connector.setSecure(true);
-                    connector.setProperty("SSLEnabled","true");
-                    // FIXME !!!! SET SSL PROPERTIES
-                } else {
-                    connector = new Connector(protocol);
+            // set the protocol and the port first
+            connector = new Connector(protocol);
+            connector.setPort(port);
+            // then set all the other parameters
+            for (ContainerConfig.Container.Property prop: connectorProp.properties.values()) {
+                if ("protocol".equals(prop.name) || "port".equals(prop.name)) {
+                    // protocol and port are already set
+                    continue;
                 }
-
-                if (address != null) {
-                    IntrospectionUtils.setProperty(connector, "address", "" + address);
+                if (IntrospectionUtils.setProperty(connector, prop.name, prop.value)) {
+                    Debug.logInfo("Tomcat " + connector + ": set " + prop.name + "=" + prop.value, module);
+                } else {
+                    Debug.logWarning("Tomcat " + connector + ": ignored parameter " + prop.name, module);
                 }
-                IntrospectionUtils.setProperty(connector, "port", "" + port);
-
-            } catch (Exception e) {
-                Debug.logError(e, "Couldn't create connector.", module);
             }
 
-            try {
-                for (ContainerConfig.Container.Property prop: connectorProp.properties.values()) {
-                    if ("port".equals(prop.name)) {
-                        connector.setProperty(prop.name, "" + port);
-                    } else {
-                        connector.setProperty(prop.name, prop.value);
-                        //connector.setAttribute(prop.name, prop.value);
-                    }
-                }
-
-                if (connectorProp.properties.containsKey("URIEncoding")) {
-                    connector.setURIEncoding(connectorProp.properties.get("URIEncoding").value);
-                }
-
-                tomcat.getService().addConnector(connector);
-            } catch (Exception e) {
-                throw new ContainerException(e);
-            }
+            tomcat.getService().addConnector(connector);
         }
         return connector;
     }
@@ -728,21 +658,21 @@ public class CatalinaContainer implement
 
         // load the applications
         List<ComponentConfig.WebappInfo> webResourceInfos = ComponentConfig.getAllWebappResourceInfos();
-        List<String> loadedMounts = FastList.newInstance();
+        List<String> loadedMounts = new ArrayList<String>();
         if (webResourceInfos == null) {
             return;
         }
 
         ScheduledExecutorService executor = ExecutionPool.getScheduledExecutor(CATALINA_THREAD_GROUP, "catalina-startup", -1, true);
         try {
-            List<Future<Context>> futures = FastList.newInstance();
+            List<Future<Context>> futures = new ArrayList<Future<Context>>();
 
             for (int i = webResourceInfos.size(); i > 0; i--) {
                 ComponentConfig.WebappInfo appInfo = webResourceInfos.get(i - 1);
                 String engineName = appInfo.server;
                 List<String> virtualHosts = appInfo.getVirtualHosts();
                 String mount = appInfo.getContextRoot();
-                List<String> keys = FastList.newInstance();
+                List<String> keys = new ArrayList<String>();
                 if (virtualHosts.isEmpty()) {
                     keys.add(engineName + ":DEFAULT:" + mount);
                 } else {



Re: svn commit: r1625919 - in /ofbiz/trunk/framework/catalina: ofbiz-component.xml src/org/ofbiz/catalina/container/CatalinaContainer.java

Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
Ok,

the trunk demo seems to be working fine now that it is running on the latest revision. My last commit with additional cleanups for the catalina container may have fixed the issue.

Regards,

Jacopo

On Sep 21, 2014, at 9:06 AM, Jacopo Cappellato <ja...@hotwaxmedia.com> wrote:

> Jacques, all,
> 
> I am doing some experiments to figure out the issue on the trunk demo and for this reason it may be unavailable (intermittently) for a few hours today.
> 
> Jacopo
> 
> On Sep 20, 2014, at 5:26 PM, Jacques Le Roux <ja...@les7arts.com> wrote:
> 
>> 
>> Le 20/09/2014 11:44, Jacques Le Roux a écrit :
>>> BTW I made some certificate changes when I installed the demos: http://svn.apache.org/viewvc?view=revision&revision=1598544
>>> I asked about keeping the content of framework/base/cert/ : http://markmail.org/message/jud4g3bbwwusdbfp
>>> Anyway we don't use the new certificate because self signed certificates are the same than no certificates (most modern browsers will warn  about security anyway)
>> 
>> BTW when I say we don't use the new self signed certificate, it's not exactly true. Because we always use it by default (eg in your local instance) but it seems subsumed by the ASF certificate.
>> I don't remember exactly how it's done (if I ever knew/was explained by jani), but one thing I'm sure is there were no changes but "port.https.enabled=N " before I reverted r1626060
>> 
>> HTH
>> 
>> Jacques
>> 
>>> 
>>> Jacques
>>> 
>>> Le 20/09/2014 11:31, Jacques Le Roux a écrit :
>>>> I tried to comment out the 2 entries to no avail
>>>> I then reverted only r1626060 and it fixed the issue
>>>> 
>>>> We use the ASF global certificate ahead in a proxy which allows to use only HTTP for demos.
>>>> The HTTPS traffic is filtered by the proxy and redirected to the HTTP traffic.
>>>> But we don't use certificate in any of the OFBiz demos.
>>>> 
>>>> HTH
>>>> 
>>>> Jacques
>>>> 
>>>> Le 20/09/2014 06:49, Jacopo Cappellato a écrit :
>>>>> I have tested in my local box the setting
>>>>> 
>>>>> port.https.enabled=N
>>>>> 
>>>>> but I was not able to recreate any issue.
>>>>> 
>>>>> Are we using a certificate for the demo? Could you please try to disable the two entries:
>>>>> 
>>>>> <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
>>>>> 
>>>>> from framework/catalina/ofbiz-component.xml
>>>>> 
>>>>> ?
>>>>> 
>>>>> Thanks,
>>>>> 
>>>>> Jacopo
>>>>> 
>>>>> On Sep 19, 2014, at 9:18 AM, Jacopo Cappellato <ja...@gmail.com> wrote:
>>>>> 
>>>>>> On Sep 19, 2014, at 9:05 AM, Jacques Le Roux <ja...@les7arts.com> wrote:
>>>>>> 
>>>>>>> Le 19/09/2014 06:56, Jacopo Cappellato a écrit :
>>>>>>>> On Sep 18, 2014, at 11:00 AM, jacopoc@apache.org wrote:
>>>>>>>> 
>>>>>>>>>           <!-- SSL connector attributes -->
>>>>>>>>> -            <property name="sSLImplementation" value="org.ofbiz.catalina.container.SSLImpl"/>
>>>>>>>>> +            <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
>>>>>>> It seems not related to this particular change (I tested w/ or w/o) but today the trunk demo no longer work when it still was yesterday. I reverted to r1625970 and it's now back again.
>>>>>> Hmm... this may indicate that the issue is in rev. 1626060 but I don't see anything wrong in it (I will double check).
>>>>>> 
>>>>>>> The OFBiz demos use in url.properties
>>>>>>> port.https.enabled=N
>>>>>> I didn't change this part of the framework, I don't know if this is the cause of the issue. I will try to set the same in my local box.
>>>>>> Are you sure that the issue was related to a particular version of OFBiz and not to an issue of the server hosting it?
>>>>>> You could try to comment out the line:
>>>>>> 
>>>>>> <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
>>>>>> 
>>>>>> Jacopo
>>>>>> 
>>>>>> 
>>>>>>> I see only this reason but have no time this morning to check the relation with the trunk demo issue. Locally all works correctly so I guess it's only that
>>>>>>> 
>>>>>>> HTH
>>>>>>> 
>>>>>>> Jacques
>>>>>>> 
>>>>>>>> Thanks,
>>>>>>>> 
>>>>>>>> Jacopo
>>>>> 
>>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
> 


Re: svn commit: r1625919 - in /ofbiz/trunk/framework/catalina: ofbiz-component.xml src/org/ofbiz/catalina/container/CatalinaContainer.java

Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
Jacques, all,

I am doing some experiments to figure out the issue on the trunk demo and for this reason it may be unavailable (intermittently) for a few hours today.

Jacopo

On Sep 20, 2014, at 5:26 PM, Jacques Le Roux <ja...@les7arts.com> wrote:

> 
> Le 20/09/2014 11:44, Jacques Le Roux a écrit :
>> BTW I made some certificate changes when I installed the demos: http://svn.apache.org/viewvc?view=revision&revision=1598544
>> I asked about keeping the content of framework/base/cert/ : http://markmail.org/message/jud4g3bbwwusdbfp
>> Anyway we don't use the new certificate because self signed certificates are the same than no certificates (most modern browsers will warn  about security anyway)
> 
> BTW when I say we don't use the new self signed certificate, it's not exactly true. Because we always use it by default (eg in your local instance) but it seems subsumed by the ASF certificate.
> I don't remember exactly how it's done (if I ever knew/was explained by jani), but one thing I'm sure is there were no changes but "port.https.enabled=N " before I reverted r1626060
> 
> HTH
> 
> Jacques
> 
>> 
>> Jacques
>> 
>> Le 20/09/2014 11:31, Jacques Le Roux a écrit :
>>> I tried to comment out the 2 entries to no avail
>>> I then reverted only r1626060 and it fixed the issue
>>> 
>>> We use the ASF global certificate ahead in a proxy which allows to use only HTTP for demos.
>>> The HTTPS traffic is filtered by the proxy and redirected to the HTTP traffic.
>>> But we don't use certificate in any of the OFBiz demos.
>>> 
>>> HTH
>>> 
>>> Jacques
>>> 
>>> Le 20/09/2014 06:49, Jacopo Cappellato a écrit :
>>>> I have tested in my local box the setting
>>>> 
>>>> port.https.enabled=N
>>>> 
>>>> but I was not able to recreate any issue.
>>>> 
>>>> Are we using a certificate for the demo? Could you please try to disable the two entries:
>>>> 
>>>> <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
>>>> 
>>>> from framework/catalina/ofbiz-component.xml
>>>> 
>>>> ?
>>>> 
>>>> Thanks,
>>>> 
>>>> Jacopo
>>>> 
>>>> On Sep 19, 2014, at 9:18 AM, Jacopo Cappellato <ja...@gmail.com> wrote:
>>>> 
>>>>> On Sep 19, 2014, at 9:05 AM, Jacques Le Roux <ja...@les7arts.com> wrote:
>>>>> 
>>>>>> Le 19/09/2014 06:56, Jacopo Cappellato a écrit :
>>>>>>> On Sep 18, 2014, at 11:00 AM, jacopoc@apache.org wrote:
>>>>>>> 
>>>>>>>>            <!-- SSL connector attributes -->
>>>>>>>> -            <property name="sSLImplementation" value="org.ofbiz.catalina.container.SSLImpl"/>
>>>>>>>> +            <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
>>>>>> It seems not related to this particular change (I tested w/ or w/o) but today the trunk demo no longer work when it still was yesterday. I reverted to r1625970 and it's now back again.
>>>>> Hmm... this may indicate that the issue is in rev. 1626060 but I don't see anything wrong in it (I will double check).
>>>>> 
>>>>>> The OFBiz demos use in url.properties
>>>>>> port.https.enabled=N
>>>>> I didn't change this part of the framework, I don't know if this is the cause of the issue. I will try to set the same in my local box.
>>>>> Are you sure that the issue was related to a particular version of OFBiz and not to an issue of the server hosting it?
>>>>> You could try to comment out the line:
>>>>> 
>>>>> <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
>>>>> 
>>>>> Jacopo
>>>>> 
>>>>> 
>>>>>> I see only this reason but have no time this morning to check the relation with the trunk demo issue. Locally all works correctly so I guess it's only that
>>>>>> 
>>>>>> HTH
>>>>>> 
>>>>>> Jacques
>>>>>> 
>>>>>>> Thanks,
>>>>>>> 
>>>>>>> Jacopo
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 


Re: svn commit: r1625919 - in /ofbiz/trunk/framework/catalina: ofbiz-component.xml src/org/ofbiz/catalina/container/CatalinaContainer.java

Posted by Jacques Le Roux <ja...@les7arts.com>.
Le 20/09/2014 11:44, Jacques Le Roux a écrit :
> BTW I made some certificate changes when I installed the demos: http://svn.apache.org/viewvc?view=revision&revision=1598544
> I asked about keeping the content of framework/base/cert/ : http://markmail.org/message/jud4g3bbwwusdbfp
> Anyway we don't use the new certificate because self signed certificates are the same than no certificates (most modern browsers will warn  about 
> security anyway)

BTW when I say we don't use the new self signed certificate, it's not exactly true. Because we always use it by default (eg in your local instance) 
but it seems subsumed by the ASF certificate.
I don't remember exactly how it's done (if I ever knew/was explained by jani), but one thing I'm sure is there were no changes but 
"port.https.enabled=N " before I reverted r1626060

HTH

Jacques

>
> Jacques
>
> Le 20/09/2014 11:31, Jacques Le Roux a écrit :
>> I tried to comment out the 2 entries to no avail
>> I then reverted only r1626060 and it fixed the issue
>>
>> We use the ASF global certificate ahead in a proxy which allows to use only HTTP for demos.
>> The HTTPS traffic is filtered by the proxy and redirected to the HTTP traffic.
>> But we don't use certificate in any of the OFBiz demos.
>>
>> HTH
>>
>> Jacques
>>
>> Le 20/09/2014 06:49, Jacopo Cappellato a écrit :
>>> I have tested in my local box the setting
>>>
>>> port.https.enabled=N
>>>
>>> but I was not able to recreate any issue.
>>>
>>> Are we using a certificate for the demo? Could you please try to disable the two entries:
>>>
>>> <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
>>>
>>> from framework/catalina/ofbiz-component.xml
>>>
>>> ?
>>>
>>> Thanks,
>>>
>>> Jacopo
>>>
>>> On Sep 19, 2014, at 9:18 AM, Jacopo Cappellato <ja...@gmail.com> wrote:
>>>
>>>> On Sep 19, 2014, at 9:05 AM, Jacques Le Roux <ja...@les7arts.com> wrote:
>>>>
>>>>> Le 19/09/2014 06:56, Jacopo Cappellato a écrit :
>>>>>> On Sep 18, 2014, at 11:00 AM, jacopoc@apache.org wrote:
>>>>>>
>>>>>>>             <!-- SSL connector attributes -->
>>>>>>> -            <property name="sSLImplementation" value="org.ofbiz.catalina.container.SSLImpl"/>
>>>>>>> +            <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
>>>>> It seems not related to this particular change (I tested w/ or w/o) but today the trunk demo no longer work when it still was yesterday. I 
>>>>> reverted to r1625970 and it's now back again.
>>>> Hmm... this may indicate that the issue is in rev. 1626060 but I don't see anything wrong in it (I will double check).
>>>>
>>>>> The OFBiz demos use in url.properties
>>>>> port.https.enabled=N
>>>> I didn't change this part of the framework, I don't know if this is the cause of the issue. I will try to set the same in my local box.
>>>> Are you sure that the issue was related to a particular version of OFBiz and not to an issue of the server hosting it?
>>>> You could try to comment out the line:
>>>>
>>>> <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
>>>>
>>>> Jacopo
>>>>
>>>>
>>>>> I see only this reason but have no time this morning to check the relation with the trunk demo issue. Locally all works correctly so I guess 
>>>>> it's only that
>>>>>
>>>>> HTH
>>>>>
>>>>> Jacques
>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Jacopo
>>>
>>>
>>
>>
>
>


Re: svn commit: r1625919 - in /ofbiz/trunk/framework/catalina: ofbiz-component.xml src/org/ofbiz/catalina/container/CatalinaContainer.java

Posted by Jacques Le Roux <ja...@les7arts.com>.
BTW I made some certificate changes when I installed the demos: http://svn.apache.org/viewvc?view=revision&revision=1598544
I asked about keeping the content of framework/base/cert/ : http://markmail.org/message/jud4g3bbwwusdbfp
Anyway we don't use the new certificate because self signed certificates are the same than no certificates (most modern browsers will warn  about 
security anyway)

Jacques

Le 20/09/2014 11:31, Jacques Le Roux a écrit :
> I tried to comment out the 2 entries to no avail
> I then reverted only r1626060 and it fixed the issue
>
> We use the ASF global certificate ahead in a proxy which allows to use only HTTP for demos.
> The HTTPS traffic is filtered by the proxy and redirected to the HTTP traffic.
> But we don't use certificate in any of the OFBiz demos.
>
> HTH
>
> Jacques
>
> Le 20/09/2014 06:49, Jacopo Cappellato a écrit :
>> I have tested in my local box the setting
>>
>> port.https.enabled=N
>>
>> but I was not able to recreate any issue.
>>
>> Are we using a certificate for the demo? Could you please try to disable the two entries:
>>
>> <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
>>
>> from framework/catalina/ofbiz-component.xml
>>
>> ?
>>
>> Thanks,
>>
>> Jacopo
>>
>> On Sep 19, 2014, at 9:18 AM, Jacopo Cappellato <ja...@gmail.com> wrote:
>>
>>> On Sep 19, 2014, at 9:05 AM, Jacques Le Roux <ja...@les7arts.com> wrote:
>>>
>>>> Le 19/09/2014 06:56, Jacopo Cappellato a écrit :
>>>>> On Sep 18, 2014, at 11:00 AM, jacopoc@apache.org wrote:
>>>>>
>>>>>>             <!-- SSL connector attributes -->
>>>>>> -            <property name="sSLImplementation" value="org.ofbiz.catalina.container.SSLImpl"/>
>>>>>> +            <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
>>>> It seems not related to this particular change (I tested w/ or w/o) but today the trunk demo no longer work when it still was yesterday. I 
>>>> reverted to r1625970 and it's now back again.
>>> Hmm... this may indicate that the issue is in rev. 1626060 but I don't see anything wrong in it (I will double check).
>>>
>>>> The OFBiz demos use in url.properties
>>>> port.https.enabled=N
>>> I didn't change this part of the framework, I don't know if this is the cause of the issue. I will try to set the same in my local box.
>>> Are you sure that the issue was related to a particular version of OFBiz and not to an issue of the server hosting it?
>>> You could try to comment out the line:
>>>
>>> <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
>>>
>>> Jacopo
>>>
>>>
>>>> I see only this reason but have no time this morning to check the relation with the trunk demo issue. Locally all works correctly so I guess it's 
>>>> only that
>>>>
>>>> HTH
>>>>
>>>> Jacques
>>>>
>>>>> Thanks,
>>>>>
>>>>> Jacopo
>>
>>
>
>


Re: svn commit: r1625919 - in /ofbiz/trunk/framework/catalina: ofbiz-component.xml src/org/ofbiz/catalina/container/CatalinaContainer.java

Posted by Jacques Le Roux <ja...@les7arts.com>.
I tried to comment out the 2 entries to no avail
I then reverted only r1626060 and it fixed the issue

We use the ASF global certificate ahead in a proxy which allows to use only HTTP for demos.
The HTTPS traffic is filtered by the proxy and redirected to the HTTP traffic.
But we don't use certificate in any of the OFBiz demos.

HTH

Jacques

Le 20/09/2014 06:49, Jacopo Cappellato a écrit :
> I have tested in my local box the setting
>
> port.https.enabled=N
>
> but I was not able to recreate any issue.
>
> Are we using a certificate for the demo? Could you please try to disable the two entries:
>
> <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
>
> from framework/catalina/ofbiz-component.xml
>
> ?
>
> Thanks,
>
> Jacopo
>
> On Sep 19, 2014, at 9:18 AM, Jacopo Cappellato <ja...@gmail.com> wrote:
>
>> On Sep 19, 2014, at 9:05 AM, Jacques Le Roux <ja...@les7arts.com> wrote:
>>
>>> Le 19/09/2014 06:56, Jacopo Cappellato a écrit :
>>>> On Sep 18, 2014, at 11:00 AM, jacopoc@apache.org wrote:
>>>>
>>>>>             <!-- SSL connector attributes -->
>>>>> -            <property name="sSLImplementation" value="org.ofbiz.catalina.container.SSLImpl"/>
>>>>> +            <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
>>> It seems not related to this particular change (I tested w/ or w/o) but today the trunk demo no longer work when it still was yesterday. I reverted to r1625970 and it's now back again.
>> Hmm... this may indicate that the issue is in rev. 1626060 but I don't see anything wrong in it (I will double check).
>>
>>> The OFBiz demos use in url.properties
>>> port.https.enabled=N
>> I didn't change this part of the framework, I don't know if this is the cause of the issue. I will try to set the same in my local box.
>> Are you sure that the issue was related to a particular version of OFBiz and not to an issue of the server hosting it?
>> You could try to comment out the line:
>>
>> <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
>>
>> Jacopo
>>
>>
>>> I see only this reason but have no time this morning to check the relation with the trunk demo issue. Locally all works correctly so I guess it's only that
>>>
>>> HTH
>>>
>>> Jacques
>>>
>>>> Thanks,
>>>>
>>>> Jacopo
>
>


Re: svn commit: r1625919 - in /ofbiz/trunk/framework/catalina: ofbiz-component.xml src/org/ofbiz/catalina/container/CatalinaContainer.java

Posted by Jacopo Cappellato <ja...@gmail.com>.
I have tested in my local box the setting

port.https.enabled=N

but I was not able to recreate any issue.

Are we using a certificate for the demo? Could you please try to disable the two entries:

<property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>

from framework/catalina/ofbiz-component.xml

?

Thanks,

Jacopo

On Sep 19, 2014, at 9:18 AM, Jacopo Cappellato <ja...@gmail.com> wrote:

> On Sep 19, 2014, at 9:05 AM, Jacques Le Roux <ja...@les7arts.com> wrote:
> 
>> 
>> Le 19/09/2014 06:56, Jacopo Cappellato a écrit :
>>> On Sep 18, 2014, at 11:00 AM, jacopoc@apache.org wrote:
>>> 
>>>>            <!-- SSL connector attributes -->
>>>> -            <property name="sSLImplementation" value="org.ofbiz.catalina.container.SSLImpl"/>
>>>> +            <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
>> 
>> It seems not related to this particular change (I tested w/ or w/o) but today the trunk demo no longer work when it still was yesterday. I reverted to r1625970 and it's now back again.
> 
> Hmm... this may indicate that the issue is in rev. 1626060 but I don't see anything wrong in it (I will double check).
> 
>> The OFBiz demos use in url.properties
>> port.https.enabled=N
> 
> I didn't change this part of the framework, I don't know if this is the cause of the issue. I will try to set the same in my local box.
> Are you sure that the issue was related to a particular version of OFBiz and not to an issue of the server hosting it?
> You could try to comment out the line:
> 
> <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
> 
> Jacopo
> 
> 
>> I see only this reason but have no time this morning to check the relation with the trunk demo issue. Locally all works correctly so I guess it's only that
>> 
>> HTH
>> 
>> Jacques
>> 
>>> 
>>> Thanks,
>>> 
>>> Jacopo
> 


Re: svn commit: r1625919 - in /ofbiz/trunk/framework/catalina: ofbiz-component.xml src/org/ofbiz/catalina/container/CatalinaContainer.java

Posted by Jacopo Cappellato <ja...@gmail.com>.
On Sep 19, 2014, at 9:05 AM, Jacques Le Roux <ja...@les7arts.com> wrote:

> 
> Le 19/09/2014 06:56, Jacopo Cappellato a écrit :
>> On Sep 18, 2014, at 11:00 AM, jacopoc@apache.org wrote:
>> 
>>>             <!-- SSL connector attributes -->
>>> -            <property name="sSLImplementation" value="org.ofbiz.catalina.container.SSLImpl"/>
>>> +            <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
> 
> It seems not related to this particular change (I tested w/ or w/o) but today the trunk demo no longer work when it still was yesterday. I reverted to r1625970 and it's now back again.

Hmm... this may indicate that the issue is in rev. 1626060 but I don't see anything wrong in it (I will double check).

> The OFBiz demos use in url.properties
> port.https.enabled=N

I didn't change this part of the framework, I don't know if this is the cause of the issue. I will try to set the same in my local box.
Are you sure that the issue was related to a particular version of OFBiz and not to an issue of the server hosting it?
You could try to comment out the line:

<property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>

Jacopo


> I see only this reason but have no time this morning to check the relation with the trunk demo issue. Locally all works correctly so I guess it's only that
> 
> HTH
> 
> Jacques
> 
>> 
>> Thanks,
>> 
>> Jacopo


Re: svn commit: r1625919 - in /ofbiz/trunk/framework/catalina: ofbiz-component.xml src/org/ofbiz/catalina/container/CatalinaContainer.java

Posted by Jacques Le Roux <ja...@les7arts.com>.
Le 19/09/2014 06:56, Jacopo Cappellato a écrit :
> On Sep 18, 2014, at 11:00 AM, jacopoc@apache.org wrote:
>
>>              <!-- SSL connector attributes -->
>> -            <property name="sSLImplementation" value="org.ofbiz.catalina.container.SSLImpl"/>
>> +            <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
> Hi all,
>
> I have a concern with the above change to the setting of the "https" connector of Tomcat that I have introduced with rev. 1625919 and I would appreciate your advices.
> The original code was plugging into the https the OFBiz custom SSL class using the connector property: "sSLImplementation".
> However this property name is no more valid in Tomcat and so it was ignored and not set. The default Tomcat implementation was then used.
> With my commit I have fixed the property to match the right name "sslImplementationName" and in fact now the OFBiz class is properly passed and set in the connector.
> Unfortunately I don't know much about the OFBiz implementation related to x509 certs; the purpose of the org.ofbiz.catalina.container.SSLImpl class seems to be that of simply bypassing Tomcat certificate checks (in order to let OFBiz manage them) but I am not sure if this code is mature and still required.
> The easy fix would be that of commenting out the property.
>
> Is anyone currently using (or knows more than me) the OFBiz implementation of x509 certificates?

It seems not related to this particular change (I tested w/ or w/o) but today the trunk demo no longer work when it still was yesterday. I reverted to 
r1625970 and it's now back again.
The OFBiz demos use in url.properties
port.https.enabled=N
I see only this reason but have no time this morning to check the relation with the trunk demo issue. Locally all works correctly so I guess it's only 
that

HTH

Jacques

>
> Thanks,
>
> Jacopo
>
>
>
>


Re: svn commit: r1625919 - in /ofbiz/trunk/framework/catalina: ofbiz-component.xml src/org/ofbiz/catalina/container/CatalinaContainer.java

Posted by Jacopo Cappellato <ja...@gmail.com>.
On Sep 18, 2014, at 11:00 AM, jacopoc@apache.org wrote:

>             <!-- SSL connector attributes -->
> -            <property name="sSLImplementation" value="org.ofbiz.catalina.container.SSLImpl"/>
> +            <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>

Hi all,

I have a concern with the above change to the setting of the "https" connector of Tomcat that I have introduced with rev. 1625919 and I would appreciate your advices.
The original code was plugging into the https the OFBiz custom SSL class using the connector property: "sSLImplementation".
However this property name is no more valid in Tomcat and so it was ignored and not set. The default Tomcat implementation was then used.
With my commit I have fixed the property to match the right name "sslImplementationName" and in fact now the OFBiz class is properly passed and set in the connector.
Unfortunately I don't know much about the OFBiz implementation related to x509 certs; the purpose of the org.ofbiz.catalina.container.SSLImpl class seems to be that of simply bypassing Tomcat certificate checks (in order to let OFBiz manage them) but I am not sure if this code is mature and still required.
The easy fix would be that of commenting out the property.

Is anyone currently using (or knows more than me) the OFBiz implementation of x509 certificates?

Thanks,

Jacopo



Re: Please help testing the Tomcat connector configuration in the trunk

Posted by Jacopo Cappellato <ja...@gmail.com>.
Thank you Arun,

much appreciated!

Jacopo

On Sep 19, 2014, at 12:19 PM, Arun Patidar <ar...@hotwaxmedia.com> wrote:

> Hi Jacopo,
> 
> We have tested ajp connector and it seem to be working fine.
> 
> Thanks & Regards
> ---
> Arun Patidar
> 
> On Thursday 18 September 2014 02:37 PM, Jacopo Cappellato wrote:
>> Hi all,
>> 
>> a few minutes ago with the commit below I have cleaned up the Tomcat connector configuration for the http, https and ajp connectors.
>> In theory the settings should be the same as before (apart for the max number of processing threads that is now larger because it is set to the default value of tomcat) but before this commit some of them were not set because of some bugs in the integration code.
>> Now that the bugs are fixed and the all the parameters are actually set in the connectors, I need your help to confirm that the behavior is still good.
>> I have tested the http and https connectors and they seem to work just fine.
>> I couldn't test the ajp connector: I would appreciate if you could test it and let me know if it still works (as I expect).
>> 
>> Thanks,
>> 
>> Jacopo
>> 
>> Begin forwarded message:
>> 
>>> From: jacopoc@apache.org
>>> Subject: svn commit: r1625919 - in /ofbiz/trunk/framework/catalina: ofbiz-component.xml src/org/ofbiz/catalina/container/CatalinaContainer.java
>>> Date: September 18, 2014 at 11:00:15 AM GMT+2
>>> To: commits@ofbiz.apache.org
>>> Reply-To: dev@ofbiz.apache.org
>>> 
>>> Author: jacopoc
>>> Date: Thu Sep 18 09:00:15 2014
>>> New Revision: 1625919
>>> 
>>> URL: http://svn.apache.org/r1625919
>>> Log:
>>> Simplified and improved the logic to setup the Tomcat connectors: the logic was overly complex and messed up (probably after all the various upgrades to new Tomcat versions), there were a series of parameters that could not be set, some hardcoded values, some old and no more used (by Tomcat) parameters.
>>> Improved the information logged about the actual parameters set for the connectors.
>>> Removed Javolution from CatalinaContainer.
>>> Cleaned up the connector configuration file: removed no more used parameters, commented out some parameters (that didn't change the default), commented out some parameters in order to use the Tomcat default values that may improve the performance (e.g. maxThreads in OFBiz was set to a lower value than the default one of newer Tomcat releases and this limits the throughput in default OFBiz setups), updated URLs to Tomcat documentation.
>>> 
>>> Modified:
>>>    ofbiz/trunk/framework/catalina/ofbiz-component.xml
>>>    ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
>>> 
>>> Modified: ofbiz/trunk/framework/catalina/ofbiz-component.xml
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/catalina/ofbiz-component.xml?rev=1625919&r1=1625918&r2=1625919&view=diff
>>> ==============================================================================
>>> --- ofbiz/trunk/framework/catalina/ofbiz-component.xml (original)
>>> +++ ofbiz/trunk/framework/catalina/ofbiz-component.xml Thu Sep 18 09:00:15 2014
>>> @@ -66,116 +66,83 @@ under the License.
>>>             <!-- <property name="ssl-accelerator-port" value="8443"/> -->
>>>             <property name="enable-cross-subdomain-sessions" value="false"/>
>>>         </property>
>>> -        <!-- all connectors support type, host, port, enable-lookups -->
>>>         <property name="ajp-connector" value="connector">
>>> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/ajp.html for reference -->
>>> -            <property name="allowTrace" value="false"/>
>>> -            <property name="emptySessionPath" value="false"/>
>>> -            <property name="enableLookups" value="true"/>
>>> -            <property name="maxPostSize" value="2097152"/>
>>> +            <!-- see http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html for reference -->
>>> +            <property name="port" value="8009"/>
>>>             <property name="protocol" value="AJP/1.3"/>
>>> -            <property name="proxyName" value=""/>
>>> -            <property name="proxyPort" value=""/>
>>> -            <property name="redirectPort" value=""/>
>>>             <property name="scheme" value="http"/>
>>>             <property name="secure" value="false"/>
>>>             <property name="URIEncoding" value="UTF-8"/>
>>> -            <property name="useBodyEncodingForURI" value="false"/>
>>>             <property name="xpoweredBy" value="true"/>
>>> +            <property name="enableLookups" value="true"/> <!-- set to false to improve performance (false is the default value in Tomcat) -->
>>>             <!-- AJP/13 connector attributes -->
>>> -            <property name="address" value="0.0.0.0"/>
>>> -            <property name="backlog" value="10"/>
>>> -            <property name="maxSpareThreads" value="50"/>
>>> +            <!-- commented out because the values match the Tomcat defaults:
>>> +            <property name="tomcatAuthentication" value="true"/>
>>> +            <property name="allowTrace" value="false"/>
>>> +            <property name="maxPostSize" value="2097152"/>
>>> +            <property name="noCompressionUserAgents" value=""/>
>>> +            <property name="connectionLinger" value="-1"/>
>>> +            <property name="connectionTimeout" value="60000"/>
>>> +            <property name="maxHttpHeaderSize" value="8192"/>
>>> +            <property name="maxKeepAliveRequests" value="100"/>
>>>             <property name="maxThreads" value="200"/>
>>> -            <property name="minSpareThreads" value="4"/>
>>> -            <property name="port" value="8009"/>
>>> +            <property name="minSpareThreads" value="10"/>
>>> +            <property name="acceptCount" value="100"/>
>>> +            <property name="restrictedUserAgents" value=""/>
>>> +            <property name="socketBuffer" value="9000"/>
>>>             <property name="tcpNoDelay" value="true"/>
>>> -            <property name="soTimeout" value="60000"/>
>>> -            <property name="tomcatAuthentication" value="true"/>
>>> +            <property name="threadPriority" value="5"/>
>>> +            -->
>>>         </property>
>>>         <property name="http-connector" value="connector">
>>> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference -->
>>> -            <property name="allowTrace" value="false"/>
>>> -            <property name="emptySessionPath" value="false"/>
>>> -            <property name="enableLookups" value="true"/>
>>> -            <property name="maxPostSize" value="2097152"/>
>>> +            <!-- see http://tomcat.apache.org/tomcat-7.0-doc/config/http.html for reference -->
>>> +            <property name="port" value="8080"/>
>>>             <property name="protocol" value="HTTP/1.1"/>
>>> -            <property name="proxyName" value=""/>
>>> -            <property name="proxyPort" value=""/>
>>> -            <property name="redirectPort" value=""/>
>>>             <property name="scheme" value="http"/>
>>>             <property name="secure" value="false"/>
>>>             <property name="URIEncoding" value="UTF-8"/>
>>> -            <property name="useBodyEncodingForURI" value="false"/>
>>>             <property name="xpoweredBy" value="true"/>
>>> -            <!-- HTTP connector attributes -->
>>> -            <property name="acceptCount" value="10"/>
>>> -            <property name="address" value="0.0.0.0"/>
>>> -            <property name="bufferSize" value="2048"/>
>>> +            <property name="enableLookups" value="true"/> <!-- set to false to improve performance (false is the default value in Tomcat) -->
>>>             <property name="compression" value="on"/>
>>>             <property name="compressableMimeType" value="text/html,text/xml,text/plain,text/javascript,text/css"/>
>>> +            <!-- commented out because the values match the Tomcat defaults:
>>> +            <property name="allowTrace" value="false"/>
>>> +            <property name="maxPostSize" value="2097152"/>
>>>             <property name="noCompressionUserAgents" value=""/>
>>>             <property name="connectionLinger" value="-1"/>
>>>             <property name="connectionTimeout" value="60000"/>
>>> -            <property name="disableUploadTimeout" value="false"/>
>>>             <property name="maxHttpHeaderSize" value="8192"/>
>>>             <property name="maxKeepAliveRequests" value="100"/>
>>> -            <property name="maxSpareThreads" value="50"/>
>>> -            <property name="maxThreads" value="100"/>
>>> -            <property name="minSpareThreads" value="4"/>
>>> -            <property name="port" value="8080"/>
>>> +            <property name="maxThreads" value="200"/>
>>> +            <property name="minSpareThreads" value="10"/>
>>> +            <property name="acceptCount" value="100"/>
>>>             <property name="restrictedUserAgents" value=""/>
>>> -            <property name="server" value=""/>
>>>             <property name="socketBuffer" value="9000"/>
>>> -            <property name="strategy" value="lf"/>
>>>             <property name="tcpNoDelay" value="true"/>
>>> -            <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/>
>>> +            <property name="threadPriority" value="5"/>
>>> +            -->
>>>         </property>
>>>         <property name="https-connector" value="connector">
>>> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference -->
>>> -            <property name="allowTrace" value="false"/>
>>> -            <property name="emptySessionPath" value="false"/>
>>> -            <property name="enableLookups" value="true"/>
>>> -            <property name="maxPostSize" value="2097152"/>
>>> +            <!-- see http://tomcat.apache.org/tomcat-7.0-doc/config/http.html for reference -->
>>> +            <property name="port" value="8443"/>
>>>             <property name="protocol" value="HTTP/1.1"/>
>>> -            <property name="proxyName" value=""/>
>>> -            <property name="proxyPort" value=""/>
>>> -            <property name="redirectPort" value=""/>
>>>             <property name="scheme" value="https"/>
>>>             <property name="secure" value="true"/>
>>> +            <property name="SSLEnabled" value="true"/>
>>>             <property name="URIEncoding" value="UTF-8"/>
>>> -            <property name="useBodyEncodingForURI" value="false"/>
>>>             <property name="xpoweredBy" value="true"/>
>>> -            <!-- HTTP connector attributes -->
>>> -            <property name="acceptCount" value="10"/>
>>> -            <property name="address" value="0.0.0.0"/>
>>> -            <property name="bufferSize" value="2048"/>
>>> +            <property name="enableLookups" value="true"/> <!-- set to false to improve performance (false is the default value in Tomcat) -->
>>>             <property name="compression" value="on"/>
>>>             <property name="compressableMimeType" value="text/html,text/xml,text/plain,text/javascript,text/css"/>
>>> -            <property name="noCompressionUserAgents" value=""/>
>>> -            <property name="connectionLinger" value="-1"/>
>>> -            <property name="connectionTimeout" value="60000"/>
>>> -            <property name="disableUploadTimeout" value="false"/>
>>> -            <property name="maxHttpHeaderSize" value="8192"/>
>>> -            <property name="maxKeepAliveRequests" value="100"/>
>>> -            <property name="maxSpareThreads" value="50"/>
>>> -            <property name="maxThreads" value="100"/>
>>> -            <property name="minSpareThreads" value="4"/>
>>> -            <property name="port" value="8443"/>
>>> -            <property name="restrictedUserAgents" value=""/>
>>> -            <property name="server" value=""/>
>>> -            <property name="socketBuffer" value="9000"/>
>>> -            <property name="strategy" value="lf"/>
>>> -            <property name="tcpNoDelay" value="true"/>
>>> -            <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/>
>>>             <!-- SSL connector attributes -->
>>> -            <property name="sSLImplementation" value="org.ofbiz.catalina.container.SSLImpl"/>
>>> +            <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
>>>             <property name="algorithm" value="SunX509"/>
>>>             <!-- the clientAuth to "want" in order to receive certs from the client;
>>>                 note that this isn't set this way by default because with certain browsers
>>>                 (like Safari) it breaks access via HTTPS, so until that problem is fixed
>>> -                the default will be false -->
>>> +                the default will be false
>>>             <property name="clientAuth" value="false"/>
>>> +            -->
>>>             <property name="keystoreFile" value="framework/base/config/ofbizssl.jks"/>
>>>             <property name="keystorePass" value="changeit"/>
>>>             <property name="keystoreType" value="JKS"/>
>>> @@ -202,133 +169,40 @@ under the License.
>>>             <property name="access-log-prefix" value="access_log."/>
>>>             <property name="access-log-dir" value="runtime/logs"/>
>>>             <property name="enable-request-dump" value="false"/>
>>> -            <!-- uncomment for cluster support
>>> -            <property name="default-server-cluster" value="cluster">
>>> -                <property name="rep-valve-filter">
>>> -                <property-value>.*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;.*\.png;.*\.css;.*\.ico;.*\.htc;</property-value>
>>> -                </property>
>>> -                <property name="manager-class" value="org.apache.catalina.cluster.session.DeltaManager"/>
>>> -                <property name="debug" value="5"/>
>>> -                <property name="replication-mode" value="org.apache.catalina.tribes.transport.bio.PooledMultiSender"/>
>>> -                <property name="tcp-listen-host" value="auto"/>
>>> -                <property name="tcp-listen-port" value="4001"/>
>>> -                <property name="tcp-sector-timeout" value="100"/>
>>> -                <property name="tcp-thread-count" value="6"/>
>>> -                <property name="mcast-bind-addr" value="192.168.2.1"/>
>>> -                <property name="mcast-addr" value="224.0.0.1"/>
>>> -                <property name="mcast-port" value="45564"/>
>>> -                <property name="mcast-freq" value="500"/>
>>> -                <property name="mcast-drop-time" value="3000"/>
>>> -            </property>
>>> -            -->
>>> -            <!-- <property name="ssl-accelerator-port" value="8443"/> -->
>>>         </property>
>>> -        <!-- all connectors support type, host, port, enable-lookups -->
>>>         <property name="ajp-connector" value="connector">
>>> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/ajp.html for reference -->
>>> -            <property name="allowTrace" value="false"/>
>>> -            <property name="emptySessionPath" value="false"/>
>>> -            <property name="enableLookups" value="true"/>
>>> -            <property name="maxPostSize" value="2097152"/>
>>> +            <property name="port" value="8010"/>
>>>             <property name="protocol" value="AJP/1.3"/>
>>> -            <property name="proxyName" value=""/>
>>> -            <property name="proxyPort" value=""/>
>>> -            <property name="redirectPort" value=""/>
>>>             <property name="scheme" value="http"/>
>>>             <property name="secure" value="false"/>
>>>             <property name="URIEncoding" value="UTF-8"/>
>>> -            <property name="useBodyEncodingForURI" value="false"/>
>>>             <property name="xpoweredBy" value="true"/>
>>> -            <!-- AJP/13 connector attributes -->
>>> -            <property name="address" value="0.0.0.0"/>
>>> -            <property name="backlog" value="10"/>
>>> -            <property name="maxSpareThreads" value="50"/>
>>> -            <property name="maxThreads" value="200"/>
>>> -            <property name="minSpareThreads" value="4"/>
>>> -            <property name="port" value="8010"/>
>>> -            <property name="tcpNoDelay" value="true"/>
>>> -            <property name="soTimeout" value="60000"/>
>>> -            <property name="tomcatAuthentication" value="true"/>
>>> +            <property name="enableLookups" value="true"/>
>>>         </property>
>>>         <property name="http-connector" value="connector">
>>> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference -->
>>> -            <property name="allowTrace" value="false"/>
>>> -            <property name="emptySessionPath" value="false"/>
>>> -            <property name="enableLookups" value="true"/>
>>> -            <property name="maxPostSize" value="2097152"/>
>>> +            <property name="port" value="8080"/>
>>>             <property name="protocol" value="HTTP/1.1"/>
>>> -            <property name="proxyName" value=""/>
>>> -            <property name="proxyPort" value=""/>
>>> -            <property name="redirectPort" value=""/>
>>>             <property name="scheme" value="http"/>
>>>             <property name="secure" value="false"/>
>>>             <property name="URIEncoding" value="UTF-8"/>
>>> -            <property name="useBodyEncodingForURI" value="false"/>
>>>             <property name="xpoweredBy" value="true"/>
>>> -            <!-- HTTP connector attributes -->
>>> -            <property name="acceptCount" value="10"/>
>>> -            <property name="address" value="0.0.0.0"/>
>>> -            <property name="bufferSize" value="2048"/>
>>> -            <property name="compressableMimeType" value="text/html,text/xml,text/plain"/>
>>> +            <property name="enableLookups" value="true"/>
>>>             <property name="compression" value="on"/>
>>> -            <property name="connectionLinger" value="-1"/>
>>> -            <property name="connectionTimeout" value="60000"/>
>>> -            <property name="disableUploadTimeout" value="false"/>
>>> -            <property name="maxHttpHeaderSize" value="8192"/>
>>> -            <property name="maxKeepAliveRequests" value="100"/>
>>> -            <property name="maxSpareThreads" value="50"/>
>>> -            <property name="maxThreads" value="100"/>
>>> -            <property name="minSpareThreads" value="4"/>
>>> -            <property name="noCompressionUserAgents" value=""/>
>>> -            <property name="port" value="8080"/>
>>> -            <property name="restrictedUserAgents" value=""/>
>>> -            <property name="server" value=""/>
>>> -            <property name="socketBuffer" value="9000"/>
>>> -            <property name="strategy" value="lf"/>
>>> -            <property name="tcpNoDelay" value="true"/>
>>> -            <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/>
>>> +            <property name="compressableMimeType" value="text/html,text/xml,text/plain,text/javascript,text/css"/>
>>>         </property>
>>>         <property name="https-connector" value="connector">
>>> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference -->
>>> -            <property name="allowTrace" value="false"/>
>>> -            <property name="emptySessionPath" value="false"/>
>>> -            <property name="enableLookups" value="true"/>
>>> -            <property name="maxPostSize" value="2097152"/>
>>> +            <property name="port" value="8443"/>
>>>             <property name="protocol" value="HTTP/1.1"/>
>>> -            <property name="proxyName" value=""/>
>>> -            <property name="proxyPort" value=""/>
>>> -            <property name="redirectPort" value=""/>
>>>             <property name="scheme" value="https"/>
>>>             <property name="secure" value="true"/>
>>> +            <property name="SSLEnabled" value="true"/>
>>>             <property name="URIEncoding" value="UTF-8"/>
>>> -            <property name="useBodyEncodingForURI" value="false"/>
>>>             <property name="xpoweredBy" value="true"/>
>>> -            <!-- HTTP connector attributes -->
>>> -            <property name="acceptCount" value="10"/>
>>> -            <property name="address" value="0.0.0.0"/>
>>> -            <property name="bufferSize" value="2048"/>
>>> -            <property name="compressableMimeType" value="text/html,text/xml,text/plain"/>
>>> +            <property name="enableLookups" value="true"/>
>>>             <property name="compression" value="on"/>
>>> -            <property name="connectionLinger" value="-1"/>
>>> -            <property name="connectionTimeout" value="60000"/>
>>> -            <property name="disableUploadTimeout" value="false"/>
>>> -            <property name="maxHttpHeaderSize" value="8192"/>
>>> -            <property name="maxKeepAliveRequests" value="100"/>
>>> -            <property name="maxSpareThreads" value="50"/>
>>> -            <property name="maxThreads" value="100"/>
>>> -            <property name="minSpareThreads" value="4"/>
>>> -            <property name="noCompressionUserAgents" value=""/>
>>> -            <property name="port" value="8443"/>
>>> -            <property name="restrictedUserAgents" value=""/>
>>> -            <property name="server" value=""/>
>>> -            <property name="socketBuffer" value="9000"/>
>>> -            <property name="strategy" value="lf"/>
>>> -            <property name="tcpNoDelay" value="true"/>
>>> -            <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/>
>>> -            <!-- SSL connector attributes -->
>>> -            <property name="sSLImplementation" value="org.ofbiz.catalina.container.SSLImpl"/>
>>> +            <property name="compressableMimeType" value="text/html,text/xml,text/plain,text/javascript,text/css"/>
>>> +            <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
>>>             <property name="algorithm" value="SunX509"/>
>>> -            <property name="clientAuth" value="want"/>
>>>             <property name="keystoreFile" value="framework/base/config/ofbizssl.jks"/>
>>>             <property name="keystorePass" value="changeit"/>
>>>             <property name="keystoreType" value="JKS"/>
>>> 
>>> Modified: ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java?rev=1625919&r1=1625918&r2=1625919&view=diff
>>> ==============================================================================
>>> --- ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java (original)
>>> +++ ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java Thu Sep 18 09:00:15 2014
>>> @@ -21,6 +21,7 @@ package org.ofbiz.catalina.container;
>>> import java.io.File;
>>> import java.net.MalformedURLException;
>>> import java.net.URL;
>>> +import java.util.ArrayList;
>>> import java.util.HashMap;
>>> import java.util.Iterator;
>>> import java.util.List;
>>> @@ -32,8 +33,6 @@ import java.util.concurrent.ScheduledExe
>>> import javax.naming.InitialContext;
>>> import javax.naming.NamingException;
>>> 
>>> -import javolution.util.FastList;
>>> -
>>> import org.apache.catalina.Cluster;
>>> import org.apache.catalina.Context;
>>> import org.apache.catalina.Engine;
>>> @@ -63,8 +62,6 @@ import org.apache.catalina.tribes.transp
>>> import org.apache.catalina.tribes.transport.nio.NioReceiver;
>>> import org.apache.catalina.util.ServerInfo;
>>> import org.apache.catalina.valves.AccessLogValve;
>>> -import org.apache.coyote.ProtocolHandler;
>>> -import org.apache.coyote.http11.Http11Protocol;
>>> import org.apache.tomcat.JarScanner;
>>> import org.apache.tomcat.util.IntrospectionUtils;
>>> import org.apache.tomcat.util.scan.StandardJarScanner;
>>> @@ -236,25 +233,17 @@ public class CatalinaContainer implement
>>>         // load the web applications
>>>         loadComponents();
>>> 
>>> -        for (Connector con: tomcat.getService().findConnectors()) {
>>> -            ProtocolHandler ph = con.getProtocolHandler();
>>> -            int port = con.getPort();
>>> -            con.setAttribute("port", port);
>>> -            if (ph instanceof Http11Protocol) {
>>> -                Http11Protocol hph = (Http11Protocol) ph;
>>> -                Debug.logInfo("Connector " + hph.getName() + " @ " + hph.getPort() + " - " +
>>> -                    (hph.getSecure() ? "secure" : "not-secure") + " [" + con.getProtocolHandlerClassName() + "] started.", module);
>>> -            } else {
>>> -                Debug.logInfo("Connector " + con.getProtocol() + " @ " + con.getPort() + " - " +
>>> -                    (con.getSecure() ? "secure" : "not-secure") + " [" + con.getProtocolHandlerClassName() + "] started.", module);
>>> -            }
>>> -        }
>>>         // Start the Tomcat server
>>>         try {
>>>             tomcat.getServer().start();
>>>         } catch (LifecycleException e) {
>>>             throw new ContainerException(e);
>>>         }
>>> +
>>> +        for (Connector con: tomcat.getService().findConnectors()) {
>>> +            Debug.logInfo("Connector " + con.getProtocol() + " @ " + con.getPort() + " - " +
>>> +                (con.getSecure() ? "secure" : "not-secure") + " [" + con.getProtocolHandlerClassName() + "] started.", module);
>>> +        }
>>>         Debug.logInfo("Started " + ServerInfo.getServerInfo(), module);
>>>         return true;
>>>     }
>>> @@ -473,87 +462,28 @@ public class CatalinaContainer implement
>>>         if (tomcat == null) {
>>>             throw new ContainerException("Cannot create Connector without Tomcat instance!");
>>>         }
>>> -
>>> -        // need some standard properties
>>> -        String protocol = ContainerConfig.getPropertyValue(connectorProp, "protocol", "HTTP/1.1");
>>> -        String address = ContainerConfig.getPropertyValue(connectorProp, "address", "0.0.0.0");
>>> -        int port = ContainerConfig.getPropertyValue(connectorProp, "port", 0) + Start.getInstance().getConfig().portOffset;
>>> -
>>> -        boolean secure = ContainerConfig.getPropertyValue(connectorProp, "secure", false);
>>> -        if (protocol.toLowerCase().startsWith("ajp")) {
>>> -            protocol = "ajp";
>>> -        } else if ("memory".equals(protocol.toLowerCase())) {
>>> -            protocol = "memory";
>>> -        } else if (secure) {
>>> -            protocol = "https";
>>> -        } else {
>>> -            protocol = "http";
>>> -        }
>>> -
>>>         Connector connector = null;
>>>         if (UtilValidate.isNotEmpty(connectorProp.properties)) {
>>> -            if (address != null) {
>>> -                /*
>>> -                 * InetAddress.toString() returns a string of the form
>>> -                 * "<hostname>/<literal_IP>". Get the latter part, so that the
>>> -                 * address can be parsed (back) into an InetAddress using
>>> -                 * InetAddress.getByName().
>>> -                 */
>>> -                int index = address.indexOf('/');
>>> -                if (index != -1) {
>>> -                    address = address.substring(index + 1);
>>> -                }
>>> -            }
>>> +            String protocol = ContainerConfig.getPropertyValue(connectorProp, "protocol", "HTTP/1.1");
>>> +            int port = ContainerConfig.getPropertyValue(connectorProp, "port", 0) + Start.getInstance().getConfig().portOffset;
>>> 
>>> -            Debug.logInfo("Creating connector for address='" +
>>> -                          ((address == null) ? "ALL" : address) +
>>> -                          "' port='" + port + "' protocol='" + protocol + "'", module);
>>> -
>>> -            try {
>>> -
>>> -                if (protocol.equals("ajp")) {
>>> -                    connector = new Connector("org.apache.coyote.ajp.AjpProtocol");
>>> -                } else if (protocol.equals("memory")) {
>>> -                    connector = new Connector("org.apache.coyote.memory.MemoryProtocolHandler");
>>> -                } else if (protocol.equals("http")) {
>>> -                    connector = new Connector();
>>> -                } else if (protocol.equals("https")) {
>>> -                    connector = new Connector();
>>> -                    connector.setScheme("https");
>>> -                    connector.setSecure(true);
>>> -                    connector.setProperty("SSLEnabled","true");
>>> -                    // FIXME !!!! SET SSL PROPERTIES
>>> -                } else {
>>> -                    connector = new Connector(protocol);
>>> +            // set the protocol and the port first
>>> +            connector = new Connector(protocol);
>>> +            connector.setPort(port);
>>> +            // then set all the other parameters
>>> +            for (ContainerConfig.Container.Property prop: connectorProp.properties.values()) {
>>> +                if ("protocol".equals(prop.name) || "port".equals(prop.name)) {
>>> +                    // protocol and port are already set
>>> +                    continue;
>>>                 }
>>> -
>>> -                if (address != null) {
>>> -                    IntrospectionUtils.setProperty(connector, "address", "" + address);
>>> +                if (IntrospectionUtils.setProperty(connector, prop.name, prop.value)) {
>>> +                    Debug.logInfo("Tomcat " + connector + ": set " + prop.name + "=" + prop.value, module);
>>> +                } else {
>>> +                    Debug.logWarning("Tomcat " + connector + ": ignored parameter " + prop.name, module);
>>>                 }
>>> -                IntrospectionUtils.setProperty(connector, "port", "" + port);
>>> -
>>> -            } catch (Exception e) {
>>> -                Debug.logError(e, "Couldn't create connector.", module);
>>>             }
>>> 
>>> -            try {
>>> -                for (ContainerConfig.Container.Property prop: connectorProp.properties.values()) {
>>> -                    if ("port".equals(prop.name)) {
>>> -                        connector.setProperty(prop.name, "" + port);
>>> -                    } else {
>>> -                        connector.setProperty(prop.name, prop.value);
>>> -                        //connector.setAttribute(prop.name, prop.value);
>>> -                    }
>>> -                }
>>> -
>>> -                if (connectorProp.properties.containsKey("URIEncoding")) {
>>> -                    connector.setURIEncoding(connectorProp.properties.get("URIEncoding").value);
>>> -                }
>>> -
>>> -                tomcat.getService().addConnector(connector);
>>> -            } catch (Exception e) {
>>> -                throw new ContainerException(e);
>>> -            }
>>> +            tomcat.getService().addConnector(connector);
>>>         }
>>>         return connector;
>>>     }
>>> @@ -728,21 +658,21 @@ public class CatalinaContainer implement
>>> 
>>>         // load the applications
>>>         List<ComponentConfig.WebappInfo> webResourceInfos = ComponentConfig.getAllWebappResourceInfos();
>>> -        List<String> loadedMounts = FastList.newInstance();
>>> +        List<String> loadedMounts = new ArrayList<String>();
>>>         if (webResourceInfos == null) {
>>>             return;
>>>         }
>>> 
>>>         ScheduledExecutorService executor = ExecutionPool.getScheduledExecutor(CATALINA_THREAD_GROUP, "catalina-startup", -1, true);
>>>         try {
>>> -            List<Future<Context>> futures = FastList.newInstance();
>>> +            List<Future<Context>> futures = new ArrayList<Future<Context>>();
>>> 
>>>             for (int i = webResourceInfos.size(); i > 0; i--) {
>>>                 ComponentConfig.WebappInfo appInfo = webResourceInfos.get(i - 1);
>>>                 String engineName = appInfo.server;
>>>                 List<String> virtualHosts = appInfo.getVirtualHosts();
>>>                 String mount = appInfo.getContextRoot();
>>> -                List<String> keys = FastList.newInstance();
>>> +                List<String> keys = new ArrayList<String>();
>>>                 if (virtualHosts.isEmpty()) {
>>>                     keys.add(engineName + ":DEFAULT:" + mount);
>>>                 } else {
>>> 
>>> 
> 


Re: Please help testing the Tomcat connector configuration in the trunk

Posted by Arun Patidar <ar...@hotwaxmedia.com>.
Hi Jacopo,

We have tested ajp connector and it seem to be working fine.

Thanks & Regards
---
Arun Patidar

On Thursday 18 September 2014 02:37 PM, Jacopo Cappellato wrote:
> Hi all,
>
> a few minutes ago with the commit below I have cleaned up the Tomcat connector configuration for the http, https and ajp connectors.
> In theory the settings should be the same as before (apart for the max number of processing threads that is now larger because it is set to the default value of tomcat) but before this commit some of them were not set because of some bugs in the integration code.
> Now that the bugs are fixed and the all the parameters are actually set in the connectors, I need your help to confirm that the behavior is still good.
> I have tested the http and https connectors and they seem to work just fine.
> I couldn't test the ajp connector: I would appreciate if you could test it and let me know if it still works (as I expect).
>
> Thanks,
>
> Jacopo
>
> Begin forwarded message:
>
>> From: jacopoc@apache.org
>> Subject: svn commit: r1625919 - in /ofbiz/trunk/framework/catalina: ofbiz-component.xml src/org/ofbiz/catalina/container/CatalinaContainer.java
>> Date: September 18, 2014 at 11:00:15 AM GMT+2
>> To: commits@ofbiz.apache.org
>> Reply-To: dev@ofbiz.apache.org
>>
>> Author: jacopoc
>> Date: Thu Sep 18 09:00:15 2014
>> New Revision: 1625919
>>
>> URL: http://svn.apache.org/r1625919
>> Log:
>> Simplified and improved the logic to setup the Tomcat connectors: the logic was overly complex and messed up (probably after all the various upgrades to new Tomcat versions), there were a series of parameters that could not be set, some hardcoded values, some old and no more used (by Tomcat) parameters.
>> Improved the information logged about the actual parameters set for the connectors.
>> Removed Javolution from CatalinaContainer.
>> Cleaned up the connector configuration file: removed no more used parameters, commented out some parameters (that didn't change the default), commented out some parameters in order to use the Tomcat default values that may improve the performance (e.g. maxThreads in OFBiz was set to a lower value than the default one of newer Tomcat releases and this limits the throughput in default OFBiz setups), updated URLs to Tomcat documentation.
>>
>> Modified:
>>     ofbiz/trunk/framework/catalina/ofbiz-component.xml
>>     ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
>>
>> Modified: ofbiz/trunk/framework/catalina/ofbiz-component.xml
>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/catalina/ofbiz-component.xml?rev=1625919&r1=1625918&r2=1625919&view=diff
>> ==============================================================================
>> --- ofbiz/trunk/framework/catalina/ofbiz-component.xml (original)
>> +++ ofbiz/trunk/framework/catalina/ofbiz-component.xml Thu Sep 18 09:00:15 2014
>> @@ -66,116 +66,83 @@ under the License.
>>              <!-- <property name="ssl-accelerator-port" value="8443"/> -->
>>              <property name="enable-cross-subdomain-sessions" value="false"/>
>>          </property>
>> -        <!-- all connectors support type, host, port, enable-lookups -->
>>          <property name="ajp-connector" value="connector">
>> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/ajp.html for reference -->
>> -            <property name="allowTrace" value="false"/>
>> -            <property name="emptySessionPath" value="false"/>
>> -            <property name="enableLookups" value="true"/>
>> -            <property name="maxPostSize" value="2097152"/>
>> +            <!-- see http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html for reference -->
>> +            <property name="port" value="8009"/>
>>              <property name="protocol" value="AJP/1.3"/>
>> -            <property name="proxyName" value=""/>
>> -            <property name="proxyPort" value=""/>
>> -            <property name="redirectPort" value=""/>
>>              <property name="scheme" value="http"/>
>>              <property name="secure" value="false"/>
>>              <property name="URIEncoding" value="UTF-8"/>
>> -            <property name="useBodyEncodingForURI" value="false"/>
>>              <property name="xpoweredBy" value="true"/>
>> +            <property name="enableLookups" value="true"/> <!-- set to false to improve performance (false is the default value in Tomcat) -->
>>              <!-- AJP/13 connector attributes -->
>> -            <property name="address" value="0.0.0.0"/>
>> -            <property name="backlog" value="10"/>
>> -            <property name="maxSpareThreads" value="50"/>
>> +            <!-- commented out because the values match the Tomcat defaults:
>> +            <property name="tomcatAuthentication" value="true"/>
>> +            <property name="allowTrace" value="false"/>
>> +            <property name="maxPostSize" value="2097152"/>
>> +            <property name="noCompressionUserAgents" value=""/>
>> +            <property name="connectionLinger" value="-1"/>
>> +            <property name="connectionTimeout" value="60000"/>
>> +            <property name="maxHttpHeaderSize" value="8192"/>
>> +            <property name="maxKeepAliveRequests" value="100"/>
>>              <property name="maxThreads" value="200"/>
>> -            <property name="minSpareThreads" value="4"/>
>> -            <property name="port" value="8009"/>
>> +            <property name="minSpareThreads" value="10"/>
>> +            <property name="acceptCount" value="100"/>
>> +            <property name="restrictedUserAgents" value=""/>
>> +            <property name="socketBuffer" value="9000"/>
>>              <property name="tcpNoDelay" value="true"/>
>> -            <property name="soTimeout" value="60000"/>
>> -            <property name="tomcatAuthentication" value="true"/>
>> +            <property name="threadPriority" value="5"/>
>> +            -->
>>          </property>
>>          <property name="http-connector" value="connector">
>> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference -->
>> -            <property name="allowTrace" value="false"/>
>> -            <property name="emptySessionPath" value="false"/>
>> -            <property name="enableLookups" value="true"/>
>> -            <property name="maxPostSize" value="2097152"/>
>> +            <!-- see http://tomcat.apache.org/tomcat-7.0-doc/config/http.html for reference -->
>> +            <property name="port" value="8080"/>
>>              <property name="protocol" value="HTTP/1.1"/>
>> -            <property name="proxyName" value=""/>
>> -            <property name="proxyPort" value=""/>
>> -            <property name="redirectPort" value=""/>
>>              <property name="scheme" value="http"/>
>>              <property name="secure" value="false"/>
>>              <property name="URIEncoding" value="UTF-8"/>
>> -            <property name="useBodyEncodingForURI" value="false"/>
>>              <property name="xpoweredBy" value="true"/>
>> -            <!-- HTTP connector attributes -->
>> -            <property name="acceptCount" value="10"/>
>> -            <property name="address" value="0.0.0.0"/>
>> -            <property name="bufferSize" value="2048"/>
>> +            <property name="enableLookups" value="true"/> <!-- set to false to improve performance (false is the default value in Tomcat) -->
>>              <property name="compression" value="on"/>
>>              <property name="compressableMimeType" value="text/html,text/xml,text/plain,text/javascript,text/css"/>
>> +            <!-- commented out because the values match the Tomcat defaults:
>> +            <property name="allowTrace" value="false"/>
>> +            <property name="maxPostSize" value="2097152"/>
>>              <property name="noCompressionUserAgents" value=""/>
>>              <property name="connectionLinger" value="-1"/>
>>              <property name="connectionTimeout" value="60000"/>
>> -            <property name="disableUploadTimeout" value="false"/>
>>              <property name="maxHttpHeaderSize" value="8192"/>
>>              <property name="maxKeepAliveRequests" value="100"/>
>> -            <property name="maxSpareThreads" value="50"/>
>> -            <property name="maxThreads" value="100"/>
>> -            <property name="minSpareThreads" value="4"/>
>> -            <property name="port" value="8080"/>
>> +            <property name="maxThreads" value="200"/>
>> +            <property name="minSpareThreads" value="10"/>
>> +            <property name="acceptCount" value="100"/>
>>              <property name="restrictedUserAgents" value=""/>
>> -            <property name="server" value=""/>
>>              <property name="socketBuffer" value="9000"/>
>> -            <property name="strategy" value="lf"/>
>>              <property name="tcpNoDelay" value="true"/>
>> -            <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/>
>> +            <property name="threadPriority" value="5"/>
>> +            -->
>>          </property>
>>          <property name="https-connector" value="connector">
>> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference -->
>> -            <property name="allowTrace" value="false"/>
>> -            <property name="emptySessionPath" value="false"/>
>> -            <property name="enableLookups" value="true"/>
>> -            <property name="maxPostSize" value="2097152"/>
>> +            <!-- see http://tomcat.apache.org/tomcat-7.0-doc/config/http.html for reference -->
>> +            <property name="port" value="8443"/>
>>              <property name="protocol" value="HTTP/1.1"/>
>> -            <property name="proxyName" value=""/>
>> -            <property name="proxyPort" value=""/>
>> -            <property name="redirectPort" value=""/>
>>              <property name="scheme" value="https"/>
>>              <property name="secure" value="true"/>
>> +            <property name="SSLEnabled" value="true"/>
>>              <property name="URIEncoding" value="UTF-8"/>
>> -            <property name="useBodyEncodingForURI" value="false"/>
>>              <property name="xpoweredBy" value="true"/>
>> -            <!-- HTTP connector attributes -->
>> -            <property name="acceptCount" value="10"/>
>> -            <property name="address" value="0.0.0.0"/>
>> -            <property name="bufferSize" value="2048"/>
>> +            <property name="enableLookups" value="true"/> <!-- set to false to improve performance (false is the default value in Tomcat) -->
>>              <property name="compression" value="on"/>
>>              <property name="compressableMimeType" value="text/html,text/xml,text/plain,text/javascript,text/css"/>
>> -            <property name="noCompressionUserAgents" value=""/>
>> -            <property name="connectionLinger" value="-1"/>
>> -            <property name="connectionTimeout" value="60000"/>
>> -            <property name="disableUploadTimeout" value="false"/>
>> -            <property name="maxHttpHeaderSize" value="8192"/>
>> -            <property name="maxKeepAliveRequests" value="100"/>
>> -            <property name="maxSpareThreads" value="50"/>
>> -            <property name="maxThreads" value="100"/>
>> -            <property name="minSpareThreads" value="4"/>
>> -            <property name="port" value="8443"/>
>> -            <property name="restrictedUserAgents" value=""/>
>> -            <property name="server" value=""/>
>> -            <property name="socketBuffer" value="9000"/>
>> -            <property name="strategy" value="lf"/>
>> -            <property name="tcpNoDelay" value="true"/>
>> -            <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/>
>>              <!-- SSL connector attributes -->
>> -            <property name="sSLImplementation" value="org.ofbiz.catalina.container.SSLImpl"/>
>> +            <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
>>              <property name="algorithm" value="SunX509"/>
>>              <!-- the clientAuth to "want" in order to receive certs from the client;
>>                  note that this isn't set this way by default because with certain browsers
>>                  (like Safari) it breaks access via HTTPS, so until that problem is fixed
>> -                the default will be false -->
>> +                the default will be false
>>              <property name="clientAuth" value="false"/>
>> +            -->
>>              <property name="keystoreFile" value="framework/base/config/ofbizssl.jks"/>
>>              <property name="keystorePass" value="changeit"/>
>>              <property name="keystoreType" value="JKS"/>
>> @@ -202,133 +169,40 @@ under the License.
>>              <property name="access-log-prefix" value="access_log."/>
>>              <property name="access-log-dir" value="runtime/logs"/>
>>              <property name="enable-request-dump" value="false"/>
>> -            <!-- uncomment for cluster support
>> -            <property name="default-server-cluster" value="cluster">
>> -                <property name="rep-valve-filter">
>> -                <property-value>.*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;.*\.png;.*\.css;.*\.ico;.*\.htc;</property-value>
>> -                </property>
>> -                <property name="manager-class" value="org.apache.catalina.cluster.session.DeltaManager"/>
>> -                <property name="debug" value="5"/>
>> -                <property name="replication-mode" value="org.apache.catalina.tribes.transport.bio.PooledMultiSender"/>
>> -                <property name="tcp-listen-host" value="auto"/>
>> -                <property name="tcp-listen-port" value="4001"/>
>> -                <property name="tcp-sector-timeout" value="100"/>
>> -                <property name="tcp-thread-count" value="6"/>
>> -                <property name="mcast-bind-addr" value="192.168.2.1"/>
>> -                <property name="mcast-addr" value="224.0.0.1"/>
>> -                <property name="mcast-port" value="45564"/>
>> -                <property name="mcast-freq" value="500"/>
>> -                <property name="mcast-drop-time" value="3000"/>
>> -            </property>
>> -            -->
>> -            <!-- <property name="ssl-accelerator-port" value="8443"/> -->
>>          </property>
>> -        <!-- all connectors support type, host, port, enable-lookups -->
>>          <property name="ajp-connector" value="connector">
>> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/ajp.html for reference -->
>> -            <property name="allowTrace" value="false"/>
>> -            <property name="emptySessionPath" value="false"/>
>> -            <property name="enableLookups" value="true"/>
>> -            <property name="maxPostSize" value="2097152"/>
>> +            <property name="port" value="8010"/>
>>              <property name="protocol" value="AJP/1.3"/>
>> -            <property name="proxyName" value=""/>
>> -            <property name="proxyPort" value=""/>
>> -            <property name="redirectPort" value=""/>
>>              <property name="scheme" value="http"/>
>>              <property name="secure" value="false"/>
>>              <property name="URIEncoding" value="UTF-8"/>
>> -            <property name="useBodyEncodingForURI" value="false"/>
>>              <property name="xpoweredBy" value="true"/>
>> -            <!-- AJP/13 connector attributes -->
>> -            <property name="address" value="0.0.0.0"/>
>> -            <property name="backlog" value="10"/>
>> -            <property name="maxSpareThreads" value="50"/>
>> -            <property name="maxThreads" value="200"/>
>> -            <property name="minSpareThreads" value="4"/>
>> -            <property name="port" value="8010"/>
>> -            <property name="tcpNoDelay" value="true"/>
>> -            <property name="soTimeout" value="60000"/>
>> -            <property name="tomcatAuthentication" value="true"/>
>> +            <property name="enableLookups" value="true"/>
>>          </property>
>>          <property name="http-connector" value="connector">
>> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference -->
>> -            <property name="allowTrace" value="false"/>
>> -            <property name="emptySessionPath" value="false"/>
>> -            <property name="enableLookups" value="true"/>
>> -            <property name="maxPostSize" value="2097152"/>
>> +            <property name="port" value="8080"/>
>>              <property name="protocol" value="HTTP/1.1"/>
>> -            <property name="proxyName" value=""/>
>> -            <property name="proxyPort" value=""/>
>> -            <property name="redirectPort" value=""/>
>>              <property name="scheme" value="http"/>
>>              <property name="secure" value="false"/>
>>              <property name="URIEncoding" value="UTF-8"/>
>> -            <property name="useBodyEncodingForURI" value="false"/>
>>              <property name="xpoweredBy" value="true"/>
>> -            <!-- HTTP connector attributes -->
>> -            <property name="acceptCount" value="10"/>
>> -            <property name="address" value="0.0.0.0"/>
>> -            <property name="bufferSize" value="2048"/>
>> -            <property name="compressableMimeType" value="text/html,text/xml,text/plain"/>
>> +            <property name="enableLookups" value="true"/>
>>              <property name="compression" value="on"/>
>> -            <property name="connectionLinger" value="-1"/>
>> -            <property name="connectionTimeout" value="60000"/>
>> -            <property name="disableUploadTimeout" value="false"/>
>> -            <property name="maxHttpHeaderSize" value="8192"/>
>> -            <property name="maxKeepAliveRequests" value="100"/>
>> -            <property name="maxSpareThreads" value="50"/>
>> -            <property name="maxThreads" value="100"/>
>> -            <property name="minSpareThreads" value="4"/>
>> -            <property name="noCompressionUserAgents" value=""/>
>> -            <property name="port" value="8080"/>
>> -            <property name="restrictedUserAgents" value=""/>
>> -            <property name="server" value=""/>
>> -            <property name="socketBuffer" value="9000"/>
>> -            <property name="strategy" value="lf"/>
>> -            <property name="tcpNoDelay" value="true"/>
>> -            <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/>
>> +            <property name="compressableMimeType" value="text/html,text/xml,text/plain,text/javascript,text/css"/>
>>          </property>
>>          <property name="https-connector" value="connector">
>> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference -->
>> -            <property name="allowTrace" value="false"/>
>> -            <property name="emptySessionPath" value="false"/>
>> -            <property name="enableLookups" value="true"/>
>> -            <property name="maxPostSize" value="2097152"/>
>> +            <property name="port" value="8443"/>
>>              <property name="protocol" value="HTTP/1.1"/>
>> -            <property name="proxyName" value=""/>
>> -            <property name="proxyPort" value=""/>
>> -            <property name="redirectPort" value=""/>
>>              <property name="scheme" value="https"/>
>>              <property name="secure" value="true"/>
>> +            <property name="SSLEnabled" value="true"/>
>>              <property name="URIEncoding" value="UTF-8"/>
>> -            <property name="useBodyEncodingForURI" value="false"/>
>>              <property name="xpoweredBy" value="true"/>
>> -            <!-- HTTP connector attributes -->
>> -            <property name="acceptCount" value="10"/>
>> -            <property name="address" value="0.0.0.0"/>
>> -            <property name="bufferSize" value="2048"/>
>> -            <property name="compressableMimeType" value="text/html,text/xml,text/plain"/>
>> +            <property name="enableLookups" value="true"/>
>>              <property name="compression" value="on"/>
>> -            <property name="connectionLinger" value="-1"/>
>> -            <property name="connectionTimeout" value="60000"/>
>> -            <property name="disableUploadTimeout" value="false"/>
>> -            <property name="maxHttpHeaderSize" value="8192"/>
>> -            <property name="maxKeepAliveRequests" value="100"/>
>> -            <property name="maxSpareThreads" value="50"/>
>> -            <property name="maxThreads" value="100"/>
>> -            <property name="minSpareThreads" value="4"/>
>> -            <property name="noCompressionUserAgents" value=""/>
>> -            <property name="port" value="8443"/>
>> -            <property name="restrictedUserAgents" value=""/>
>> -            <property name="server" value=""/>
>> -            <property name="socketBuffer" value="9000"/>
>> -            <property name="strategy" value="lf"/>
>> -            <property name="tcpNoDelay" value="true"/>
>> -            <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/>
>> -            <!-- SSL connector attributes -->
>> -            <property name="sSLImplementation" value="org.ofbiz.catalina.container.SSLImpl"/>
>> +            <property name="compressableMimeType" value="text/html,text/xml,text/plain,text/javascript,text/css"/>
>> +            <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
>>              <property name="algorithm" value="SunX509"/>
>> -            <property name="clientAuth" value="want"/>
>>              <property name="keystoreFile" value="framework/base/config/ofbizssl.jks"/>
>>              <property name="keystorePass" value="changeit"/>
>>              <property name="keystoreType" value="JKS"/>
>>
>> Modified: ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java?rev=1625919&r1=1625918&r2=1625919&view=diff
>> ==============================================================================
>> --- ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java (original)
>> +++ ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java Thu Sep 18 09:00:15 2014
>> @@ -21,6 +21,7 @@ package org.ofbiz.catalina.container;
>> import java.io.File;
>> import java.net.MalformedURLException;
>> import java.net.URL;
>> +import java.util.ArrayList;
>> import java.util.HashMap;
>> import java.util.Iterator;
>> import java.util.List;
>> @@ -32,8 +33,6 @@ import java.util.concurrent.ScheduledExe
>> import javax.naming.InitialContext;
>> import javax.naming.NamingException;
>>
>> -import javolution.util.FastList;
>> -
>> import org.apache.catalina.Cluster;
>> import org.apache.catalina.Context;
>> import org.apache.catalina.Engine;
>> @@ -63,8 +62,6 @@ import org.apache.catalina.tribes.transp
>> import org.apache.catalina.tribes.transport.nio.NioReceiver;
>> import org.apache.catalina.util.ServerInfo;
>> import org.apache.catalina.valves.AccessLogValve;
>> -import org.apache.coyote.ProtocolHandler;
>> -import org.apache.coyote.http11.Http11Protocol;
>> import org.apache.tomcat.JarScanner;
>> import org.apache.tomcat.util.IntrospectionUtils;
>> import org.apache.tomcat.util.scan.StandardJarScanner;
>> @@ -236,25 +233,17 @@ public class CatalinaContainer implement
>>          // load the web applications
>>          loadComponents();
>>
>> -        for (Connector con: tomcat.getService().findConnectors()) {
>> -            ProtocolHandler ph = con.getProtocolHandler();
>> -            int port = con.getPort();
>> -            con.setAttribute("port", port);
>> -            if (ph instanceof Http11Protocol) {
>> -                Http11Protocol hph = (Http11Protocol) ph;
>> -                Debug.logInfo("Connector " + hph.getName() + " @ " + hph.getPort() + " - " +
>> -                    (hph.getSecure() ? "secure" : "not-secure") + " [" + con.getProtocolHandlerClassName() + "] started.", module);
>> -            } else {
>> -                Debug.logInfo("Connector " + con.getProtocol() + " @ " + con.getPort() + " - " +
>> -                    (con.getSecure() ? "secure" : "not-secure") + " [" + con.getProtocolHandlerClassName() + "] started.", module);
>> -            }
>> -        }
>>          // Start the Tomcat server
>>          try {
>>              tomcat.getServer().start();
>>          } catch (LifecycleException e) {
>>              throw new ContainerException(e);
>>          }
>> +
>> +        for (Connector con: tomcat.getService().findConnectors()) {
>> +            Debug.logInfo("Connector " + con.getProtocol() + " @ " + con.getPort() + " - " +
>> +                (con.getSecure() ? "secure" : "not-secure") + " [" + con.getProtocolHandlerClassName() + "] started.", module);
>> +        }
>>          Debug.logInfo("Started " + ServerInfo.getServerInfo(), module);
>>          return true;
>>      }
>> @@ -473,87 +462,28 @@ public class CatalinaContainer implement
>>          if (tomcat == null) {
>>              throw new ContainerException("Cannot create Connector without Tomcat instance!");
>>          }
>> -
>> -        // need some standard properties
>> -        String protocol = ContainerConfig.getPropertyValue(connectorProp, "protocol", "HTTP/1.1");
>> -        String address = ContainerConfig.getPropertyValue(connectorProp, "address", "0.0.0.0");
>> -        int port = ContainerConfig.getPropertyValue(connectorProp, "port", 0) + Start.getInstance().getConfig().portOffset;
>> -
>> -        boolean secure = ContainerConfig.getPropertyValue(connectorProp, "secure", false);
>> -        if (protocol.toLowerCase().startsWith("ajp")) {
>> -            protocol = "ajp";
>> -        } else if ("memory".equals(protocol.toLowerCase())) {
>> -            protocol = "memory";
>> -        } else if (secure) {
>> -            protocol = "https";
>> -        } else {
>> -            protocol = "http";
>> -        }
>> -
>>          Connector connector = null;
>>          if (UtilValidate.isNotEmpty(connectorProp.properties)) {
>> -            if (address != null) {
>> -                /*
>> -                 * InetAddress.toString() returns a string of the form
>> -                 * "<hostname>/<literal_IP>". Get the latter part, so that the
>> -                 * address can be parsed (back) into an InetAddress using
>> -                 * InetAddress.getByName().
>> -                 */
>> -                int index = address.indexOf('/');
>> -                if (index != -1) {
>> -                    address = address.substring(index + 1);
>> -                }
>> -            }
>> +            String protocol = ContainerConfig.getPropertyValue(connectorProp, "protocol", "HTTP/1.1");
>> +            int port = ContainerConfig.getPropertyValue(connectorProp, "port", 0) + Start.getInstance().getConfig().portOffset;
>>
>> -            Debug.logInfo("Creating connector for address='" +
>> -                          ((address == null) ? "ALL" : address) +
>> -                          "' port='" + port + "' protocol='" + protocol + "'", module);
>> -
>> -            try {
>> -
>> -                if (protocol.equals("ajp")) {
>> -                    connector = new Connector("org.apache.coyote.ajp.AjpProtocol");
>> -                } else if (protocol.equals("memory")) {
>> -                    connector = new Connector("org.apache.coyote.memory.MemoryProtocolHandler");
>> -                } else if (protocol.equals("http")) {
>> -                    connector = new Connector();
>> -                } else if (protocol.equals("https")) {
>> -                    connector = new Connector();
>> -                    connector.setScheme("https");
>> -                    connector.setSecure(true);
>> -                    connector.setProperty("SSLEnabled","true");
>> -                    // FIXME !!!! SET SSL PROPERTIES
>> -                } else {
>> -                    connector = new Connector(protocol);
>> +            // set the protocol and the port first
>> +            connector = new Connector(protocol);
>> +            connector.setPort(port);
>> +            // then set all the other parameters
>> +            for (ContainerConfig.Container.Property prop: connectorProp.properties.values()) {
>> +                if ("protocol".equals(prop.name) || "port".equals(prop.name)) {
>> +                    // protocol and port are already set
>> +                    continue;
>>                  }
>> -
>> -                if (address != null) {
>> -                    IntrospectionUtils.setProperty(connector, "address", "" + address);
>> +                if (IntrospectionUtils.setProperty(connector, prop.name, prop.value)) {
>> +                    Debug.logInfo("Tomcat " + connector + ": set " + prop.name + "=" + prop.value, module);
>> +                } else {
>> +                    Debug.logWarning("Tomcat " + connector + ": ignored parameter " + prop.name, module);
>>                  }
>> -                IntrospectionUtils.setProperty(connector, "port", "" + port);
>> -
>> -            } catch (Exception e) {
>> -                Debug.logError(e, "Couldn't create connector.", module);
>>              }
>>
>> -            try {
>> -                for (ContainerConfig.Container.Property prop: connectorProp.properties.values()) {
>> -                    if ("port".equals(prop.name)) {
>> -                        connector.setProperty(prop.name, "" + port);
>> -                    } else {
>> -                        connector.setProperty(prop.name, prop.value);
>> -                        //connector.setAttribute(prop.name, prop.value);
>> -                    }
>> -                }
>> -
>> -                if (connectorProp.properties.containsKey("URIEncoding")) {
>> -                    connector.setURIEncoding(connectorProp.properties.get("URIEncoding").value);
>> -                }
>> -
>> -                tomcat.getService().addConnector(connector);
>> -            } catch (Exception e) {
>> -                throw new ContainerException(e);
>> -            }
>> +            tomcat.getService().addConnector(connector);
>>          }
>>          return connector;
>>      }
>> @@ -728,21 +658,21 @@ public class CatalinaContainer implement
>>
>>          // load the applications
>>          List<ComponentConfig.WebappInfo> webResourceInfos = ComponentConfig.getAllWebappResourceInfos();
>> -        List<String> loadedMounts = FastList.newInstance();
>> +        List<String> loadedMounts = new ArrayList<String>();
>>          if (webResourceInfos == null) {
>>              return;
>>          }
>>
>>          ScheduledExecutorService executor = ExecutionPool.getScheduledExecutor(CATALINA_THREAD_GROUP, "catalina-startup", -1, true);
>>          try {
>> -            List<Future<Context>> futures = FastList.newInstance();
>> +            List<Future<Context>> futures = new ArrayList<Future<Context>>();
>>
>>              for (int i = webResourceInfos.size(); i > 0; i--) {
>>                  ComponentConfig.WebappInfo appInfo = webResourceInfos.get(i - 1);
>>                  String engineName = appInfo.server;
>>                  List<String> virtualHosts = appInfo.getVirtualHosts();
>>                  String mount = appInfo.getContextRoot();
>> -                List<String> keys = FastList.newInstance();
>> +                List<String> keys = new ArrayList<String>();
>>                  if (virtualHosts.isEmpty()) {
>>                      keys.add(engineName + ":DEFAULT:" + mount);
>>                  } else {
>>
>>


Please help testing the Tomcat connector configuration in the trunk

Posted by Jacopo Cappellato <ja...@gmail.com>.
Hi all,

a few minutes ago with the commit below I have cleaned up the Tomcat connector configuration for the http, https and ajp connectors.
In theory the settings should be the same as before (apart for the max number of processing threads that is now larger because it is set to the default value of tomcat) but before this commit some of them were not set because of some bugs in the integration code.
Now that the bugs are fixed and the all the parameters are actually set in the connectors, I need your help to confirm that the behavior is still good.
I have tested the http and https connectors and they seem to work just fine.
I couldn't test the ajp connector: I would appreciate if you could test it and let me know if it still works (as I expect).

Thanks,

Jacopo

Begin forwarded message:

> From: jacopoc@apache.org
> Subject: svn commit: r1625919 - in /ofbiz/trunk/framework/catalina: ofbiz-component.xml src/org/ofbiz/catalina/container/CatalinaContainer.java
> Date: September 18, 2014 at 11:00:15 AM GMT+2
> To: commits@ofbiz.apache.org
> Reply-To: dev@ofbiz.apache.org
> 
> Author: jacopoc
> Date: Thu Sep 18 09:00:15 2014
> New Revision: 1625919
> 
> URL: http://svn.apache.org/r1625919
> Log:
> Simplified and improved the logic to setup the Tomcat connectors: the logic was overly complex and messed up (probably after all the various upgrades to new Tomcat versions), there were a series of parameters that could not be set, some hardcoded values, some old and no more used (by Tomcat) parameters.
> Improved the information logged about the actual parameters set for the connectors.
> Removed Javolution from CatalinaContainer.
> Cleaned up the connector configuration file: removed no more used parameters, commented out some parameters (that didn't change the default), commented out some parameters in order to use the Tomcat default values that may improve the performance (e.g. maxThreads in OFBiz was set to a lower value than the default one of newer Tomcat releases and this limits the throughput in default OFBiz setups), updated URLs to Tomcat documentation.
> 
> Modified:
>    ofbiz/trunk/framework/catalina/ofbiz-component.xml
>    ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
> 
> Modified: ofbiz/trunk/framework/catalina/ofbiz-component.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/catalina/ofbiz-component.xml?rev=1625919&r1=1625918&r2=1625919&view=diff
> ==============================================================================
> --- ofbiz/trunk/framework/catalina/ofbiz-component.xml (original)
> +++ ofbiz/trunk/framework/catalina/ofbiz-component.xml Thu Sep 18 09:00:15 2014
> @@ -66,116 +66,83 @@ under the License.
>             <!-- <property name="ssl-accelerator-port" value="8443"/> -->
>             <property name="enable-cross-subdomain-sessions" value="false"/>
>         </property>
> -        <!-- all connectors support type, host, port, enable-lookups -->
>         <property name="ajp-connector" value="connector">
> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/ajp.html for reference -->
> -            <property name="allowTrace" value="false"/>
> -            <property name="emptySessionPath" value="false"/>
> -            <property name="enableLookups" value="true"/>
> -            <property name="maxPostSize" value="2097152"/>
> +            <!-- see http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html for reference -->
> +            <property name="port" value="8009"/>
>             <property name="protocol" value="AJP/1.3"/>
> -            <property name="proxyName" value=""/>
> -            <property name="proxyPort" value=""/>
> -            <property name="redirectPort" value=""/>
>             <property name="scheme" value="http"/>
>             <property name="secure" value="false"/>
>             <property name="URIEncoding" value="UTF-8"/>
> -            <property name="useBodyEncodingForURI" value="false"/>
>             <property name="xpoweredBy" value="true"/>
> +            <property name="enableLookups" value="true"/> <!-- set to false to improve performance (false is the default value in Tomcat) -->
>             <!-- AJP/13 connector attributes -->
> -            <property name="address" value="0.0.0.0"/>
> -            <property name="backlog" value="10"/>
> -            <property name="maxSpareThreads" value="50"/>
> +            <!-- commented out because the values match the Tomcat defaults:
> +            <property name="tomcatAuthentication" value="true"/>
> +            <property name="allowTrace" value="false"/>
> +            <property name="maxPostSize" value="2097152"/>
> +            <property name="noCompressionUserAgents" value=""/>
> +            <property name="connectionLinger" value="-1"/>
> +            <property name="connectionTimeout" value="60000"/>
> +            <property name="maxHttpHeaderSize" value="8192"/>
> +            <property name="maxKeepAliveRequests" value="100"/>
>             <property name="maxThreads" value="200"/>
> -            <property name="minSpareThreads" value="4"/>
> -            <property name="port" value="8009"/>
> +            <property name="minSpareThreads" value="10"/>
> +            <property name="acceptCount" value="100"/>
> +            <property name="restrictedUserAgents" value=""/>
> +            <property name="socketBuffer" value="9000"/>
>             <property name="tcpNoDelay" value="true"/>
> -            <property name="soTimeout" value="60000"/>
> -            <property name="tomcatAuthentication" value="true"/>
> +            <property name="threadPriority" value="5"/>
> +            -->
>         </property>
>         <property name="http-connector" value="connector">
> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference -->
> -            <property name="allowTrace" value="false"/>
> -            <property name="emptySessionPath" value="false"/>
> -            <property name="enableLookups" value="true"/>
> -            <property name="maxPostSize" value="2097152"/>
> +            <!-- see http://tomcat.apache.org/tomcat-7.0-doc/config/http.html for reference -->
> +            <property name="port" value="8080"/>
>             <property name="protocol" value="HTTP/1.1"/>
> -            <property name="proxyName" value=""/>
> -            <property name="proxyPort" value=""/>
> -            <property name="redirectPort" value=""/>
>             <property name="scheme" value="http"/>
>             <property name="secure" value="false"/>
>             <property name="URIEncoding" value="UTF-8"/>
> -            <property name="useBodyEncodingForURI" value="false"/>
>             <property name="xpoweredBy" value="true"/>
> -            <!-- HTTP connector attributes -->
> -            <property name="acceptCount" value="10"/>
> -            <property name="address" value="0.0.0.0"/>
> -            <property name="bufferSize" value="2048"/>
> +            <property name="enableLookups" value="true"/> <!-- set to false to improve performance (false is the default value in Tomcat) -->
>             <property name="compression" value="on"/>
>             <property name="compressableMimeType" value="text/html,text/xml,text/plain,text/javascript,text/css"/>
> +            <!-- commented out because the values match the Tomcat defaults:
> +            <property name="allowTrace" value="false"/>
> +            <property name="maxPostSize" value="2097152"/>
>             <property name="noCompressionUserAgents" value=""/>
>             <property name="connectionLinger" value="-1"/>
>             <property name="connectionTimeout" value="60000"/>
> -            <property name="disableUploadTimeout" value="false"/>
>             <property name="maxHttpHeaderSize" value="8192"/>
>             <property name="maxKeepAliveRequests" value="100"/>
> -            <property name="maxSpareThreads" value="50"/>
> -            <property name="maxThreads" value="100"/>
> -            <property name="minSpareThreads" value="4"/>
> -            <property name="port" value="8080"/>
> +            <property name="maxThreads" value="200"/>
> +            <property name="minSpareThreads" value="10"/>
> +            <property name="acceptCount" value="100"/>
>             <property name="restrictedUserAgents" value=""/>
> -            <property name="server" value=""/>
>             <property name="socketBuffer" value="9000"/>
> -            <property name="strategy" value="lf"/>
>             <property name="tcpNoDelay" value="true"/>
> -            <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/>
> +            <property name="threadPriority" value="5"/>
> +            -->
>         </property>
>         <property name="https-connector" value="connector">
> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference -->
> -            <property name="allowTrace" value="false"/>
> -            <property name="emptySessionPath" value="false"/>
> -            <property name="enableLookups" value="true"/>
> -            <property name="maxPostSize" value="2097152"/>
> +            <!-- see http://tomcat.apache.org/tomcat-7.0-doc/config/http.html for reference -->
> +            <property name="port" value="8443"/>
>             <property name="protocol" value="HTTP/1.1"/>
> -            <property name="proxyName" value=""/>
> -            <property name="proxyPort" value=""/>
> -            <property name="redirectPort" value=""/>
>             <property name="scheme" value="https"/>
>             <property name="secure" value="true"/>
> +            <property name="SSLEnabled" value="true"/>
>             <property name="URIEncoding" value="UTF-8"/>
> -            <property name="useBodyEncodingForURI" value="false"/>
>             <property name="xpoweredBy" value="true"/>
> -            <!-- HTTP connector attributes -->
> -            <property name="acceptCount" value="10"/>
> -            <property name="address" value="0.0.0.0"/>
> -            <property name="bufferSize" value="2048"/>
> +            <property name="enableLookups" value="true"/> <!-- set to false to improve performance (false is the default value in Tomcat) -->
>             <property name="compression" value="on"/>
>             <property name="compressableMimeType" value="text/html,text/xml,text/plain,text/javascript,text/css"/>
> -            <property name="noCompressionUserAgents" value=""/>
> -            <property name="connectionLinger" value="-1"/>
> -            <property name="connectionTimeout" value="60000"/>
> -            <property name="disableUploadTimeout" value="false"/>
> -            <property name="maxHttpHeaderSize" value="8192"/>
> -            <property name="maxKeepAliveRequests" value="100"/>
> -            <property name="maxSpareThreads" value="50"/>
> -            <property name="maxThreads" value="100"/>
> -            <property name="minSpareThreads" value="4"/>
> -            <property name="port" value="8443"/>
> -            <property name="restrictedUserAgents" value=""/>
> -            <property name="server" value=""/>
> -            <property name="socketBuffer" value="9000"/>
> -            <property name="strategy" value="lf"/>
> -            <property name="tcpNoDelay" value="true"/>
> -            <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/>
>             <!-- SSL connector attributes -->
> -            <property name="sSLImplementation" value="org.ofbiz.catalina.container.SSLImpl"/>
> +            <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
>             <property name="algorithm" value="SunX509"/>
>             <!-- the clientAuth to "want" in order to receive certs from the client;
>                 note that this isn't set this way by default because with certain browsers
>                 (like Safari) it breaks access via HTTPS, so until that problem is fixed
> -                the default will be false -->
> +                the default will be false
>             <property name="clientAuth" value="false"/>
> +            -->
>             <property name="keystoreFile" value="framework/base/config/ofbizssl.jks"/>
>             <property name="keystorePass" value="changeit"/>
>             <property name="keystoreType" value="JKS"/>
> @@ -202,133 +169,40 @@ under the License.
>             <property name="access-log-prefix" value="access_log."/>
>             <property name="access-log-dir" value="runtime/logs"/>
>             <property name="enable-request-dump" value="false"/>
> -            <!-- uncomment for cluster support
> -            <property name="default-server-cluster" value="cluster">
> -                <property name="rep-valve-filter">
> -                <property-value>.*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;.*\.png;.*\.css;.*\.ico;.*\.htc;</property-value>
> -                </property>
> -                <property name="manager-class" value="org.apache.catalina.cluster.session.DeltaManager"/>
> -                <property name="debug" value="5"/>
> -                <property name="replication-mode" value="org.apache.catalina.tribes.transport.bio.PooledMultiSender"/>
> -                <property name="tcp-listen-host" value="auto"/>
> -                <property name="tcp-listen-port" value="4001"/>
> -                <property name="tcp-sector-timeout" value="100"/>
> -                <property name="tcp-thread-count" value="6"/>
> -                <property name="mcast-bind-addr" value="192.168.2.1"/>
> -                <property name="mcast-addr" value="224.0.0.1"/>
> -                <property name="mcast-port" value="45564"/>
> -                <property name="mcast-freq" value="500"/>
> -                <property name="mcast-drop-time" value="3000"/>
> -            </property>
> -            -->
> -            <!-- <property name="ssl-accelerator-port" value="8443"/> -->
>         </property>
> -        <!-- all connectors support type, host, port, enable-lookups -->
>         <property name="ajp-connector" value="connector">
> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/ajp.html for reference -->
> -            <property name="allowTrace" value="false"/>
> -            <property name="emptySessionPath" value="false"/>
> -            <property name="enableLookups" value="true"/>
> -            <property name="maxPostSize" value="2097152"/>
> +            <property name="port" value="8010"/>
>             <property name="protocol" value="AJP/1.3"/>
> -            <property name="proxyName" value=""/>
> -            <property name="proxyPort" value=""/>
> -            <property name="redirectPort" value=""/>
>             <property name="scheme" value="http"/>
>             <property name="secure" value="false"/>
>             <property name="URIEncoding" value="UTF-8"/>
> -            <property name="useBodyEncodingForURI" value="false"/>
>             <property name="xpoweredBy" value="true"/>
> -            <!-- AJP/13 connector attributes -->
> -            <property name="address" value="0.0.0.0"/>
> -            <property name="backlog" value="10"/>
> -            <property name="maxSpareThreads" value="50"/>
> -            <property name="maxThreads" value="200"/>
> -            <property name="minSpareThreads" value="4"/>
> -            <property name="port" value="8010"/>
> -            <property name="tcpNoDelay" value="true"/>
> -            <property name="soTimeout" value="60000"/>
> -            <property name="tomcatAuthentication" value="true"/>
> +            <property name="enableLookups" value="true"/>
>         </property>
>         <property name="http-connector" value="connector">
> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference -->
> -            <property name="allowTrace" value="false"/>
> -            <property name="emptySessionPath" value="false"/>
> -            <property name="enableLookups" value="true"/>
> -            <property name="maxPostSize" value="2097152"/>
> +            <property name="port" value="8080"/>
>             <property name="protocol" value="HTTP/1.1"/>
> -            <property name="proxyName" value=""/>
> -            <property name="proxyPort" value=""/>
> -            <property name="redirectPort" value=""/>
>             <property name="scheme" value="http"/>
>             <property name="secure" value="false"/>
>             <property name="URIEncoding" value="UTF-8"/>
> -            <property name="useBodyEncodingForURI" value="false"/>
>             <property name="xpoweredBy" value="true"/>
> -            <!-- HTTP connector attributes -->
> -            <property name="acceptCount" value="10"/>
> -            <property name="address" value="0.0.0.0"/>
> -            <property name="bufferSize" value="2048"/>
> -            <property name="compressableMimeType" value="text/html,text/xml,text/plain"/>
> +            <property name="enableLookups" value="true"/>
>             <property name="compression" value="on"/>
> -            <property name="connectionLinger" value="-1"/>
> -            <property name="connectionTimeout" value="60000"/>
> -            <property name="disableUploadTimeout" value="false"/>
> -            <property name="maxHttpHeaderSize" value="8192"/>
> -            <property name="maxKeepAliveRequests" value="100"/>
> -            <property name="maxSpareThreads" value="50"/>
> -            <property name="maxThreads" value="100"/>
> -            <property name="minSpareThreads" value="4"/>
> -            <property name="noCompressionUserAgents" value=""/>
> -            <property name="port" value="8080"/>
> -            <property name="restrictedUserAgents" value=""/>
> -            <property name="server" value=""/>
> -            <property name="socketBuffer" value="9000"/>
> -            <property name="strategy" value="lf"/>
> -            <property name="tcpNoDelay" value="true"/>
> -            <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/>
> +            <property name="compressableMimeType" value="text/html,text/xml,text/plain,text/javascript,text/css"/>
>         </property>
>         <property name="https-connector" value="connector">
> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference -->
> -            <property name="allowTrace" value="false"/>
> -            <property name="emptySessionPath" value="false"/>
> -            <property name="enableLookups" value="true"/>
> -            <property name="maxPostSize" value="2097152"/>
> +            <property name="port" value="8443"/>
>             <property name="protocol" value="HTTP/1.1"/>
> -            <property name="proxyName" value=""/>
> -            <property name="proxyPort" value=""/>
> -            <property name="redirectPort" value=""/>
>             <property name="scheme" value="https"/>
>             <property name="secure" value="true"/>
> +            <property name="SSLEnabled" value="true"/>
>             <property name="URIEncoding" value="UTF-8"/>
> -            <property name="useBodyEncodingForURI" value="false"/>
>             <property name="xpoweredBy" value="true"/>
> -            <!-- HTTP connector attributes -->
> -            <property name="acceptCount" value="10"/>
> -            <property name="address" value="0.0.0.0"/>
> -            <property name="bufferSize" value="2048"/>
> -            <property name="compressableMimeType" value="text/html,text/xml,text/plain"/>
> +            <property name="enableLookups" value="true"/>
>             <property name="compression" value="on"/>
> -            <property name="connectionLinger" value="-1"/>
> -            <property name="connectionTimeout" value="60000"/>
> -            <property name="disableUploadTimeout" value="false"/>
> -            <property name="maxHttpHeaderSize" value="8192"/>
> -            <property name="maxKeepAliveRequests" value="100"/>
> -            <property name="maxSpareThreads" value="50"/>
> -            <property name="maxThreads" value="100"/>
> -            <property name="minSpareThreads" value="4"/>
> -            <property name="noCompressionUserAgents" value=""/>
> -            <property name="port" value="8443"/>
> -            <property name="restrictedUserAgents" value=""/>
> -            <property name="server" value=""/>
> -            <property name="socketBuffer" value="9000"/>
> -            <property name="strategy" value="lf"/>
> -            <property name="tcpNoDelay" value="true"/>
> -            <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/>
> -            <!-- SSL connector attributes -->
> -            <property name="sSLImplementation" value="org.ofbiz.catalina.container.SSLImpl"/>
> +            <property name="compressableMimeType" value="text/html,text/xml,text/plain,text/javascript,text/css"/>
> +            <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
>             <property name="algorithm" value="SunX509"/>
> -            <property name="clientAuth" value="want"/>
>             <property name="keystoreFile" value="framework/base/config/ofbizssl.jks"/>
>             <property name="keystorePass" value="changeit"/>
>             <property name="keystoreType" value="JKS"/>
> 
> Modified: ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java?rev=1625919&r1=1625918&r2=1625919&view=diff
> ==============================================================================
> --- ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java (original)
> +++ ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java Thu Sep 18 09:00:15 2014
> @@ -21,6 +21,7 @@ package org.ofbiz.catalina.container;
> import java.io.File;
> import java.net.MalformedURLException;
> import java.net.URL;
> +import java.util.ArrayList;
> import java.util.HashMap;
> import java.util.Iterator;
> import java.util.List;
> @@ -32,8 +33,6 @@ import java.util.concurrent.ScheduledExe
> import javax.naming.InitialContext;
> import javax.naming.NamingException;
> 
> -import javolution.util.FastList;
> -
> import org.apache.catalina.Cluster;
> import org.apache.catalina.Context;
> import org.apache.catalina.Engine;
> @@ -63,8 +62,6 @@ import org.apache.catalina.tribes.transp
> import org.apache.catalina.tribes.transport.nio.NioReceiver;
> import org.apache.catalina.util.ServerInfo;
> import org.apache.catalina.valves.AccessLogValve;
> -import org.apache.coyote.ProtocolHandler;
> -import org.apache.coyote.http11.Http11Protocol;
> import org.apache.tomcat.JarScanner;
> import org.apache.tomcat.util.IntrospectionUtils;
> import org.apache.tomcat.util.scan.StandardJarScanner;
> @@ -236,25 +233,17 @@ public class CatalinaContainer implement
>         // load the web applications
>         loadComponents();
> 
> -        for (Connector con: tomcat.getService().findConnectors()) {
> -            ProtocolHandler ph = con.getProtocolHandler();
> -            int port = con.getPort();
> -            con.setAttribute("port", port);
> -            if (ph instanceof Http11Protocol) {
> -                Http11Protocol hph = (Http11Protocol) ph;
> -                Debug.logInfo("Connector " + hph.getName() + " @ " + hph.getPort() + " - " +
> -                    (hph.getSecure() ? "secure" : "not-secure") + " [" + con.getProtocolHandlerClassName() + "] started.", module);
> -            } else {
> -                Debug.logInfo("Connector " + con.getProtocol() + " @ " + con.getPort() + " - " +
> -                    (con.getSecure() ? "secure" : "not-secure") + " [" + con.getProtocolHandlerClassName() + "] started.", module);
> -            }
> -        }
>         // Start the Tomcat server
>         try {
>             tomcat.getServer().start();
>         } catch (LifecycleException e) {
>             throw new ContainerException(e);
>         }
> +
> +        for (Connector con: tomcat.getService().findConnectors()) {
> +            Debug.logInfo("Connector " + con.getProtocol() + " @ " + con.getPort() + " - " +
> +                (con.getSecure() ? "secure" : "not-secure") + " [" + con.getProtocolHandlerClassName() + "] started.", module);
> +        }
>         Debug.logInfo("Started " + ServerInfo.getServerInfo(), module);
>         return true;
>     }
> @@ -473,87 +462,28 @@ public class CatalinaContainer implement
>         if (tomcat == null) {
>             throw new ContainerException("Cannot create Connector without Tomcat instance!");
>         }
> -
> -        // need some standard properties
> -        String protocol = ContainerConfig.getPropertyValue(connectorProp, "protocol", "HTTP/1.1");
> -        String address = ContainerConfig.getPropertyValue(connectorProp, "address", "0.0.0.0");
> -        int port = ContainerConfig.getPropertyValue(connectorProp, "port", 0) + Start.getInstance().getConfig().portOffset;
> -
> -        boolean secure = ContainerConfig.getPropertyValue(connectorProp, "secure", false);
> -        if (protocol.toLowerCase().startsWith("ajp")) {
> -            protocol = "ajp";
> -        } else if ("memory".equals(protocol.toLowerCase())) {
> -            protocol = "memory";
> -        } else if (secure) {
> -            protocol = "https";
> -        } else {
> -            protocol = "http";
> -        }
> -
>         Connector connector = null;
>         if (UtilValidate.isNotEmpty(connectorProp.properties)) {
> -            if (address != null) {
> -                /*
> -                 * InetAddress.toString() returns a string of the form
> -                 * "<hostname>/<literal_IP>". Get the latter part, so that the
> -                 * address can be parsed (back) into an InetAddress using
> -                 * InetAddress.getByName().
> -                 */
> -                int index = address.indexOf('/');
> -                if (index != -1) {
> -                    address = address.substring(index + 1);
> -                }
> -            }
> +            String protocol = ContainerConfig.getPropertyValue(connectorProp, "protocol", "HTTP/1.1");
> +            int port = ContainerConfig.getPropertyValue(connectorProp, "port", 0) + Start.getInstance().getConfig().portOffset;
> 
> -            Debug.logInfo("Creating connector for address='" +
> -                          ((address == null) ? "ALL" : address) +
> -                          "' port='" + port + "' protocol='" + protocol + "'", module);
> -
> -            try {
> -
> -                if (protocol.equals("ajp")) {
> -                    connector = new Connector("org.apache.coyote.ajp.AjpProtocol");
> -                } else if (protocol.equals("memory")) {
> -                    connector = new Connector("org.apache.coyote.memory.MemoryProtocolHandler");
> -                } else if (protocol.equals("http")) {
> -                    connector = new Connector();
> -                } else if (protocol.equals("https")) {
> -                    connector = new Connector();
> -                    connector.setScheme("https");
> -                    connector.setSecure(true);
> -                    connector.setProperty("SSLEnabled","true");
> -                    // FIXME !!!! SET SSL PROPERTIES
> -                } else {
> -                    connector = new Connector(protocol);
> +            // set the protocol and the port first
> +            connector = new Connector(protocol);
> +            connector.setPort(port);
> +            // then set all the other parameters
> +            for (ContainerConfig.Container.Property prop: connectorProp.properties.values()) {
> +                if ("protocol".equals(prop.name) || "port".equals(prop.name)) {
> +                    // protocol and port are already set
> +                    continue;
>                 }
> -
> -                if (address != null) {
> -                    IntrospectionUtils.setProperty(connector, "address", "" + address);
> +                if (IntrospectionUtils.setProperty(connector, prop.name, prop.value)) {
> +                    Debug.logInfo("Tomcat " + connector + ": set " + prop.name + "=" + prop.value, module);
> +                } else {
> +                    Debug.logWarning("Tomcat " + connector + ": ignored parameter " + prop.name, module);
>                 }
> -                IntrospectionUtils.setProperty(connector, "port", "" + port);
> -
> -            } catch (Exception e) {
> -                Debug.logError(e, "Couldn't create connector.", module);
>             }
> 
> -            try {
> -                for (ContainerConfig.Container.Property prop: connectorProp.properties.values()) {
> -                    if ("port".equals(prop.name)) {
> -                        connector.setProperty(prop.name, "" + port);
> -                    } else {
> -                        connector.setProperty(prop.name, prop.value);
> -                        //connector.setAttribute(prop.name, prop.value);
> -                    }
> -                }
> -
> -                if (connectorProp.properties.containsKey("URIEncoding")) {
> -                    connector.setURIEncoding(connectorProp.properties.get("URIEncoding").value);
> -                }
> -
> -                tomcat.getService().addConnector(connector);
> -            } catch (Exception e) {
> -                throw new ContainerException(e);
> -            }
> +            tomcat.getService().addConnector(connector);
>         }
>         return connector;
>     }
> @@ -728,21 +658,21 @@ public class CatalinaContainer implement
> 
>         // load the applications
>         List<ComponentConfig.WebappInfo> webResourceInfos = ComponentConfig.getAllWebappResourceInfos();
> -        List<String> loadedMounts = FastList.newInstance();
> +        List<String> loadedMounts = new ArrayList<String>();
>         if (webResourceInfos == null) {
>             return;
>         }
> 
>         ScheduledExecutorService executor = ExecutionPool.getScheduledExecutor(CATALINA_THREAD_GROUP, "catalina-startup", -1, true);
>         try {
> -            List<Future<Context>> futures = FastList.newInstance();
> +            List<Future<Context>> futures = new ArrayList<Future<Context>>();
> 
>             for (int i = webResourceInfos.size(); i > 0; i--) {
>                 ComponentConfig.WebappInfo appInfo = webResourceInfos.get(i - 1);
>                 String engineName = appInfo.server;
>                 List<String> virtualHosts = appInfo.getVirtualHosts();
>                 String mount = appInfo.getContextRoot();
> -                List<String> keys = FastList.newInstance();
> +                List<String> keys = new ArrayList<String>();
>                 if (virtualHosts.isEmpty()) {
>                     keys.add(engineName + ":DEFAULT:" + mount);
>                 } else {
> 
> 


Re: svn commit: r1625919 - in /ofbiz/trunk/framework/catalina: ofbiz-component.xml src/org/ofbiz/catalina/container/CatalinaContainer.java

Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
done in rev. 1627490

Jacopo

On Sep 24, 2014, at 1:07 PM, Jacques Le Roux <ja...@les7arts.com> wrote:

> +1
> 
> Jacques
> 
> Le 24/09/2014 11:02, Pierre Smits a écrit :
>> I agree. Most of the times users have a proxy in front of app servers.
>> Setting this to 'true' would mean additional and unnecessary resource
>> consumption.
>> 
>> Pierre Smits
>> 
>> *ORRTIZ.COM <http://www.orrtiz.com>*
>> Services & Solutions for Cloud-
>> Based Manufacturing, Professional
>> Services and Retail & Trade
>> http://www.orrtiz.com
>> 
>> On Wed, Sep 24, 2014 at 10:42 AM, Jacopo Cappellato <
>> jacopo.cappellato@hotwaxmedia.com> wrote:
>> 
>>> Thanks for mentioning this.
>>> My preference would be to use the default value as is in tomcat (i.e.
>>> comment out this setting).
>>> I didn't change its value but I have added the comment as a reminder to
>>> discuss this with you all.
>>> 
>>> Here is what Tomcat doc says:
>>> 
>>> "enableLookups:
>>> Set to true if you want calls to request.getRemoteHost() to perform DNS
>>> lookups in order to return the actual host name of the remote client. Set
>>> to false to skip the DNS lookup and return the IP address in String form
>>> instead (thereby improving performance). By default, DNS lookups are
>>> disabled."
>>> 
>>> Do we agree to change it to use the default value of "false"?
>>> 
>>> Jacopo
>>> 
>>> 
>>> On Sep 24, 2014, at 10:35 AM, Jacques Le Roux <
>>> jacques.le.roux@les7arts.com> wrote:
>>> 
>>>> Hi Jacopo,
>>>> 
>>>> I was confused by the enableLookups parameter default value (false)
>>> which is now clearly defined in Tomcat 7.
>>>> Confusion came from here:
>>> http://www.baselogic.com/blog/development/java-javaee-j2ee/tomcat-6-connector-option-enablelookups-defaulting-true/
>>>> Do you know why are we not using the default value (once again false)?
>>>> 
>>>> Jacques
>>>> 
>>>> Le 18/09/2014 11:00, jacopoc@apache.org a écrit :
>>>>> Author: jacopoc
>>>>> Date: Thu Sep 18 09:00:15 2014
>>>>> New Revision: 1625919
>>>>> 
>>>>> URL: http://svn.apache.org/r1625919
>>>>> Log:
>>>>> Simplified and improved the logic to setup the Tomcat connectors: the
>>> logic was overly complex and messed up (probably after all the various
>>> upgrades to new Tomcat versions), there were a series of parameters that
>>> could not be set, some hardcoded values, some old and no more used (by
>>> Tomcat) parameters.
>>>>>  Improved the information logged about the actual parameters set for
>>> the connectors.
>>>>> Removed Javolution from CatalinaContainer.
>>>>> Cleaned up the connector configuration file: removed no more used
>>> parameters, commented out some parameters (that didn't change the default),
>>> commented out some parameters in order to use the Tomcat default values
>>> that may improve the performance (e.g. maxThreads in OFBiz was set to a
>>> lower value than the default one of newer Tomcat releases and this limits
>>> the throughput in default OFBiz setups), updated URLs to Tomcat
>>> documentation.
>>>>> Modified:
>>>>>     ofbiz/trunk/framework/catalina/ofbiz-component.xml
>>>>> 
>>>  ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
>>>>> Modified: ofbiz/trunk/framework/catalina/ofbiz-component.xml
>>>>> URL:
>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/catalina/ofbiz-component.xml?rev=1625919&r1=1625918&r2=1625919&view=diff
>>> ==============================================================================
>>>>> --- ofbiz/trunk/framework/catalina/ofbiz-component.xml (original)
>>>>> +++ ofbiz/trunk/framework/catalina/ofbiz-component.xml Thu Sep 18
>>> 09:00:15 2014
>>>>> @@ -66,116 +66,83 @@ under the License.
>>>>>              <!-- <property name="ssl-accelerator-port" value="8443"/>
>>> -->
>>>>>              <property name="enable-cross-subdomain-sessions"
>>> value="false"/>
>>>>>          </property>
>>>>> -        <!-- all connectors support type, host, port, enable-lookups
>>> -->
>>>>>          <property name="ajp-connector" value="connector">
>>>>> -            <!-- see
>>> http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/ajp.html for
>>> reference -->
>>>>> -            <property name="allowTrace" value="false"/>
>>>>> -            <property name="emptySessionPath" value="false"/>
>>>>> -            <property name="enableLookups" value="true"/>
>>>>> -            <property name="maxPostSize" value="2097152"/>
>>>>> +            <!-- see
>>> http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html for reference -->
>>>>> +            <property name="port" value="8009"/>
>>>>>              <property name="protocol" value="AJP/1.3"/>
>>>>> -            <property name="proxyName" value=""/>
>>>>> -            <property name="proxyPort" value=""/>
>>>>> -            <property name="redirectPort" value=""/>
>>>>>              <property name="scheme" value="http"/>
>>>>>              <property name="secure" value="false"/>
>>>>>              <property name="URIEncoding" value="UTF-8"/>
>>>>> -            <property name="useBodyEncodingForURI" value="false"/>
>>>>>              <property name="xpoweredBy" value="true"/>
>>>>> +            <property name="enableLookups" value="true"/> <!-- set to
>>> false to improve performance (false is the default value in Tomcat) -->
>>>>>              <!-- AJP/13 connector attributes -->
>>>>> -            <property name="address" value="0.0.0.0"/>
>>>>> -            <property name="backlog" value="10"/>
>>>>> -            <property name="maxSpareThreads" value="50"/>
>>>>> +            <!-- commented out because the values match the Tomcat
>>> defaults:
>>>>> +            <property name="tomcatAuthentication" value="true"/>
>>>>> +            <property name="allowTrace" value="false"/>
>>>>> +            <property name="maxPostSize" value="2097152"/>
>>>>> +            <property name="noCompressionUserAgents" value=""/>
>>>>> +            <property name="connectionLinger" value="-1"/>
>>>>> +            <property name="connectionTimeout" value="60000"/>
>>>>> +            <property name="maxHttpHeaderSize" value="8192"/>
>>>>> +            <property name="maxKeepAliveRequests" value="100"/>
>>>>>              <property name="maxThreads" value="200"/>
>>>>> -            <property name="minSpareThreads" value="4"/>
>>>>> -            <property name="port" value="8009"/>
>>>>> +            <property name="minSpareThreads" value="10"/>
>>>>> +            <property name="acceptCount" value="100"/>
>>>>> +            <property name="restrictedUserAgents" value=""/>
>>>>> +            <property name="socketBuffer" value="9000"/>
>>>>>              <property name="tcpNoDelay" value="true"/>
>>>>> -            <property name="soTimeout" value="60000"/>
>>>>> -            <property name="tomcatAuthentication" value="true"/>
>>>>> +            <property name="threadPriority" value="5"/>
>>>>> +            -->
>>>>>          </property>
>>>>>          <property name="http-connector" value="connector">
>>>>> -            <!-- see
>>> http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for
>>> reference -->
>>>>> -            <property name="allowTrace" value="false"/>
>>>>> -            <property name="emptySessionPath" value="false"/>
>>>>> -            <property name="enableLookups" value="true"/>
>>>>> -            <property name="maxPostSize" value="2097152"/>
>>>>> +            <!-- see
>>> http://tomcat.apache.org/tomcat-7.0-doc/config/http.html for reference -->
>>>>> +            <property name="port" value="8080"/>
>>>>>              <property name="protocol" value="HTTP/1.1"/>
>>>>> -            <property name="proxyName" value=""/>
>>>>> -            <property name="proxyPort" value=""/>
>>>>> -            <property name="redirectPort" value=""/>
>>>>>              <property name="scheme" value="http"/>
>>>>>              <property name="secure" value="false"/>
>>>>>              <property name="URIEncoding" value="UTF-8"/>
>>>>> -            <property name="useBodyEncodingForURI" value="false"/>
>>>>>              <property name="xpoweredBy" value="true"/>
>>>>> -            <!-- HTTP connector attributes -->
>>>>> -            <property name="acceptCount" value="10"/>
>>>>> -            <property name="address" value="0.0.0.0"/>
>>>>> -            <property name="bufferSize" value="2048"/>
>>>>> +            <property name="enableLookups" value="true"/> <!-- set to
>>> false to improve performance (false is the default value in Tomcat) -->
>>>>>              <property name="compression" value="on"/>
>>>>>              <property name="compressableMimeType"
>>> value="text/html,text/xml,text/plain,text/javascript,text/css"/>
>>>>> +            <!-- commented out because the values match the Tomcat
>>> defaults:
>>>>> +            <property name="allowTrace" value="false"/>
>>>>> +            <property name="maxPostSize" value="2097152"/>
>>>>>              <property name="noCompressionUserAgents" value=""/>
>>>>>              <property name="connectionLinger" value="-1"/>
>>>>>              <property name="connectionTimeout" value="60000"/>
>>>>> -            <property name="disableUploadTimeout" value="false"/>
>>>>>              <property name="maxHttpHeaderSize" value="8192"/>
>>>>>              <property name="maxKeepAliveRequests" value="100"/>
>>>>> -            <property name="maxSpareThreads" value="50"/>
>>>>> -            <property name="maxThreads" value="100"/>
>>>>> -            <property name="minSpareThreads" value="4"/>
>>>>> -            <property name="port" value="8080"/>
>>>>> +            <property name="maxThreads" value="200"/>
>>>>> +            <property name="minSpareThreads" value="10"/>
>>>>> +            <property name="acceptCount" value="100"/>
>>>>>              <property name="restrictedUserAgents" value=""/>
>>>>> -            <property name="server" value=""/>
>>>>>              <property name="socketBuffer" value="9000"/>
>>>>> -            <property name="strategy" value="lf"/>
>>>>>              <property name="tcpNoDelay" value="true"/>
>>>>> -            <property name="threadPriority"
>>> value="java.lang.Thread#NORM_PRIORITY"/>
>>>>> +            <property name="threadPriority" value="5"/>
>>>>> +            -->
>>>>>          </property>
>>>>>          <property name="https-connector" value="connector">
>>>>> -            <!-- see
>>> http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for
>>> reference -->
>>>>> -            <property name="allowTrace" value="false"/>
>>>>> -            <property name="emptySessionPath" value="false"/>
>>>>> -            <property name="enableLookups" value="true"/>
>>>>> -            <property name="maxPostSize" value="2097152"/>
>>>>> +            <!-- see
>>> http://tomcat.apache.org/tomcat-7.0-doc/config/http.html for reference -->
>>>>> +            <property name="port" value="8443"/>
>>>>>              <property name="protocol" value="HTTP/1.1"/>
>>>>> -            <property name="proxyName" value=""/>
>>>>> -            <property name="proxyPort" value=""/>
>>>>> -            <property name="redirectPort" value=""/>
>>>>>              <property name="scheme" value="https"/>
>>>>>              <property name="secure" value="true"/>
>>>>> +            <property name="SSLEnabled" value="true"/>
>>>>>              <property name="URIEncoding" value="UTF-8"/>
>>>>> -            <property name="useBodyEncodingForURI" value="false"/>
>>>>>              <property name="xpoweredBy" value="true"/>
>>>>> -            <!-- HTTP connector attributes -->
>>>>> -            <property name="acceptCount" value="10"/>
>>>>> -            <property name="address" value="0.0.0.0"/>
>>>>> -            <property name="bufferSize" value="2048"/>
>>>>> +            <property name="enableLookups" value="true"/> <!-- set to
>>> false to improve performance (false is the default value in Tomcat) -->
>>>>>              <property name="compression" value="on"/>
>>>>>              <property name="compressableMimeType"
>>> value="text/html,text/xml,text/plain,text/javascript,text/css"/>
>>>>> -            <property name="noCompressionUserAgents" value=""/>
>>>>> -            <property name="connectionLinger" value="-1"/>
>>>>> -            <property name="connectionTimeout" value="60000"/>
>>>>> -            <property name="disableUploadTimeout" value="false"/>
>>>>> -            <property name="maxHttpHeaderSize" value="8192"/>
>>>>> -            <property name="maxKeepAliveRequests" value="100"/>
>>>>> -            <property name="maxSpareThreads" value="50"/>
>>>>> -            <property name="maxThreads" value="100"/>
>>>>> -            <property name="minSpareThreads" value="4"/>
>>>>> -            <property name="port" value="8443"/>
>>>>> -            <property name="restrictedUserAgents" value=""/>
>>>>> -            <property name="server" value=""/>
>>>>> -            <property name="socketBuffer" value="9000"/>
>>>>> -            <property name="strategy" value="lf"/>
>>>>> -            <property name="tcpNoDelay" value="true"/>
>>>>> -            <property name="threadPriority"
>>> value="java.lang.Thread#NORM_PRIORITY"/>
>>>>>              <!-- SSL connector attributes -->
>>>>> -            <property name="sSLImplementation"
>>> value="org.ofbiz.catalina.container.SSLImpl"/>
>>>>> +            <property name="sslImplementationName"
>>> value="org.ofbiz.catalina.container.SSLImpl"/>
>>>>>              <property name="algorithm" value="SunX509"/>
>>>>>              <!-- the clientAuth to "want" in order to receive certs
>>> from the client;
>>>>>                  note that this isn't set this way by default because
>>> with certain browsers
>>>>>                  (like Safari) it breaks access via HTTPS, so until
>>> that problem is fixed
>>>>> -                the default will be false -->
>>>>> +                the default will be false
>>>>>              <property name="clientAuth" value="false"/>
>>>>> +            -->
>>>>>              <property name="keystoreFile"
>>> value="framework/base/config/ofbizssl.jks"/>
>>>>>              <property name="keystorePass" value="changeit"/>
>>>>>              <property name="keystoreType" value="JKS"/>
>>>>> @@ -202,133 +169,40 @@ under the License.
>>>>>              <property name="access-log-prefix" value="access_log."/>
>>>>>              <property name="access-log-dir" value="runtime/logs"/>
>>>>>              <property name="enable-request-dump" value="false"/>
>>>>> -            <!-- uncomment for cluster support
>>>>> -            <property name="default-server-cluster" value="cluster">
>>>>> -                <property name="rep-valve-filter">
>>>>> -
>>> <property-value>.*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;.*\.png;.*\.css;.*\.ico;.*\.htc;</property-value>
>>>>> -                </property>
>>>>> -                <property name="manager-class"
>>> value="org.apache.catalina.cluster.session.DeltaManager"/>
>>>>> -                <property name="debug" value="5"/>
>>>>> -                <property name="replication-mode"
>>> value="org.apache.catalina.tribes.transport.bio.PooledMultiSender"/>
>>>>> -                <property name="tcp-listen-host" value="auto"/>
>>>>> -                <property name="tcp-listen-port" value="4001"/>
>>>>> -                <property name="tcp-sector-timeout" value="100"/>
>>>>> -                <property name="tcp-thread-count" value="6"/>
>>>>> -                <property name="mcast-bind-addr" value="192.168.2.1"/>
>>>>> -                <property name="mcast-addr" value="224.0.0.1"/>
>>>>> -                <property name="mcast-port" value="45564"/>
>>>>> -                <property name="mcast-freq" value="500"/>
>>>>> -                <property name="mcast-drop-time" value="3000"/>
>>>>> -            </property>
>>>>> -            -->
>>>>> -            <!-- <property name="ssl-accelerator-port" value="8443"/>
>>> -->
>>>>>          </property>
>>>>> -        <!-- all connectors support type, host, port, enable-lookups
>>> -->
>>>>>          <property name="ajp-connector" value="connector">
>>>>> -            <!-- see
>>> http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/ajp.html for
>>> reference -->
>>>>> -            <property name="allowTrace" value="false"/>
>>>>> -            <property name="emptySessionPath" value="false"/>
>>>>> -            <property name="enableLookups" value="true"/>
>>>>> -            <property name="maxPostSize" value="2097152"/>
>>>>> +            <property name="port" value="8010"/>
>>>>>              <property name="protocol" value="AJP/1.3"/>
>>>>> -            <property name="proxyName" value=""/>
>>>>> -            <property name="proxyPort" value=""/>
>>>>> -            <property name="redirectPort" value=""/>
>>>>>              <property name="scheme" value="http"/>
>>>>>              <property name="secure" value="false"/>
>>>>>              <property name="URIEncoding" value="UTF-8"/>
>>>>> -            <property name="useBodyEncodingForURI" value="false"/>
>>>>>              <property name="xpoweredBy" value="true"/>
>>>>> -            <!-- AJP/13 connector attributes -->
>>>>> -            <property name="address" value="0.0.0.0"/>
>>>>> -            <property name="backlog" value="10"/>
>>>>> -            <property name="maxSpareThreads" value="50"/>
>>>>> -            <property name="maxThreads" value="200"/>
>>>>> -            <property name="minSpareThreads" value="4"/>
>>>>> -            <property name="port" value="8010"/>
>>>>> -            <property name="tcpNoDelay" value="true"/>
>>>>> -            <property name="soTimeout" value="60000"/>
>>>>> -            <property name="tomcatAuthentication" value="true"/>
>>>>> +            <property name="enableLookups" value="true"/>
>>>>>          </property>
>>>>>          <property name="http-connector" value="connector">
>>>>> -            <!-- see
>>> http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for
>>> reference -->
>>>>> -            <property name="allowTrace" value="false"/>
>>>>> -            <property name="emptySessionPath" value="false"/>
>>>>> -            <property name="enableLookups" value="true"/>
>>>>> -            <property name="maxPostSize" value="2097152"/>
>>>>> +            <property name="port" value="8080"/>
>>>>>              <property name="protocol" value="HTTP/1.1"/>
>>>>> -            <property name="proxyName" value=""/>
>>>>> -            <property name="proxyPort" value=""/>
>>>>> -            <property name="redirectPort" value=""/>
>>>>>              <property name="scheme" value="http"/>
>>>>>              <property name="secure" value="false"/>
>>>>>              <property name="URIEncoding" value="UTF-8"/>
>>>>> -            <property name="useBodyEncodingForURI" value="false"/>
>>>>>              <property name="xpoweredBy" value="true"/>
>>>>> -            <!-- HTTP connector attributes -->
>>>>> -            <property name="acceptCount" value="10"/>
>>>>> -            <property name="address" value="0.0.0.0"/>
>>>>> -            <property name="bufferSize" value="2048"/>
>>>>> -            <property name="compressableMimeType"
>>> value="text/html,text/xml,text/plain"/>
>>>>> +            <property name="enableLookups" value="true"/>
>>>>>              <property name="compression" value="on"/>
>>>>> -            <property name="connectionLinger" value="-1"/>
>>>>> -            <property name="connectionTimeout" value="60000"/>
>>>>> -            <property name="disableUploadTimeout" value="false"/>
>>>>> -            <property name="maxHttpHeaderSize" value="8192"/>
>>>>> -            <property name="maxKeepAliveRequests" value="100"/>
>>>>> -            <property name="maxSpareThreads" value="50"/>
>>>>> -            <property name="maxThreads" value="100"/>
>>>>> -            <property name="minSpareThreads" value="4"/>
>>>>> -            <property name="noCompressionUserAgents" value=""/>
>>>>> -            <property name="port" value="8080"/>
>>>>> -            <property name="restrictedUserAgents" value=""/>
>>>>> -            <property name="server" value=""/>
>>>>> -            <property name="socketBuffer" value="9000"/>
>>>>> -            <property name="strategy" value="lf"/>
>>>>> -            <property name="tcpNoDelay" value="true"/>
>>>>> -            <property name="threadPriority"
>>> value="java.lang.Thread#NORM_PRIORITY"/>
>>>>> +            <property name="compressableMimeType"
>>> value="text/html,text/xml,text/plain,text/javascript,text/css"/>
>>>>>          </property>
>>>>>          <property name="https-connector" value="connector">
>>>>> -            <!-- see
>>> http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for
>>> reference -->
>>>>> -            <property name="allowTrace" value="false"/>
>>>>> -            <property name="emptySessionPath" value="false"/>
>>>>> -            <property name="enableLookups" value="true"/>
>>>>> -            <property name="maxPostSize" value="2097152"/>
>>>>> +            <property name="port" value="8443"/>
>>>>>              <property name="protocol" value="HTTP/1.1"/>
>>>>> -            <property name="proxyName" value=""/>
>>>>> -            <property name="proxyPort" value=""/>
>>>>> -            <property name="redirectPort" value=""/>
>>>>>              <property name="scheme" value="https"/>
>>>>>              <property name="secure" value="true"/>
>>>>> +            <property name="SSLEnabled" value="true"/>
>>>>>              <property name="URIEncoding" value="UTF-8"/>
>>>>> -            <property name="useBodyEncodingForURI" value="false"/>
>>>>>              <property name="xpoweredBy" value="true"/>
>>>>> -            <!-- HTTP connector attributes -->
>>>>> -            <property name="acceptCount" value="10"/>
>>>>> -            <property name="address" value="0.0.0.0"/>
>>>>> -            <property name="bufferSize" value="2048"/>
>>>>> -            <property name="compressableMimeType"
>>> value="text/html,text/xml,text/plain"/>
>>>>> +            <property name="enableLookups" value="true"/>
>>>>>              <property name="compression" value="on"/>
>>>>> -            <property name="connectionLinger" value="-1"/>
>>>>> -            <property name="connectionTimeout" value="60000"/>
>>>>> -            <property name="disableUploadTimeout" value="false"/>
>>>>> -            <property name="maxHttpHeaderSize" value="8192"/>
>>>>> -            <property name="maxKeepAliveRequests" value="100"/>
>>>>> -            <property name="maxSpareThreads" value="50"/>
>>>>> -            <property name="maxThreads" value="100"/>
>>>>> -            <property name="minSpareThreads" value="4"/>
>>>>> -            <property name="noCompressionUserAgents" value=""/>
>>>>> -            <property name="port" value="8443"/>
>>>>> -            <property name="restrictedUserAgents" value=""/>
>>>>> -            <property name="server" value=""/>
>>>>> -            <property name="socketBuffer" value="9000"/>
>>>>> -            <property name="strategy" value="lf"/>
>>>>> -            <property name="tcpNoDelay" value="true"/>
>>>>> -            <property name="threadPriority"
>>> value="java.lang.Thread#NORM_PRIORITY"/>
>>>>> -            <!-- SSL connector attributes -->
>>>>> -            <property name="sSLImplementation"
>>> value="org.ofbiz.catalina.container.SSLImpl"/>
>>>>> +            <property name="compressableMimeType"
>>> value="text/html,text/xml,text/plain,text/javascript,text/css"/>
>>>>> +            <property name="sslImplementationName"
>>> value="org.ofbiz.catalina.container.SSLImpl"/>
>>>>>              <property name="algorithm" value="SunX509"/>
>>>>> -            <property name="clientAuth" value="want"/>
>>>>>              <property name="keystoreFile"
>>> value="framework/base/config/ofbizssl.jks"/>
>>>>>              <property name="keystorePass" value="changeit"/>
>>>>>              <property name="keystoreType" value="JKS"/>
>>>>> 
>>>>> Modified:
>>> ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
>>>>> URL:
>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java?rev=1625919&r1=1625918&r2=1625919&view=diff
>>> ==============================================================================
>>>>> ---
>>> ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
>>> (original)
>>>>> +++
>>> ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
>>> Thu Sep 18 09:00:15 2014
>>>>> @@ -21,6 +21,7 @@ package org.ofbiz.catalina.container;
>>>>>  import java.io.File;
>>>>>  import java.net.MalformedURLException;
>>>>>  import java.net.URL;
>>>>> +import java.util.ArrayList;
>>>>>  import java.util.HashMap;
>>>>>  import java.util.Iterator;
>>>>>  import java.util.List;
>>>>> @@ -32,8 +33,6 @@ import java.util.concurrent.ScheduledExe
>>>>>  import javax.naming.InitialContext;
>>>>>  import javax.naming.NamingException;
>>>>>  -import javolution.util.FastList;
>>>>> -
>>>>>  import org.apache.catalina.Cluster;
>>>>>  import org.apache.catalina.Context;
>>>>>  import org.apache.catalina.Engine;
>>>>> @@ -63,8 +62,6 @@ import org.apache.catalina.tribes.transp
>>>>>  import org.apache.catalina.tribes.transport.nio.NioReceiver;
>>>>>  import org.apache.catalina.util.ServerInfo;
>>>>>  import org.apache.catalina.valves.AccessLogValve;
>>>>> -import org.apache.coyote.ProtocolHandler;
>>>>> -import org.apache.coyote.http11.Http11Protocol;
>>>>>  import org.apache.tomcat.JarScanner;
>>>>>  import org.apache.tomcat.util.IntrospectionUtils;
>>>>>  import org.apache.tomcat.util.scan.StandardJarScanner;
>>>>> @@ -236,25 +233,17 @@ public class CatalinaContainer implement
>>>>>          // load the web applications
>>>>>          loadComponents();
>>>>>  -        for (Connector con: tomcat.getService().findConnectors()) {
>>>>> -            ProtocolHandler ph = con.getProtocolHandler();
>>>>> -            int port = con.getPort();
>>>>> -            con.setAttribute("port", port);
>>>>> -            if (ph instanceof Http11Protocol) {
>>>>> -                Http11Protocol hph = (Http11Protocol) ph;
>>>>> -                Debug.logInfo("Connector " + hph.getName() + " @ " +
>>> hph.getPort() + " - " +
>>>>> -                    (hph.getSecure() ? "secure" : "not-secure") + " ["
>>> + con.getProtocolHandlerClassName() + "] started.", module);
>>>>> -            } else {
>>>>> -                Debug.logInfo("Connector " + con.getProtocol() + " @ "
>>> + con.getPort() + " - " +
>>>>> -                    (con.getSecure() ? "secure" : "not-secure") + " ["
>>> + con.getProtocolHandlerClassName() + "] started.", module);
>>>>> -            }
>>>>> -        }
>>>>>          // Start the Tomcat server
>>>>>          try {
>>>>>              tomcat.getServer().start();
>>>>>          } catch (LifecycleException e) {
>>>>>              throw new ContainerException(e);
>>>>>          }
>>>>> +
>>>>> +        for (Connector con: tomcat.getService().findConnectors()) {
>>>>> +            Debug.logInfo("Connector " + con.getProtocol() + " @ " +
>>> con.getPort() + " - " +
>>>>> +                (con.getSecure() ? "secure" : "not-secure") + " [" +
>>> con.getProtocolHandlerClassName() + "] started.", module);
>>>>> +        }
>>>>>          Debug.logInfo("Started " + ServerInfo.getServerInfo(), module);
>>>>>          return true;
>>>>>      }
>>>>> @@ -473,87 +462,28 @@ public class CatalinaContainer implement
>>>>>          if (tomcat == null) {
>>>>>              throw new ContainerException("Cannot create Connector
>>> without Tomcat instance!");
>>>>>          }
>>>>> -
>>>>> -        // need some standard properties
>>>>> -        String protocol =
>>> ContainerConfig.getPropertyValue(connectorProp, "protocol", "HTTP/1.1");
>>>>> -        String address =
>>> ContainerConfig.getPropertyValue(connectorProp, "address", "0.0.0.0");
>>>>> -        int port = ContainerConfig.getPropertyValue(connectorProp,
>>> "port", 0) + Start.getInstance().getConfig().portOffset;
>>>>> -
>>>>> -        boolean secure =
>>> ContainerConfig.getPropertyValue(connectorProp, "secure", false);
>>>>> -        if (protocol.toLowerCase().startsWith("ajp")) {
>>>>> -            protocol = "ajp";
>>>>> -        } else if ("memory".equals(protocol.toLowerCase())) {
>>>>> -            protocol = "memory";
>>>>> -        } else if (secure) {
>>>>> -            protocol = "https";
>>>>> -        } else {
>>>>> -            protocol = "http";
>>>>> -        }
>>>>> -
>>>>>          Connector connector = null;
>>>>>          if (UtilValidate.isNotEmpty(connectorProp.properties)) {
>>>>> -            if (address != null) {
>>>>> -                /*
>>>>> -                 * InetAddress.toString() returns a string of the form
>>>>> -                 * "<hostname>/<literal_IP>". Get the latter part, so
>>> that the
>>>>> -                 * address can be parsed (back) into an InetAddress
>>> using
>>>>> -                 * InetAddress.getByName().
>>>>> -                 */
>>>>> -                int index = address.indexOf('/');
>>>>> -                if (index != -1) {
>>>>> -                    address = address.substring(index + 1);
>>>>> -                }
>>>>> -            }
>>>>> +            String protocol =
>>> ContainerConfig.getPropertyValue(connectorProp, "protocol", "HTTP/1.1");
>>>>> +            int port = ContainerConfig.getPropertyValue(connectorProp,
>>> "port", 0) + Start.getInstance().getConfig().portOffset;
>>>>>  -            Debug.logInfo("Creating connector for address='" +
>>>>> -                          ((address == null) ? "ALL" : address) +
>>>>> -                          "' port='" + port + "' protocol='" +
>>> protocol + "'", module);
>>>>> -
>>>>> -            try {
>>>>> -
>>>>> -                if (protocol.equals("ajp")) {
>>>>> -                    connector = new
>>> Connector("org.apache.coyote.ajp.AjpProtocol");
>>>>> -                } else if (protocol.equals("memory")) {
>>>>> -                    connector = new
>>> Connector("org.apache.coyote.memory.MemoryProtocolHandler");
>>>>> -                } else if (protocol.equals("http")) {
>>>>> -                    connector = new Connector();
>>>>> -                } else if (protocol.equals("https")) {
>>>>> -                    connector = new Connector();
>>>>> -                    connector.setScheme("https");
>>>>> -                    connector.setSecure(true);
>>>>> -                    connector.setProperty("SSLEnabled","true");
>>>>> -                    // FIXME !!!! SET SSL PROPERTIES
>>>>> -                } else {
>>>>> -                    connector = new Connector(protocol);
>>>>> +            // set the protocol and the port first
>>>>> +            connector = new Connector(protocol);
>>>>> +            connector.setPort(port);
>>>>> +            // then set all the other parameters
>>>>> +            for (ContainerConfig.Container.Property prop:
>>> connectorProp.properties.values()) {
>>>>> +                if ("protocol".equals(prop.name) || "port".equals(
>>> prop.name)) {
>>>>> +                    // protocol and port are already set
>>>>> +                    continue;
>>>>>                  }
>>>>> -
>>>>> -                if (address != null) {
>>>>> -                    IntrospectionUtils.setProperty(connector,
>>> "address", "" + address);
>>>>> +                if (IntrospectionUtils.setProperty(connector,
>>> prop.name, prop.value)) {
>>>>> +                    Debug.logInfo("Tomcat " + connector + ": set " +
>>> prop.name + "=" + prop.value, module);
>>>>> +                } else {
>>>>> +                    Debug.logWarning("Tomcat " + connector + ":
>>> ignored parameter " + prop.name, module);
>>>>>                  }
>>>>> -                IntrospectionUtils.setProperty(connector, "port", "" +
>>> port);
>>>>> -
>>>>> -            } catch (Exception e) {
>>>>> -                Debug.logError(e, "Couldn't create connector.",
>>> module);
>>>>>              }
>>>>>  -            try {
>>>>> -                for (ContainerConfig.Container.Property prop:
>>> connectorProp.properties.values()) {
>>>>> -                    if ("port".equals(prop.name)) {
>>>>> -                        connector.setProperty(prop.name, "" + port);
>>>>> -                    } else {
>>>>> -                        connector.setProperty(prop.name, prop.value);
>>>>> -                        //connector.setAttribute(prop.name,
>>> prop.value);
>>>>> -                    }
>>>>> -                }
>>>>> -
>>>>> -                if
>>> (connectorProp.properties.containsKey("URIEncoding")) {
>>>>> -
>>> connector.setURIEncoding(connectorProp.properties.get("URIEncoding").value);
>>>>> -                }
>>>>> -
>>>>> -                tomcat.getService().addConnector(connector);
>>>>> -            } catch (Exception e) {
>>>>> -                throw new ContainerException(e);
>>>>> -            }
>>>>> +            tomcat.getService().addConnector(connector);
>>>>>          }
>>>>>          return connector;
>>>>>      }
>>>>> @@ -728,21 +658,21 @@ public class CatalinaContainer implement
>>>>>            // load the applications
>>>>>          List<ComponentConfig.WebappInfo> webResourceInfos =
>>> ComponentConfig.getAllWebappResourceInfos();
>>>>> -        List<String> loadedMounts = FastList.newInstance();
>>>>> +        List<String> loadedMounts = new ArrayList<String>();
>>>>>          if (webResourceInfos == null) {
>>>>>              return;
>>>>>          }
>>>>>            ScheduledExecutorService executor =
>>> ExecutionPool.getScheduledExecutor(CATALINA_THREAD_GROUP,
>>> "catalina-startup", -1, true);
>>>>>          try {
>>>>> -            List<Future<Context>> futures = FastList.newInstance();
>>>>> +            List<Future<Context>> futures = new
>>> ArrayList<Future<Context>>();
>>>>>                for (int i = webResourceInfos.size(); i > 0; i--) {
>>>>>                  ComponentConfig.WebappInfo appInfo =
>>> webResourceInfos.get(i - 1);
>>>>>                  String engineName = appInfo.server;
>>>>>                  List<String> virtualHosts = appInfo.getVirtualHosts();
>>>>>                  String mount = appInfo.getContextRoot();
>>>>> -                List<String> keys = FastList.newInstance();
>>>>> +                List<String> keys = new ArrayList<String>();
>>>>>                  if (virtualHosts.isEmpty()) {
>>>>>                      keys.add(engineName + ":DEFAULT:" + mount);
>>>>>                  } else {
>>>>> 
>>>>> 
>>>>> 
>>> 


Re: svn commit: r1625919 - in /ofbiz/trunk/framework/catalina: ofbiz-component.xml src/org/ofbiz/catalina/container/CatalinaContainer.java

Posted by Jacques Le Roux <ja...@les7arts.com>.
+1

Jacques

Le 24/09/2014 11:02, Pierre Smits a écrit :
> I agree. Most of the times users have a proxy in front of app servers.
> Setting this to 'true' would mean additional and unnecessary resource
> consumption.
>
> Pierre Smits
>
> *ORRTIZ.COM <http://www.orrtiz.com>*
> Services & Solutions for Cloud-
> Based Manufacturing, Professional
> Services and Retail & Trade
> http://www.orrtiz.com
>
> On Wed, Sep 24, 2014 at 10:42 AM, Jacopo Cappellato <
> jacopo.cappellato@hotwaxmedia.com> wrote:
>
>> Thanks for mentioning this.
>> My preference would be to use the default value as is in tomcat (i.e.
>> comment out this setting).
>> I didn't change its value but I have added the comment as a reminder to
>> discuss this with you all.
>>
>> Here is what Tomcat doc says:
>>
>> "enableLookups:
>> Set to true if you want calls to request.getRemoteHost() to perform DNS
>> lookups in order to return the actual host name of the remote client. Set
>> to false to skip the DNS lookup and return the IP address in String form
>> instead (thereby improving performance). By default, DNS lookups are
>> disabled."
>>
>> Do we agree to change it to use the default value of "false"?
>>
>> Jacopo
>>
>>
>> On Sep 24, 2014, at 10:35 AM, Jacques Le Roux <
>> jacques.le.roux@les7arts.com> wrote:
>>
>>> Hi Jacopo,
>>>
>>> I was confused by the enableLookups parameter default value (false)
>> which is now clearly defined in Tomcat 7.
>>> Confusion came from here:
>> http://www.baselogic.com/blog/development/java-javaee-j2ee/tomcat-6-connector-option-enablelookups-defaulting-true/
>>> Do you know why are we not using the default value (once again false)?
>>>
>>> Jacques
>>>
>>> Le 18/09/2014 11:00, jacopoc@apache.org a écrit :
>>>> Author: jacopoc
>>>> Date: Thu Sep 18 09:00:15 2014
>>>> New Revision: 1625919
>>>>
>>>> URL: http://svn.apache.org/r1625919
>>>> Log:
>>>> Simplified and improved the logic to setup the Tomcat connectors: the
>> logic was overly complex and messed up (probably after all the various
>> upgrades to new Tomcat versions), there were a series of parameters that
>> could not be set, some hardcoded values, some old and no more used (by
>> Tomcat) parameters.
>>>>   Improved the information logged about the actual parameters set for
>> the connectors.
>>>> Removed Javolution from CatalinaContainer.
>>>> Cleaned up the connector configuration file: removed no more used
>> parameters, commented out some parameters (that didn't change the default),
>> commented out some parameters in order to use the Tomcat default values
>> that may improve the performance (e.g. maxThreads in OFBiz was set to a
>> lower value than the default one of newer Tomcat releases and this limits
>> the throughput in default OFBiz setups), updated URLs to Tomcat
>> documentation.
>>>> Modified:
>>>>      ofbiz/trunk/framework/catalina/ofbiz-component.xml
>>>>
>>   ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
>>>> Modified: ofbiz/trunk/framework/catalina/ofbiz-component.xml
>>>> URL:
>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/catalina/ofbiz-component.xml?rev=1625919&r1=1625918&r2=1625919&view=diff
>> ==============================================================================
>>>> --- ofbiz/trunk/framework/catalina/ofbiz-component.xml (original)
>>>> +++ ofbiz/trunk/framework/catalina/ofbiz-component.xml Thu Sep 18
>> 09:00:15 2014
>>>> @@ -66,116 +66,83 @@ under the License.
>>>>               <!-- <property name="ssl-accelerator-port" value="8443"/>
>> -->
>>>>               <property name="enable-cross-subdomain-sessions"
>> value="false"/>
>>>>           </property>
>>>> -        <!-- all connectors support type, host, port, enable-lookups
>> -->
>>>>           <property name="ajp-connector" value="connector">
>>>> -            <!-- see
>> http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/ajp.html for
>> reference -->
>>>> -            <property name="allowTrace" value="false"/>
>>>> -            <property name="emptySessionPath" value="false"/>
>>>> -            <property name="enableLookups" value="true"/>
>>>> -            <property name="maxPostSize" value="2097152"/>
>>>> +            <!-- see
>> http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html for reference -->
>>>> +            <property name="port" value="8009"/>
>>>>               <property name="protocol" value="AJP/1.3"/>
>>>> -            <property name="proxyName" value=""/>
>>>> -            <property name="proxyPort" value=""/>
>>>> -            <property name="redirectPort" value=""/>
>>>>               <property name="scheme" value="http"/>
>>>>               <property name="secure" value="false"/>
>>>>               <property name="URIEncoding" value="UTF-8"/>
>>>> -            <property name="useBodyEncodingForURI" value="false"/>
>>>>               <property name="xpoweredBy" value="true"/>
>>>> +            <property name="enableLookups" value="true"/> <!-- set to
>> false to improve performance (false is the default value in Tomcat) -->
>>>>               <!-- AJP/13 connector attributes -->
>>>> -            <property name="address" value="0.0.0.0"/>
>>>> -            <property name="backlog" value="10"/>
>>>> -            <property name="maxSpareThreads" value="50"/>
>>>> +            <!-- commented out because the values match the Tomcat
>> defaults:
>>>> +            <property name="tomcatAuthentication" value="true"/>
>>>> +            <property name="allowTrace" value="false"/>
>>>> +            <property name="maxPostSize" value="2097152"/>
>>>> +            <property name="noCompressionUserAgents" value=""/>
>>>> +            <property name="connectionLinger" value="-1"/>
>>>> +            <property name="connectionTimeout" value="60000"/>
>>>> +            <property name="maxHttpHeaderSize" value="8192"/>
>>>> +            <property name="maxKeepAliveRequests" value="100"/>
>>>>               <property name="maxThreads" value="200"/>
>>>> -            <property name="minSpareThreads" value="4"/>
>>>> -            <property name="port" value="8009"/>
>>>> +            <property name="minSpareThreads" value="10"/>
>>>> +            <property name="acceptCount" value="100"/>
>>>> +            <property name="restrictedUserAgents" value=""/>
>>>> +            <property name="socketBuffer" value="9000"/>
>>>>               <property name="tcpNoDelay" value="true"/>
>>>> -            <property name="soTimeout" value="60000"/>
>>>> -            <property name="tomcatAuthentication" value="true"/>
>>>> +            <property name="threadPriority" value="5"/>
>>>> +            -->
>>>>           </property>
>>>>           <property name="http-connector" value="connector">
>>>> -            <!-- see
>> http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for
>> reference -->
>>>> -            <property name="allowTrace" value="false"/>
>>>> -            <property name="emptySessionPath" value="false"/>
>>>> -            <property name="enableLookups" value="true"/>
>>>> -            <property name="maxPostSize" value="2097152"/>
>>>> +            <!-- see
>> http://tomcat.apache.org/tomcat-7.0-doc/config/http.html for reference -->
>>>> +            <property name="port" value="8080"/>
>>>>               <property name="protocol" value="HTTP/1.1"/>
>>>> -            <property name="proxyName" value=""/>
>>>> -            <property name="proxyPort" value=""/>
>>>> -            <property name="redirectPort" value=""/>
>>>>               <property name="scheme" value="http"/>
>>>>               <property name="secure" value="false"/>
>>>>               <property name="URIEncoding" value="UTF-8"/>
>>>> -            <property name="useBodyEncodingForURI" value="false"/>
>>>>               <property name="xpoweredBy" value="true"/>
>>>> -            <!-- HTTP connector attributes -->
>>>> -            <property name="acceptCount" value="10"/>
>>>> -            <property name="address" value="0.0.0.0"/>
>>>> -            <property name="bufferSize" value="2048"/>
>>>> +            <property name="enableLookups" value="true"/> <!-- set to
>> false to improve performance (false is the default value in Tomcat) -->
>>>>               <property name="compression" value="on"/>
>>>>               <property name="compressableMimeType"
>> value="text/html,text/xml,text/plain,text/javascript,text/css"/>
>>>> +            <!-- commented out because the values match the Tomcat
>> defaults:
>>>> +            <property name="allowTrace" value="false"/>
>>>> +            <property name="maxPostSize" value="2097152"/>
>>>>               <property name="noCompressionUserAgents" value=""/>
>>>>               <property name="connectionLinger" value="-1"/>
>>>>               <property name="connectionTimeout" value="60000"/>
>>>> -            <property name="disableUploadTimeout" value="false"/>
>>>>               <property name="maxHttpHeaderSize" value="8192"/>
>>>>               <property name="maxKeepAliveRequests" value="100"/>
>>>> -            <property name="maxSpareThreads" value="50"/>
>>>> -            <property name="maxThreads" value="100"/>
>>>> -            <property name="minSpareThreads" value="4"/>
>>>> -            <property name="port" value="8080"/>
>>>> +            <property name="maxThreads" value="200"/>
>>>> +            <property name="minSpareThreads" value="10"/>
>>>> +            <property name="acceptCount" value="100"/>
>>>>               <property name="restrictedUserAgents" value=""/>
>>>> -            <property name="server" value=""/>
>>>>               <property name="socketBuffer" value="9000"/>
>>>> -            <property name="strategy" value="lf"/>
>>>>               <property name="tcpNoDelay" value="true"/>
>>>> -            <property name="threadPriority"
>> value="java.lang.Thread#NORM_PRIORITY"/>
>>>> +            <property name="threadPriority" value="5"/>
>>>> +            -->
>>>>           </property>
>>>>           <property name="https-connector" value="connector">
>>>> -            <!-- see
>> http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for
>> reference -->
>>>> -            <property name="allowTrace" value="false"/>
>>>> -            <property name="emptySessionPath" value="false"/>
>>>> -            <property name="enableLookups" value="true"/>
>>>> -            <property name="maxPostSize" value="2097152"/>
>>>> +            <!-- see
>> http://tomcat.apache.org/tomcat-7.0-doc/config/http.html for reference -->
>>>> +            <property name="port" value="8443"/>
>>>>               <property name="protocol" value="HTTP/1.1"/>
>>>> -            <property name="proxyName" value=""/>
>>>> -            <property name="proxyPort" value=""/>
>>>> -            <property name="redirectPort" value=""/>
>>>>               <property name="scheme" value="https"/>
>>>>               <property name="secure" value="true"/>
>>>> +            <property name="SSLEnabled" value="true"/>
>>>>               <property name="URIEncoding" value="UTF-8"/>
>>>> -            <property name="useBodyEncodingForURI" value="false"/>
>>>>               <property name="xpoweredBy" value="true"/>
>>>> -            <!-- HTTP connector attributes -->
>>>> -            <property name="acceptCount" value="10"/>
>>>> -            <property name="address" value="0.0.0.0"/>
>>>> -            <property name="bufferSize" value="2048"/>
>>>> +            <property name="enableLookups" value="true"/> <!-- set to
>> false to improve performance (false is the default value in Tomcat) -->
>>>>               <property name="compression" value="on"/>
>>>>               <property name="compressableMimeType"
>> value="text/html,text/xml,text/plain,text/javascript,text/css"/>
>>>> -            <property name="noCompressionUserAgents" value=""/>
>>>> -            <property name="connectionLinger" value="-1"/>
>>>> -            <property name="connectionTimeout" value="60000"/>
>>>> -            <property name="disableUploadTimeout" value="false"/>
>>>> -            <property name="maxHttpHeaderSize" value="8192"/>
>>>> -            <property name="maxKeepAliveRequests" value="100"/>
>>>> -            <property name="maxSpareThreads" value="50"/>
>>>> -            <property name="maxThreads" value="100"/>
>>>> -            <property name="minSpareThreads" value="4"/>
>>>> -            <property name="port" value="8443"/>
>>>> -            <property name="restrictedUserAgents" value=""/>
>>>> -            <property name="server" value=""/>
>>>> -            <property name="socketBuffer" value="9000"/>
>>>> -            <property name="strategy" value="lf"/>
>>>> -            <property name="tcpNoDelay" value="true"/>
>>>> -            <property name="threadPriority"
>> value="java.lang.Thread#NORM_PRIORITY"/>
>>>>               <!-- SSL connector attributes -->
>>>> -            <property name="sSLImplementation"
>> value="org.ofbiz.catalina.container.SSLImpl"/>
>>>> +            <property name="sslImplementationName"
>> value="org.ofbiz.catalina.container.SSLImpl"/>
>>>>               <property name="algorithm" value="SunX509"/>
>>>>               <!-- the clientAuth to "want" in order to receive certs
>> from the client;
>>>>                   note that this isn't set this way by default because
>> with certain browsers
>>>>                   (like Safari) it breaks access via HTTPS, so until
>> that problem is fixed
>>>> -                the default will be false -->
>>>> +                the default will be false
>>>>               <property name="clientAuth" value="false"/>
>>>> +            -->
>>>>               <property name="keystoreFile"
>> value="framework/base/config/ofbizssl.jks"/>
>>>>               <property name="keystorePass" value="changeit"/>
>>>>               <property name="keystoreType" value="JKS"/>
>>>> @@ -202,133 +169,40 @@ under the License.
>>>>               <property name="access-log-prefix" value="access_log."/>
>>>>               <property name="access-log-dir" value="runtime/logs"/>
>>>>               <property name="enable-request-dump" value="false"/>
>>>> -            <!-- uncomment for cluster support
>>>> -            <property name="default-server-cluster" value="cluster">
>>>> -                <property name="rep-valve-filter">
>>>> -
>> <property-value>.*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;.*\.png;.*\.css;.*\.ico;.*\.htc;</property-value>
>>>> -                </property>
>>>> -                <property name="manager-class"
>> value="org.apache.catalina.cluster.session.DeltaManager"/>
>>>> -                <property name="debug" value="5"/>
>>>> -                <property name="replication-mode"
>> value="org.apache.catalina.tribes.transport.bio.PooledMultiSender"/>
>>>> -                <property name="tcp-listen-host" value="auto"/>
>>>> -                <property name="tcp-listen-port" value="4001"/>
>>>> -                <property name="tcp-sector-timeout" value="100"/>
>>>> -                <property name="tcp-thread-count" value="6"/>
>>>> -                <property name="mcast-bind-addr" value="192.168.2.1"/>
>>>> -                <property name="mcast-addr" value="224.0.0.1"/>
>>>> -                <property name="mcast-port" value="45564"/>
>>>> -                <property name="mcast-freq" value="500"/>
>>>> -                <property name="mcast-drop-time" value="3000"/>
>>>> -            </property>
>>>> -            -->
>>>> -            <!-- <property name="ssl-accelerator-port" value="8443"/>
>> -->
>>>>           </property>
>>>> -        <!-- all connectors support type, host, port, enable-lookups
>> -->
>>>>           <property name="ajp-connector" value="connector">
>>>> -            <!-- see
>> http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/ajp.html for
>> reference -->
>>>> -            <property name="allowTrace" value="false"/>
>>>> -            <property name="emptySessionPath" value="false"/>
>>>> -            <property name="enableLookups" value="true"/>
>>>> -            <property name="maxPostSize" value="2097152"/>
>>>> +            <property name="port" value="8010"/>
>>>>               <property name="protocol" value="AJP/1.3"/>
>>>> -            <property name="proxyName" value=""/>
>>>> -            <property name="proxyPort" value=""/>
>>>> -            <property name="redirectPort" value=""/>
>>>>               <property name="scheme" value="http"/>
>>>>               <property name="secure" value="false"/>
>>>>               <property name="URIEncoding" value="UTF-8"/>
>>>> -            <property name="useBodyEncodingForURI" value="false"/>
>>>>               <property name="xpoweredBy" value="true"/>
>>>> -            <!-- AJP/13 connector attributes -->
>>>> -            <property name="address" value="0.0.0.0"/>
>>>> -            <property name="backlog" value="10"/>
>>>> -            <property name="maxSpareThreads" value="50"/>
>>>> -            <property name="maxThreads" value="200"/>
>>>> -            <property name="minSpareThreads" value="4"/>
>>>> -            <property name="port" value="8010"/>
>>>> -            <property name="tcpNoDelay" value="true"/>
>>>> -            <property name="soTimeout" value="60000"/>
>>>> -            <property name="tomcatAuthentication" value="true"/>
>>>> +            <property name="enableLookups" value="true"/>
>>>>           </property>
>>>>           <property name="http-connector" value="connector">
>>>> -            <!-- see
>> http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for
>> reference -->
>>>> -            <property name="allowTrace" value="false"/>
>>>> -            <property name="emptySessionPath" value="false"/>
>>>> -            <property name="enableLookups" value="true"/>
>>>> -            <property name="maxPostSize" value="2097152"/>
>>>> +            <property name="port" value="8080"/>
>>>>               <property name="protocol" value="HTTP/1.1"/>
>>>> -            <property name="proxyName" value=""/>
>>>> -            <property name="proxyPort" value=""/>
>>>> -            <property name="redirectPort" value=""/>
>>>>               <property name="scheme" value="http"/>
>>>>               <property name="secure" value="false"/>
>>>>               <property name="URIEncoding" value="UTF-8"/>
>>>> -            <property name="useBodyEncodingForURI" value="false"/>
>>>>               <property name="xpoweredBy" value="true"/>
>>>> -            <!-- HTTP connector attributes -->
>>>> -            <property name="acceptCount" value="10"/>
>>>> -            <property name="address" value="0.0.0.0"/>
>>>> -            <property name="bufferSize" value="2048"/>
>>>> -            <property name="compressableMimeType"
>> value="text/html,text/xml,text/plain"/>
>>>> +            <property name="enableLookups" value="true"/>
>>>>               <property name="compression" value="on"/>
>>>> -            <property name="connectionLinger" value="-1"/>
>>>> -            <property name="connectionTimeout" value="60000"/>
>>>> -            <property name="disableUploadTimeout" value="false"/>
>>>> -            <property name="maxHttpHeaderSize" value="8192"/>
>>>> -            <property name="maxKeepAliveRequests" value="100"/>
>>>> -            <property name="maxSpareThreads" value="50"/>
>>>> -            <property name="maxThreads" value="100"/>
>>>> -            <property name="minSpareThreads" value="4"/>
>>>> -            <property name="noCompressionUserAgents" value=""/>
>>>> -            <property name="port" value="8080"/>
>>>> -            <property name="restrictedUserAgents" value=""/>
>>>> -            <property name="server" value=""/>
>>>> -            <property name="socketBuffer" value="9000"/>
>>>> -            <property name="strategy" value="lf"/>
>>>> -            <property name="tcpNoDelay" value="true"/>
>>>> -            <property name="threadPriority"
>> value="java.lang.Thread#NORM_PRIORITY"/>
>>>> +            <property name="compressableMimeType"
>> value="text/html,text/xml,text/plain,text/javascript,text/css"/>
>>>>           </property>
>>>>           <property name="https-connector" value="connector">
>>>> -            <!-- see
>> http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for
>> reference -->
>>>> -            <property name="allowTrace" value="false"/>
>>>> -            <property name="emptySessionPath" value="false"/>
>>>> -            <property name="enableLookups" value="true"/>
>>>> -            <property name="maxPostSize" value="2097152"/>
>>>> +            <property name="port" value="8443"/>
>>>>               <property name="protocol" value="HTTP/1.1"/>
>>>> -            <property name="proxyName" value=""/>
>>>> -            <property name="proxyPort" value=""/>
>>>> -            <property name="redirectPort" value=""/>
>>>>               <property name="scheme" value="https"/>
>>>>               <property name="secure" value="true"/>
>>>> +            <property name="SSLEnabled" value="true"/>
>>>>               <property name="URIEncoding" value="UTF-8"/>
>>>> -            <property name="useBodyEncodingForURI" value="false"/>
>>>>               <property name="xpoweredBy" value="true"/>
>>>> -            <!-- HTTP connector attributes -->
>>>> -            <property name="acceptCount" value="10"/>
>>>> -            <property name="address" value="0.0.0.0"/>
>>>> -            <property name="bufferSize" value="2048"/>
>>>> -            <property name="compressableMimeType"
>> value="text/html,text/xml,text/plain"/>
>>>> +            <property name="enableLookups" value="true"/>
>>>>               <property name="compression" value="on"/>
>>>> -            <property name="connectionLinger" value="-1"/>
>>>> -            <property name="connectionTimeout" value="60000"/>
>>>> -            <property name="disableUploadTimeout" value="false"/>
>>>> -            <property name="maxHttpHeaderSize" value="8192"/>
>>>> -            <property name="maxKeepAliveRequests" value="100"/>
>>>> -            <property name="maxSpareThreads" value="50"/>
>>>> -            <property name="maxThreads" value="100"/>
>>>> -            <property name="minSpareThreads" value="4"/>
>>>> -            <property name="noCompressionUserAgents" value=""/>
>>>> -            <property name="port" value="8443"/>
>>>> -            <property name="restrictedUserAgents" value=""/>
>>>> -            <property name="server" value=""/>
>>>> -            <property name="socketBuffer" value="9000"/>
>>>> -            <property name="strategy" value="lf"/>
>>>> -            <property name="tcpNoDelay" value="true"/>
>>>> -            <property name="threadPriority"
>> value="java.lang.Thread#NORM_PRIORITY"/>
>>>> -            <!-- SSL connector attributes -->
>>>> -            <property name="sSLImplementation"
>> value="org.ofbiz.catalina.container.SSLImpl"/>
>>>> +            <property name="compressableMimeType"
>> value="text/html,text/xml,text/plain,text/javascript,text/css"/>
>>>> +            <property name="sslImplementationName"
>> value="org.ofbiz.catalina.container.SSLImpl"/>
>>>>               <property name="algorithm" value="SunX509"/>
>>>> -            <property name="clientAuth" value="want"/>
>>>>               <property name="keystoreFile"
>> value="framework/base/config/ofbizssl.jks"/>
>>>>               <property name="keystorePass" value="changeit"/>
>>>>               <property name="keystoreType" value="JKS"/>
>>>>
>>>> Modified:
>> ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
>>>> URL:
>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java?rev=1625919&r1=1625918&r2=1625919&view=diff
>> ==============================================================================
>>>> ---
>> ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
>> (original)
>>>> +++
>> ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
>> Thu Sep 18 09:00:15 2014
>>>> @@ -21,6 +21,7 @@ package org.ofbiz.catalina.container;
>>>>   import java.io.File;
>>>>   import java.net.MalformedURLException;
>>>>   import java.net.URL;
>>>> +import java.util.ArrayList;
>>>>   import java.util.HashMap;
>>>>   import java.util.Iterator;
>>>>   import java.util.List;
>>>> @@ -32,8 +33,6 @@ import java.util.concurrent.ScheduledExe
>>>>   import javax.naming.InitialContext;
>>>>   import javax.naming.NamingException;
>>>>   -import javolution.util.FastList;
>>>> -
>>>>   import org.apache.catalina.Cluster;
>>>>   import org.apache.catalina.Context;
>>>>   import org.apache.catalina.Engine;
>>>> @@ -63,8 +62,6 @@ import org.apache.catalina.tribes.transp
>>>>   import org.apache.catalina.tribes.transport.nio.NioReceiver;
>>>>   import org.apache.catalina.util.ServerInfo;
>>>>   import org.apache.catalina.valves.AccessLogValve;
>>>> -import org.apache.coyote.ProtocolHandler;
>>>> -import org.apache.coyote.http11.Http11Protocol;
>>>>   import org.apache.tomcat.JarScanner;
>>>>   import org.apache.tomcat.util.IntrospectionUtils;
>>>>   import org.apache.tomcat.util.scan.StandardJarScanner;
>>>> @@ -236,25 +233,17 @@ public class CatalinaContainer implement
>>>>           // load the web applications
>>>>           loadComponents();
>>>>   -        for (Connector con: tomcat.getService().findConnectors()) {
>>>> -            ProtocolHandler ph = con.getProtocolHandler();
>>>> -            int port = con.getPort();
>>>> -            con.setAttribute("port", port);
>>>> -            if (ph instanceof Http11Protocol) {
>>>> -                Http11Protocol hph = (Http11Protocol) ph;
>>>> -                Debug.logInfo("Connector " + hph.getName() + " @ " +
>> hph.getPort() + " - " +
>>>> -                    (hph.getSecure() ? "secure" : "not-secure") + " ["
>> + con.getProtocolHandlerClassName() + "] started.", module);
>>>> -            } else {
>>>> -                Debug.logInfo("Connector " + con.getProtocol() + " @ "
>> + con.getPort() + " - " +
>>>> -                    (con.getSecure() ? "secure" : "not-secure") + " ["
>> + con.getProtocolHandlerClassName() + "] started.", module);
>>>> -            }
>>>> -        }
>>>>           // Start the Tomcat server
>>>>           try {
>>>>               tomcat.getServer().start();
>>>>           } catch (LifecycleException e) {
>>>>               throw new ContainerException(e);
>>>>           }
>>>> +
>>>> +        for (Connector con: tomcat.getService().findConnectors()) {
>>>> +            Debug.logInfo("Connector " + con.getProtocol() + " @ " +
>> con.getPort() + " - " +
>>>> +                (con.getSecure() ? "secure" : "not-secure") + " [" +
>> con.getProtocolHandlerClassName() + "] started.", module);
>>>> +        }
>>>>           Debug.logInfo("Started " + ServerInfo.getServerInfo(), module);
>>>>           return true;
>>>>       }
>>>> @@ -473,87 +462,28 @@ public class CatalinaContainer implement
>>>>           if (tomcat == null) {
>>>>               throw new ContainerException("Cannot create Connector
>> without Tomcat instance!");
>>>>           }
>>>> -
>>>> -        // need some standard properties
>>>> -        String protocol =
>> ContainerConfig.getPropertyValue(connectorProp, "protocol", "HTTP/1.1");
>>>> -        String address =
>> ContainerConfig.getPropertyValue(connectorProp, "address", "0.0.0.0");
>>>> -        int port = ContainerConfig.getPropertyValue(connectorProp,
>> "port", 0) + Start.getInstance().getConfig().portOffset;
>>>> -
>>>> -        boolean secure =
>> ContainerConfig.getPropertyValue(connectorProp, "secure", false);
>>>> -        if (protocol.toLowerCase().startsWith("ajp")) {
>>>> -            protocol = "ajp";
>>>> -        } else if ("memory".equals(protocol.toLowerCase())) {
>>>> -            protocol = "memory";
>>>> -        } else if (secure) {
>>>> -            protocol = "https";
>>>> -        } else {
>>>> -            protocol = "http";
>>>> -        }
>>>> -
>>>>           Connector connector = null;
>>>>           if (UtilValidate.isNotEmpty(connectorProp.properties)) {
>>>> -            if (address != null) {
>>>> -                /*
>>>> -                 * InetAddress.toString() returns a string of the form
>>>> -                 * "<hostname>/<literal_IP>". Get the latter part, so
>> that the
>>>> -                 * address can be parsed (back) into an InetAddress
>> using
>>>> -                 * InetAddress.getByName().
>>>> -                 */
>>>> -                int index = address.indexOf('/');
>>>> -                if (index != -1) {
>>>> -                    address = address.substring(index + 1);
>>>> -                }
>>>> -            }
>>>> +            String protocol =
>> ContainerConfig.getPropertyValue(connectorProp, "protocol", "HTTP/1.1");
>>>> +            int port = ContainerConfig.getPropertyValue(connectorProp,
>> "port", 0) + Start.getInstance().getConfig().portOffset;
>>>>   -            Debug.logInfo("Creating connector for address='" +
>>>> -                          ((address == null) ? "ALL" : address) +
>>>> -                          "' port='" + port + "' protocol='" +
>> protocol + "'", module);
>>>> -
>>>> -            try {
>>>> -
>>>> -                if (protocol.equals("ajp")) {
>>>> -                    connector = new
>> Connector("org.apache.coyote.ajp.AjpProtocol");
>>>> -                } else if (protocol.equals("memory")) {
>>>> -                    connector = new
>> Connector("org.apache.coyote.memory.MemoryProtocolHandler");
>>>> -                } else if (protocol.equals("http")) {
>>>> -                    connector = new Connector();
>>>> -                } else if (protocol.equals("https")) {
>>>> -                    connector = new Connector();
>>>> -                    connector.setScheme("https");
>>>> -                    connector.setSecure(true);
>>>> -                    connector.setProperty("SSLEnabled","true");
>>>> -                    // FIXME !!!! SET SSL PROPERTIES
>>>> -                } else {
>>>> -                    connector = new Connector(protocol);
>>>> +            // set the protocol and the port first
>>>> +            connector = new Connector(protocol);
>>>> +            connector.setPort(port);
>>>> +            // then set all the other parameters
>>>> +            for (ContainerConfig.Container.Property prop:
>> connectorProp.properties.values()) {
>>>> +                if ("protocol".equals(prop.name) || "port".equals(
>> prop.name)) {
>>>> +                    // protocol and port are already set
>>>> +                    continue;
>>>>                   }
>>>> -
>>>> -                if (address != null) {
>>>> -                    IntrospectionUtils.setProperty(connector,
>> "address", "" + address);
>>>> +                if (IntrospectionUtils.setProperty(connector,
>> prop.name, prop.value)) {
>>>> +                    Debug.logInfo("Tomcat " + connector + ": set " +
>> prop.name + "=" + prop.value, module);
>>>> +                } else {
>>>> +                    Debug.logWarning("Tomcat " + connector + ":
>> ignored parameter " + prop.name, module);
>>>>                   }
>>>> -                IntrospectionUtils.setProperty(connector, "port", "" +
>> port);
>>>> -
>>>> -            } catch (Exception e) {
>>>> -                Debug.logError(e, "Couldn't create connector.",
>> module);
>>>>               }
>>>>   -            try {
>>>> -                for (ContainerConfig.Container.Property prop:
>> connectorProp.properties.values()) {
>>>> -                    if ("port".equals(prop.name)) {
>>>> -                        connector.setProperty(prop.name, "" + port);
>>>> -                    } else {
>>>> -                        connector.setProperty(prop.name, prop.value);
>>>> -                        //connector.setAttribute(prop.name,
>> prop.value);
>>>> -                    }
>>>> -                }
>>>> -
>>>> -                if
>> (connectorProp.properties.containsKey("URIEncoding")) {
>>>> -
>> connector.setURIEncoding(connectorProp.properties.get("URIEncoding").value);
>>>> -                }
>>>> -
>>>> -                tomcat.getService().addConnector(connector);
>>>> -            } catch (Exception e) {
>>>> -                throw new ContainerException(e);
>>>> -            }
>>>> +            tomcat.getService().addConnector(connector);
>>>>           }
>>>>           return connector;
>>>>       }
>>>> @@ -728,21 +658,21 @@ public class CatalinaContainer implement
>>>>             // load the applications
>>>>           List<ComponentConfig.WebappInfo> webResourceInfos =
>> ComponentConfig.getAllWebappResourceInfos();
>>>> -        List<String> loadedMounts = FastList.newInstance();
>>>> +        List<String> loadedMounts = new ArrayList<String>();
>>>>           if (webResourceInfos == null) {
>>>>               return;
>>>>           }
>>>>             ScheduledExecutorService executor =
>> ExecutionPool.getScheduledExecutor(CATALINA_THREAD_GROUP,
>> "catalina-startup", -1, true);
>>>>           try {
>>>> -            List<Future<Context>> futures = FastList.newInstance();
>>>> +            List<Future<Context>> futures = new
>> ArrayList<Future<Context>>();
>>>>                 for (int i = webResourceInfos.size(); i > 0; i--) {
>>>>                   ComponentConfig.WebappInfo appInfo =
>> webResourceInfos.get(i - 1);
>>>>                   String engineName = appInfo.server;
>>>>                   List<String> virtualHosts = appInfo.getVirtualHosts();
>>>>                   String mount = appInfo.getContextRoot();
>>>> -                List<String> keys = FastList.newInstance();
>>>> +                List<String> keys = new ArrayList<String>();
>>>>                   if (virtualHosts.isEmpty()) {
>>>>                       keys.add(engineName + ":DEFAULT:" + mount);
>>>>                   } else {
>>>>
>>>>
>>>>
>>

Re: svn commit: r1625919 - in /ofbiz/trunk/framework/catalina: ofbiz-component.xml src/org/ofbiz/catalina/container/CatalinaContainer.java

Posted by Pierre Smits <pi...@gmail.com>.
I agree. Most of the times users have a proxy in front of app servers.
Setting this to 'true' would mean additional and unnecessary resource
consumption.

Pierre Smits

*ORRTIZ.COM <http://www.orrtiz.com>*
Services & Solutions for Cloud-
Based Manufacturing, Professional
Services and Retail & Trade
http://www.orrtiz.com

On Wed, Sep 24, 2014 at 10:42 AM, Jacopo Cappellato <
jacopo.cappellato@hotwaxmedia.com> wrote:

> Thanks for mentioning this.
> My preference would be to use the default value as is in tomcat (i.e.
> comment out this setting).
> I didn't change its value but I have added the comment as a reminder to
> discuss this with you all.
>
> Here is what Tomcat doc says:
>
> "enableLookups:
> Set to true if you want calls to request.getRemoteHost() to perform DNS
> lookups in order to return the actual host name of the remote client. Set
> to false to skip the DNS lookup and return the IP address in String form
> instead (thereby improving performance). By default, DNS lookups are
> disabled."
>
> Do we agree to change it to use the default value of "false"?
>
> Jacopo
>
>
> On Sep 24, 2014, at 10:35 AM, Jacques Le Roux <
> jacques.le.roux@les7arts.com> wrote:
>
> > Hi Jacopo,
> >
> > I was confused by the enableLookups parameter default value (false)
> which is now clearly defined in Tomcat 7.
> > Confusion came from here:
> http://www.baselogic.com/blog/development/java-javaee-j2ee/tomcat-6-connector-option-enablelookups-defaulting-true/
> > Do you know why are we not using the default value (once again false)?
> >
> > Jacques
> >
> > Le 18/09/2014 11:00, jacopoc@apache.org a écrit :
> >> Author: jacopoc
> >> Date: Thu Sep 18 09:00:15 2014
> >> New Revision: 1625919
> >>
> >> URL: http://svn.apache.org/r1625919
> >> Log:
> >> Simplified and improved the logic to setup the Tomcat connectors: the
> logic was overly complex and messed up (probably after all the various
> upgrades to new Tomcat versions), there were a series of parameters that
> could not be set, some hardcoded values, some old and no more used (by
> Tomcat) parameters.
> >>  Improved the information logged about the actual parameters set for
> the connectors.
> >> Removed Javolution from CatalinaContainer.
> >> Cleaned up the connector configuration file: removed no more used
> parameters, commented out some parameters (that didn't change the default),
> commented out some parameters in order to use the Tomcat default values
> that may improve the performance (e.g. maxThreads in OFBiz was set to a
> lower value than the default one of newer Tomcat releases and this limits
> the throughput in default OFBiz setups), updated URLs to Tomcat
> documentation.
> >>
> >> Modified:
> >>     ofbiz/trunk/framework/catalina/ofbiz-component.xml
> >>
>  ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
> >>
> >> Modified: ofbiz/trunk/framework/catalina/ofbiz-component.xml
> >> URL:
> http://svn.apache.org/viewvc/ofbiz/trunk/framework/catalina/ofbiz-component.xml?rev=1625919&r1=1625918&r2=1625919&view=diff
> >>
> ==============================================================================
> >> --- ofbiz/trunk/framework/catalina/ofbiz-component.xml (original)
> >> +++ ofbiz/trunk/framework/catalina/ofbiz-component.xml Thu Sep 18
> 09:00:15 2014
> >> @@ -66,116 +66,83 @@ under the License.
> >>              <!-- <property name="ssl-accelerator-port" value="8443"/>
> -->
> >>              <property name="enable-cross-subdomain-sessions"
> value="false"/>
> >>          </property>
> >> -        <!-- all connectors support type, host, port, enable-lookups
> -->
> >>          <property name="ajp-connector" value="connector">
> >> -            <!-- see
> http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/ajp.html for
> reference -->
> >> -            <property name="allowTrace" value="false"/>
> >> -            <property name="emptySessionPath" value="false"/>
> >> -            <property name="enableLookups" value="true"/>
> >> -            <property name="maxPostSize" value="2097152"/>
> >> +            <!-- see
> http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html for reference -->
> >> +            <property name="port" value="8009"/>
> >>              <property name="protocol" value="AJP/1.3"/>
> >> -            <property name="proxyName" value=""/>
> >> -            <property name="proxyPort" value=""/>
> >> -            <property name="redirectPort" value=""/>
> >>              <property name="scheme" value="http"/>
> >>              <property name="secure" value="false"/>
> >>              <property name="URIEncoding" value="UTF-8"/>
> >> -            <property name="useBodyEncodingForURI" value="false"/>
> >>              <property name="xpoweredBy" value="true"/>
> >> +            <property name="enableLookups" value="true"/> <!-- set to
> false to improve performance (false is the default value in Tomcat) -->
> >>              <!-- AJP/13 connector attributes -->
> >> -            <property name="address" value="0.0.0.0"/>
> >> -            <property name="backlog" value="10"/>
> >> -            <property name="maxSpareThreads" value="50"/>
> >> +            <!-- commented out because the values match the Tomcat
> defaults:
> >> +            <property name="tomcatAuthentication" value="true"/>
> >> +            <property name="allowTrace" value="false"/>
> >> +            <property name="maxPostSize" value="2097152"/>
> >> +            <property name="noCompressionUserAgents" value=""/>
> >> +            <property name="connectionLinger" value="-1"/>
> >> +            <property name="connectionTimeout" value="60000"/>
> >> +            <property name="maxHttpHeaderSize" value="8192"/>
> >> +            <property name="maxKeepAliveRequests" value="100"/>
> >>              <property name="maxThreads" value="200"/>
> >> -            <property name="minSpareThreads" value="4"/>
> >> -            <property name="port" value="8009"/>
> >> +            <property name="minSpareThreads" value="10"/>
> >> +            <property name="acceptCount" value="100"/>
> >> +            <property name="restrictedUserAgents" value=""/>
> >> +            <property name="socketBuffer" value="9000"/>
> >>              <property name="tcpNoDelay" value="true"/>
> >> -            <property name="soTimeout" value="60000"/>
> >> -            <property name="tomcatAuthentication" value="true"/>
> >> +            <property name="threadPriority" value="5"/>
> >> +            -->
> >>          </property>
> >>          <property name="http-connector" value="connector">
> >> -            <!-- see
> http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for
> reference -->
> >> -            <property name="allowTrace" value="false"/>
> >> -            <property name="emptySessionPath" value="false"/>
> >> -            <property name="enableLookups" value="true"/>
> >> -            <property name="maxPostSize" value="2097152"/>
> >> +            <!-- see
> http://tomcat.apache.org/tomcat-7.0-doc/config/http.html for reference -->
> >> +            <property name="port" value="8080"/>
> >>              <property name="protocol" value="HTTP/1.1"/>
> >> -            <property name="proxyName" value=""/>
> >> -            <property name="proxyPort" value=""/>
> >> -            <property name="redirectPort" value=""/>
> >>              <property name="scheme" value="http"/>
> >>              <property name="secure" value="false"/>
> >>              <property name="URIEncoding" value="UTF-8"/>
> >> -            <property name="useBodyEncodingForURI" value="false"/>
> >>              <property name="xpoweredBy" value="true"/>
> >> -            <!-- HTTP connector attributes -->
> >> -            <property name="acceptCount" value="10"/>
> >> -            <property name="address" value="0.0.0.0"/>
> >> -            <property name="bufferSize" value="2048"/>
> >> +            <property name="enableLookups" value="true"/> <!-- set to
> false to improve performance (false is the default value in Tomcat) -->
> >>              <property name="compression" value="on"/>
> >>              <property name="compressableMimeType"
> value="text/html,text/xml,text/plain,text/javascript,text/css"/>
> >> +            <!-- commented out because the values match the Tomcat
> defaults:
> >> +            <property name="allowTrace" value="false"/>
> >> +            <property name="maxPostSize" value="2097152"/>
> >>              <property name="noCompressionUserAgents" value=""/>
> >>              <property name="connectionLinger" value="-1"/>
> >>              <property name="connectionTimeout" value="60000"/>
> >> -            <property name="disableUploadTimeout" value="false"/>
> >>              <property name="maxHttpHeaderSize" value="8192"/>
> >>              <property name="maxKeepAliveRequests" value="100"/>
> >> -            <property name="maxSpareThreads" value="50"/>
> >> -            <property name="maxThreads" value="100"/>
> >> -            <property name="minSpareThreads" value="4"/>
> >> -            <property name="port" value="8080"/>
> >> +            <property name="maxThreads" value="200"/>
> >> +            <property name="minSpareThreads" value="10"/>
> >> +            <property name="acceptCount" value="100"/>
> >>              <property name="restrictedUserAgents" value=""/>
> >> -            <property name="server" value=""/>
> >>              <property name="socketBuffer" value="9000"/>
> >> -            <property name="strategy" value="lf"/>
> >>              <property name="tcpNoDelay" value="true"/>
> >> -            <property name="threadPriority"
> value="java.lang.Thread#NORM_PRIORITY"/>
> >> +            <property name="threadPriority" value="5"/>
> >> +            -->
> >>          </property>
> >>          <property name="https-connector" value="connector">
> >> -            <!-- see
> http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for
> reference -->
> >> -            <property name="allowTrace" value="false"/>
> >> -            <property name="emptySessionPath" value="false"/>
> >> -            <property name="enableLookups" value="true"/>
> >> -            <property name="maxPostSize" value="2097152"/>
> >> +            <!-- see
> http://tomcat.apache.org/tomcat-7.0-doc/config/http.html for reference -->
> >> +            <property name="port" value="8443"/>
> >>              <property name="protocol" value="HTTP/1.1"/>
> >> -            <property name="proxyName" value=""/>
> >> -            <property name="proxyPort" value=""/>
> >> -            <property name="redirectPort" value=""/>
> >>              <property name="scheme" value="https"/>
> >>              <property name="secure" value="true"/>
> >> +            <property name="SSLEnabled" value="true"/>
> >>              <property name="URIEncoding" value="UTF-8"/>
> >> -            <property name="useBodyEncodingForURI" value="false"/>
> >>              <property name="xpoweredBy" value="true"/>
> >> -            <!-- HTTP connector attributes -->
> >> -            <property name="acceptCount" value="10"/>
> >> -            <property name="address" value="0.0.0.0"/>
> >> -            <property name="bufferSize" value="2048"/>
> >> +            <property name="enableLookups" value="true"/> <!-- set to
> false to improve performance (false is the default value in Tomcat) -->
> >>              <property name="compression" value="on"/>
> >>              <property name="compressableMimeType"
> value="text/html,text/xml,text/plain,text/javascript,text/css"/>
> >> -            <property name="noCompressionUserAgents" value=""/>
> >> -            <property name="connectionLinger" value="-1"/>
> >> -            <property name="connectionTimeout" value="60000"/>
> >> -            <property name="disableUploadTimeout" value="false"/>
> >> -            <property name="maxHttpHeaderSize" value="8192"/>
> >> -            <property name="maxKeepAliveRequests" value="100"/>
> >> -            <property name="maxSpareThreads" value="50"/>
> >> -            <property name="maxThreads" value="100"/>
> >> -            <property name="minSpareThreads" value="4"/>
> >> -            <property name="port" value="8443"/>
> >> -            <property name="restrictedUserAgents" value=""/>
> >> -            <property name="server" value=""/>
> >> -            <property name="socketBuffer" value="9000"/>
> >> -            <property name="strategy" value="lf"/>
> >> -            <property name="tcpNoDelay" value="true"/>
> >> -            <property name="threadPriority"
> value="java.lang.Thread#NORM_PRIORITY"/>
> >>              <!-- SSL connector attributes -->
> >> -            <property name="sSLImplementation"
> value="org.ofbiz.catalina.container.SSLImpl"/>
> >> +            <property name="sslImplementationName"
> value="org.ofbiz.catalina.container.SSLImpl"/>
> >>              <property name="algorithm" value="SunX509"/>
> >>              <!-- the clientAuth to "want" in order to receive certs
> from the client;
> >>                  note that this isn't set this way by default because
> with certain browsers
> >>                  (like Safari) it breaks access via HTTPS, so until
> that problem is fixed
> >> -                the default will be false -->
> >> +                the default will be false
> >>              <property name="clientAuth" value="false"/>
> >> +            -->
> >>              <property name="keystoreFile"
> value="framework/base/config/ofbizssl.jks"/>
> >>              <property name="keystorePass" value="changeit"/>
> >>              <property name="keystoreType" value="JKS"/>
> >> @@ -202,133 +169,40 @@ under the License.
> >>              <property name="access-log-prefix" value="access_log."/>
> >>              <property name="access-log-dir" value="runtime/logs"/>
> >>              <property name="enable-request-dump" value="false"/>
> >> -            <!-- uncomment for cluster support
> >> -            <property name="default-server-cluster" value="cluster">
> >> -                <property name="rep-valve-filter">
> >> -
> <property-value>.*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;.*\.png;.*\.css;.*\.ico;.*\.htc;</property-value>
> >> -                </property>
> >> -                <property name="manager-class"
> value="org.apache.catalina.cluster.session.DeltaManager"/>
> >> -                <property name="debug" value="5"/>
> >> -                <property name="replication-mode"
> value="org.apache.catalina.tribes.transport.bio.PooledMultiSender"/>
> >> -                <property name="tcp-listen-host" value="auto"/>
> >> -                <property name="tcp-listen-port" value="4001"/>
> >> -                <property name="tcp-sector-timeout" value="100"/>
> >> -                <property name="tcp-thread-count" value="6"/>
> >> -                <property name="mcast-bind-addr" value="192.168.2.1"/>
> >> -                <property name="mcast-addr" value="224.0.0.1"/>
> >> -                <property name="mcast-port" value="45564"/>
> >> -                <property name="mcast-freq" value="500"/>
> >> -                <property name="mcast-drop-time" value="3000"/>
> >> -            </property>
> >> -            -->
> >> -            <!-- <property name="ssl-accelerator-port" value="8443"/>
> -->
> >>          </property>
> >> -        <!-- all connectors support type, host, port, enable-lookups
> -->
> >>          <property name="ajp-connector" value="connector">
> >> -            <!-- see
> http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/ajp.html for
> reference -->
> >> -            <property name="allowTrace" value="false"/>
> >> -            <property name="emptySessionPath" value="false"/>
> >> -            <property name="enableLookups" value="true"/>
> >> -            <property name="maxPostSize" value="2097152"/>
> >> +            <property name="port" value="8010"/>
> >>              <property name="protocol" value="AJP/1.3"/>
> >> -            <property name="proxyName" value=""/>
> >> -            <property name="proxyPort" value=""/>
> >> -            <property name="redirectPort" value=""/>
> >>              <property name="scheme" value="http"/>
> >>              <property name="secure" value="false"/>
> >>              <property name="URIEncoding" value="UTF-8"/>
> >> -            <property name="useBodyEncodingForURI" value="false"/>
> >>              <property name="xpoweredBy" value="true"/>
> >> -            <!-- AJP/13 connector attributes -->
> >> -            <property name="address" value="0.0.0.0"/>
> >> -            <property name="backlog" value="10"/>
> >> -            <property name="maxSpareThreads" value="50"/>
> >> -            <property name="maxThreads" value="200"/>
> >> -            <property name="minSpareThreads" value="4"/>
> >> -            <property name="port" value="8010"/>
> >> -            <property name="tcpNoDelay" value="true"/>
> >> -            <property name="soTimeout" value="60000"/>
> >> -            <property name="tomcatAuthentication" value="true"/>
> >> +            <property name="enableLookups" value="true"/>
> >>          </property>
> >>          <property name="http-connector" value="connector">
> >> -            <!-- see
> http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for
> reference -->
> >> -            <property name="allowTrace" value="false"/>
> >> -            <property name="emptySessionPath" value="false"/>
> >> -            <property name="enableLookups" value="true"/>
> >> -            <property name="maxPostSize" value="2097152"/>
> >> +            <property name="port" value="8080"/>
> >>              <property name="protocol" value="HTTP/1.1"/>
> >> -            <property name="proxyName" value=""/>
> >> -            <property name="proxyPort" value=""/>
> >> -            <property name="redirectPort" value=""/>
> >>              <property name="scheme" value="http"/>
> >>              <property name="secure" value="false"/>
> >>              <property name="URIEncoding" value="UTF-8"/>
> >> -            <property name="useBodyEncodingForURI" value="false"/>
> >>              <property name="xpoweredBy" value="true"/>
> >> -            <!-- HTTP connector attributes -->
> >> -            <property name="acceptCount" value="10"/>
> >> -            <property name="address" value="0.0.0.0"/>
> >> -            <property name="bufferSize" value="2048"/>
> >> -            <property name="compressableMimeType"
> value="text/html,text/xml,text/plain"/>
> >> +            <property name="enableLookups" value="true"/>
> >>              <property name="compression" value="on"/>
> >> -            <property name="connectionLinger" value="-1"/>
> >> -            <property name="connectionTimeout" value="60000"/>
> >> -            <property name="disableUploadTimeout" value="false"/>
> >> -            <property name="maxHttpHeaderSize" value="8192"/>
> >> -            <property name="maxKeepAliveRequests" value="100"/>
> >> -            <property name="maxSpareThreads" value="50"/>
> >> -            <property name="maxThreads" value="100"/>
> >> -            <property name="minSpareThreads" value="4"/>
> >> -            <property name="noCompressionUserAgents" value=""/>
> >> -            <property name="port" value="8080"/>
> >> -            <property name="restrictedUserAgents" value=""/>
> >> -            <property name="server" value=""/>
> >> -            <property name="socketBuffer" value="9000"/>
> >> -            <property name="strategy" value="lf"/>
> >> -            <property name="tcpNoDelay" value="true"/>
> >> -            <property name="threadPriority"
> value="java.lang.Thread#NORM_PRIORITY"/>
> >> +            <property name="compressableMimeType"
> value="text/html,text/xml,text/plain,text/javascript,text/css"/>
> >>          </property>
> >>          <property name="https-connector" value="connector">
> >> -            <!-- see
> http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for
> reference -->
> >> -            <property name="allowTrace" value="false"/>
> >> -            <property name="emptySessionPath" value="false"/>
> >> -            <property name="enableLookups" value="true"/>
> >> -            <property name="maxPostSize" value="2097152"/>
> >> +            <property name="port" value="8443"/>
> >>              <property name="protocol" value="HTTP/1.1"/>
> >> -            <property name="proxyName" value=""/>
> >> -            <property name="proxyPort" value=""/>
> >> -            <property name="redirectPort" value=""/>
> >>              <property name="scheme" value="https"/>
> >>              <property name="secure" value="true"/>
> >> +            <property name="SSLEnabled" value="true"/>
> >>              <property name="URIEncoding" value="UTF-8"/>
> >> -            <property name="useBodyEncodingForURI" value="false"/>
> >>              <property name="xpoweredBy" value="true"/>
> >> -            <!-- HTTP connector attributes -->
> >> -            <property name="acceptCount" value="10"/>
> >> -            <property name="address" value="0.0.0.0"/>
> >> -            <property name="bufferSize" value="2048"/>
> >> -            <property name="compressableMimeType"
> value="text/html,text/xml,text/plain"/>
> >> +            <property name="enableLookups" value="true"/>
> >>              <property name="compression" value="on"/>
> >> -            <property name="connectionLinger" value="-1"/>
> >> -            <property name="connectionTimeout" value="60000"/>
> >> -            <property name="disableUploadTimeout" value="false"/>
> >> -            <property name="maxHttpHeaderSize" value="8192"/>
> >> -            <property name="maxKeepAliveRequests" value="100"/>
> >> -            <property name="maxSpareThreads" value="50"/>
> >> -            <property name="maxThreads" value="100"/>
> >> -            <property name="minSpareThreads" value="4"/>
> >> -            <property name="noCompressionUserAgents" value=""/>
> >> -            <property name="port" value="8443"/>
> >> -            <property name="restrictedUserAgents" value=""/>
> >> -            <property name="server" value=""/>
> >> -            <property name="socketBuffer" value="9000"/>
> >> -            <property name="strategy" value="lf"/>
> >> -            <property name="tcpNoDelay" value="true"/>
> >> -            <property name="threadPriority"
> value="java.lang.Thread#NORM_PRIORITY"/>
> >> -            <!-- SSL connector attributes -->
> >> -            <property name="sSLImplementation"
> value="org.ofbiz.catalina.container.SSLImpl"/>
> >> +            <property name="compressableMimeType"
> value="text/html,text/xml,text/plain,text/javascript,text/css"/>
> >> +            <property name="sslImplementationName"
> value="org.ofbiz.catalina.container.SSLImpl"/>
> >>              <property name="algorithm" value="SunX509"/>
> >> -            <property name="clientAuth" value="want"/>
> >>              <property name="keystoreFile"
> value="framework/base/config/ofbizssl.jks"/>
> >>              <property name="keystorePass" value="changeit"/>
> >>              <property name="keystoreType" value="JKS"/>
> >>
> >> Modified:
> ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
> >> URL:
> http://svn.apache.org/viewvc/ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java?rev=1625919&r1=1625918&r2=1625919&view=diff
> >>
> ==============================================================================
> >> ---
> ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
> (original)
> >> +++
> ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
> Thu Sep 18 09:00:15 2014
> >> @@ -21,6 +21,7 @@ package org.ofbiz.catalina.container;
> >>  import java.io.File;
> >>  import java.net.MalformedURLException;
> >>  import java.net.URL;
> >> +import java.util.ArrayList;
> >>  import java.util.HashMap;
> >>  import java.util.Iterator;
> >>  import java.util.List;
> >> @@ -32,8 +33,6 @@ import java.util.concurrent.ScheduledExe
> >>  import javax.naming.InitialContext;
> >>  import javax.naming.NamingException;
> >>  -import javolution.util.FastList;
> >> -
> >>  import org.apache.catalina.Cluster;
> >>  import org.apache.catalina.Context;
> >>  import org.apache.catalina.Engine;
> >> @@ -63,8 +62,6 @@ import org.apache.catalina.tribes.transp
> >>  import org.apache.catalina.tribes.transport.nio.NioReceiver;
> >>  import org.apache.catalina.util.ServerInfo;
> >>  import org.apache.catalina.valves.AccessLogValve;
> >> -import org.apache.coyote.ProtocolHandler;
> >> -import org.apache.coyote.http11.Http11Protocol;
> >>  import org.apache.tomcat.JarScanner;
> >>  import org.apache.tomcat.util.IntrospectionUtils;
> >>  import org.apache.tomcat.util.scan.StandardJarScanner;
> >> @@ -236,25 +233,17 @@ public class CatalinaContainer implement
> >>          // load the web applications
> >>          loadComponents();
> >>  -        for (Connector con: tomcat.getService().findConnectors()) {
> >> -            ProtocolHandler ph = con.getProtocolHandler();
> >> -            int port = con.getPort();
> >> -            con.setAttribute("port", port);
> >> -            if (ph instanceof Http11Protocol) {
> >> -                Http11Protocol hph = (Http11Protocol) ph;
> >> -                Debug.logInfo("Connector " + hph.getName() + " @ " +
> hph.getPort() + " - " +
> >> -                    (hph.getSecure() ? "secure" : "not-secure") + " ["
> + con.getProtocolHandlerClassName() + "] started.", module);
> >> -            } else {
> >> -                Debug.logInfo("Connector " + con.getProtocol() + " @ "
> + con.getPort() + " - " +
> >> -                    (con.getSecure() ? "secure" : "not-secure") + " ["
> + con.getProtocolHandlerClassName() + "] started.", module);
> >> -            }
> >> -        }
> >>          // Start the Tomcat server
> >>          try {
> >>              tomcat.getServer().start();
> >>          } catch (LifecycleException e) {
> >>              throw new ContainerException(e);
> >>          }
> >> +
> >> +        for (Connector con: tomcat.getService().findConnectors()) {
> >> +            Debug.logInfo("Connector " + con.getProtocol() + " @ " +
> con.getPort() + " - " +
> >> +                (con.getSecure() ? "secure" : "not-secure") + " [" +
> con.getProtocolHandlerClassName() + "] started.", module);
> >> +        }
> >>          Debug.logInfo("Started " + ServerInfo.getServerInfo(), module);
> >>          return true;
> >>      }
> >> @@ -473,87 +462,28 @@ public class CatalinaContainer implement
> >>          if (tomcat == null) {
> >>              throw new ContainerException("Cannot create Connector
> without Tomcat instance!");
> >>          }
> >> -
> >> -        // need some standard properties
> >> -        String protocol =
> ContainerConfig.getPropertyValue(connectorProp, "protocol", "HTTP/1.1");
> >> -        String address =
> ContainerConfig.getPropertyValue(connectorProp, "address", "0.0.0.0");
> >> -        int port = ContainerConfig.getPropertyValue(connectorProp,
> "port", 0) + Start.getInstance().getConfig().portOffset;
> >> -
> >> -        boolean secure =
> ContainerConfig.getPropertyValue(connectorProp, "secure", false);
> >> -        if (protocol.toLowerCase().startsWith("ajp")) {
> >> -            protocol = "ajp";
> >> -        } else if ("memory".equals(protocol.toLowerCase())) {
> >> -            protocol = "memory";
> >> -        } else if (secure) {
> >> -            protocol = "https";
> >> -        } else {
> >> -            protocol = "http";
> >> -        }
> >> -
> >>          Connector connector = null;
> >>          if (UtilValidate.isNotEmpty(connectorProp.properties)) {
> >> -            if (address != null) {
> >> -                /*
> >> -                 * InetAddress.toString() returns a string of the form
> >> -                 * "<hostname>/<literal_IP>". Get the latter part, so
> that the
> >> -                 * address can be parsed (back) into an InetAddress
> using
> >> -                 * InetAddress.getByName().
> >> -                 */
> >> -                int index = address.indexOf('/');
> >> -                if (index != -1) {
> >> -                    address = address.substring(index + 1);
> >> -                }
> >> -            }
> >> +            String protocol =
> ContainerConfig.getPropertyValue(connectorProp, "protocol", "HTTP/1.1");
> >> +            int port = ContainerConfig.getPropertyValue(connectorProp,
> "port", 0) + Start.getInstance().getConfig().portOffset;
> >>  -            Debug.logInfo("Creating connector for address='" +
> >> -                          ((address == null) ? "ALL" : address) +
> >> -                          "' port='" + port + "' protocol='" +
> protocol + "'", module);
> >> -
> >> -            try {
> >> -
> >> -                if (protocol.equals("ajp")) {
> >> -                    connector = new
> Connector("org.apache.coyote.ajp.AjpProtocol");
> >> -                } else if (protocol.equals("memory")) {
> >> -                    connector = new
> Connector("org.apache.coyote.memory.MemoryProtocolHandler");
> >> -                } else if (protocol.equals("http")) {
> >> -                    connector = new Connector();
> >> -                } else if (protocol.equals("https")) {
> >> -                    connector = new Connector();
> >> -                    connector.setScheme("https");
> >> -                    connector.setSecure(true);
> >> -                    connector.setProperty("SSLEnabled","true");
> >> -                    // FIXME !!!! SET SSL PROPERTIES
> >> -                } else {
> >> -                    connector = new Connector(protocol);
> >> +            // set the protocol and the port first
> >> +            connector = new Connector(protocol);
> >> +            connector.setPort(port);
> >> +            // then set all the other parameters
> >> +            for (ContainerConfig.Container.Property prop:
> connectorProp.properties.values()) {
> >> +                if ("protocol".equals(prop.name) || "port".equals(
> prop.name)) {
> >> +                    // protocol and port are already set
> >> +                    continue;
> >>                  }
> >> -
> >> -                if (address != null) {
> >> -                    IntrospectionUtils.setProperty(connector,
> "address", "" + address);
> >> +                if (IntrospectionUtils.setProperty(connector,
> prop.name, prop.value)) {
> >> +                    Debug.logInfo("Tomcat " + connector + ": set " +
> prop.name + "=" + prop.value, module);
> >> +                } else {
> >> +                    Debug.logWarning("Tomcat " + connector + ":
> ignored parameter " + prop.name, module);
> >>                  }
> >> -                IntrospectionUtils.setProperty(connector, "port", "" +
> port);
> >> -
> >> -            } catch (Exception e) {
> >> -                Debug.logError(e, "Couldn't create connector.",
> module);
> >>              }
> >>  -            try {
> >> -                for (ContainerConfig.Container.Property prop:
> connectorProp.properties.values()) {
> >> -                    if ("port".equals(prop.name)) {
> >> -                        connector.setProperty(prop.name, "" + port);
> >> -                    } else {
> >> -                        connector.setProperty(prop.name, prop.value);
> >> -                        //connector.setAttribute(prop.name,
> prop.value);
> >> -                    }
> >> -                }
> >> -
> >> -                if
> (connectorProp.properties.containsKey("URIEncoding")) {
> >> -
> connector.setURIEncoding(connectorProp.properties.get("URIEncoding").value);
> >> -                }
> >> -
> >> -                tomcat.getService().addConnector(connector);
> >> -            } catch (Exception e) {
> >> -                throw new ContainerException(e);
> >> -            }
> >> +            tomcat.getService().addConnector(connector);
> >>          }
> >>          return connector;
> >>      }
> >> @@ -728,21 +658,21 @@ public class CatalinaContainer implement
> >>            // load the applications
> >>          List<ComponentConfig.WebappInfo> webResourceInfos =
> ComponentConfig.getAllWebappResourceInfos();
> >> -        List<String> loadedMounts = FastList.newInstance();
> >> +        List<String> loadedMounts = new ArrayList<String>();
> >>          if (webResourceInfos == null) {
> >>              return;
> >>          }
> >>            ScheduledExecutorService executor =
> ExecutionPool.getScheduledExecutor(CATALINA_THREAD_GROUP,
> "catalina-startup", -1, true);
> >>          try {
> >> -            List<Future<Context>> futures = FastList.newInstance();
> >> +            List<Future<Context>> futures = new
> ArrayList<Future<Context>>();
> >>                for (int i = webResourceInfos.size(); i > 0; i--) {
> >>                  ComponentConfig.WebappInfo appInfo =
> webResourceInfos.get(i - 1);
> >>                  String engineName = appInfo.server;
> >>                  List<String> virtualHosts = appInfo.getVirtualHosts();
> >>                  String mount = appInfo.getContextRoot();
> >> -                List<String> keys = FastList.newInstance();
> >> +                List<String> keys = new ArrayList<String>();
> >>                  if (virtualHosts.isEmpty()) {
> >>                      keys.add(engineName + ":DEFAULT:" + mount);
> >>                  } else {
> >>
> >>
> >>
>
>

Re: svn commit: r1625919 - in /ofbiz/trunk/framework/catalina: ofbiz-component.xml src/org/ofbiz/catalina/container/CatalinaContainer.java

Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
Thanks for mentioning this.
My preference would be to use the default value as is in tomcat (i.e. comment out this setting).
I didn't change its value but I have added the comment as a reminder to discuss this with you all.

Here is what Tomcat doc says:

"enableLookups:
Set to true if you want calls to request.getRemoteHost() to perform DNS lookups in order to return the actual host name of the remote client. Set to false to skip the DNS lookup and return the IP address in String form instead (thereby improving performance). By default, DNS lookups are disabled."

Do we agree to change it to use the default value of "false"?

Jacopo


On Sep 24, 2014, at 10:35 AM, Jacques Le Roux <ja...@les7arts.com> wrote:

> Hi Jacopo,
> 
> I was confused by the enableLookups parameter default value (false) which is now clearly defined in Tomcat 7.
> Confusion came from here: http://www.baselogic.com/blog/development/java-javaee-j2ee/tomcat-6-connector-option-enablelookups-defaulting-true/
> Do you know why are we not using the default value (once again false)?
> 
> Jacques
> 
> Le 18/09/2014 11:00, jacopoc@apache.org a écrit :
>> Author: jacopoc
>> Date: Thu Sep 18 09:00:15 2014
>> New Revision: 1625919
>> 
>> URL: http://svn.apache.org/r1625919
>> Log:
>> Simplified and improved the logic to setup the Tomcat connectors: the logic was overly complex and messed up (probably after all the various upgrades to new Tomcat versions), there were a series of parameters that could not be set, some hardcoded values, some old and no more used (by Tomcat) parameters.
>>  Improved the information logged about the actual parameters set for the connectors.
>> Removed Javolution from CatalinaContainer.
>> Cleaned up the connector configuration file: removed no more used parameters, commented out some parameters (that didn't change the default), commented out some parameters in order to use the Tomcat default values that may improve the performance (e.g. maxThreads in OFBiz was set to a lower value than the default one of newer Tomcat releases and this limits the throughput in default OFBiz setups), updated URLs to Tomcat documentation.
>> 
>> Modified:
>>     ofbiz/trunk/framework/catalina/ofbiz-component.xml
>>     ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
>> 
>> Modified: ofbiz/trunk/framework/catalina/ofbiz-component.xml
>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/catalina/ofbiz-component.xml?rev=1625919&r1=1625918&r2=1625919&view=diff
>> ==============================================================================
>> --- ofbiz/trunk/framework/catalina/ofbiz-component.xml (original)
>> +++ ofbiz/trunk/framework/catalina/ofbiz-component.xml Thu Sep 18 09:00:15 2014
>> @@ -66,116 +66,83 @@ under the License.
>>              <!-- <property name="ssl-accelerator-port" value="8443"/> -->
>>              <property name="enable-cross-subdomain-sessions" value="false"/>
>>          </property>
>> -        <!-- all connectors support type, host, port, enable-lookups -->
>>          <property name="ajp-connector" value="connector">
>> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/ajp.html for reference -->
>> -            <property name="allowTrace" value="false"/>
>> -            <property name="emptySessionPath" value="false"/>
>> -            <property name="enableLookups" value="true"/>
>> -            <property name="maxPostSize" value="2097152"/>
>> +            <!-- see http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html for reference -->
>> +            <property name="port" value="8009"/>
>>              <property name="protocol" value="AJP/1.3"/>
>> -            <property name="proxyName" value=""/>
>> -            <property name="proxyPort" value=""/>
>> -            <property name="redirectPort" value=""/>
>>              <property name="scheme" value="http"/>
>>              <property name="secure" value="false"/>
>>              <property name="URIEncoding" value="UTF-8"/>
>> -            <property name="useBodyEncodingForURI" value="false"/>
>>              <property name="xpoweredBy" value="true"/>
>> +            <property name="enableLookups" value="true"/> <!-- set to false to improve performance (false is the default value in Tomcat) -->
>>              <!-- AJP/13 connector attributes -->
>> -            <property name="address" value="0.0.0.0"/>
>> -            <property name="backlog" value="10"/>
>> -            <property name="maxSpareThreads" value="50"/>
>> +            <!-- commented out because the values match the Tomcat defaults:
>> +            <property name="tomcatAuthentication" value="true"/>
>> +            <property name="allowTrace" value="false"/>
>> +            <property name="maxPostSize" value="2097152"/>
>> +            <property name="noCompressionUserAgents" value=""/>
>> +            <property name="connectionLinger" value="-1"/>
>> +            <property name="connectionTimeout" value="60000"/>
>> +            <property name="maxHttpHeaderSize" value="8192"/>
>> +            <property name="maxKeepAliveRequests" value="100"/>
>>              <property name="maxThreads" value="200"/>
>> -            <property name="minSpareThreads" value="4"/>
>> -            <property name="port" value="8009"/>
>> +            <property name="minSpareThreads" value="10"/>
>> +            <property name="acceptCount" value="100"/>
>> +            <property name="restrictedUserAgents" value=""/>
>> +            <property name="socketBuffer" value="9000"/>
>>              <property name="tcpNoDelay" value="true"/>
>> -            <property name="soTimeout" value="60000"/>
>> -            <property name="tomcatAuthentication" value="true"/>
>> +            <property name="threadPriority" value="5"/>
>> +            -->
>>          </property>
>>          <property name="http-connector" value="connector">
>> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference -->
>> -            <property name="allowTrace" value="false"/>
>> -            <property name="emptySessionPath" value="false"/>
>> -            <property name="enableLookups" value="true"/>
>> -            <property name="maxPostSize" value="2097152"/>
>> +            <!-- see http://tomcat.apache.org/tomcat-7.0-doc/config/http.html for reference -->
>> +            <property name="port" value="8080"/>
>>              <property name="protocol" value="HTTP/1.1"/>
>> -            <property name="proxyName" value=""/>
>> -            <property name="proxyPort" value=""/>
>> -            <property name="redirectPort" value=""/>
>>              <property name="scheme" value="http"/>
>>              <property name="secure" value="false"/>
>>              <property name="URIEncoding" value="UTF-8"/>
>> -            <property name="useBodyEncodingForURI" value="false"/>
>>              <property name="xpoweredBy" value="true"/>
>> -            <!-- HTTP connector attributes -->
>> -            <property name="acceptCount" value="10"/>
>> -            <property name="address" value="0.0.0.0"/>
>> -            <property name="bufferSize" value="2048"/>
>> +            <property name="enableLookups" value="true"/> <!-- set to false to improve performance (false is the default value in Tomcat) -->
>>              <property name="compression" value="on"/>
>>              <property name="compressableMimeType" value="text/html,text/xml,text/plain,text/javascript,text/css"/>
>> +            <!-- commented out because the values match the Tomcat defaults:
>> +            <property name="allowTrace" value="false"/>
>> +            <property name="maxPostSize" value="2097152"/>
>>              <property name="noCompressionUserAgents" value=""/>
>>              <property name="connectionLinger" value="-1"/>
>>              <property name="connectionTimeout" value="60000"/>
>> -            <property name="disableUploadTimeout" value="false"/>
>>              <property name="maxHttpHeaderSize" value="8192"/>
>>              <property name="maxKeepAliveRequests" value="100"/>
>> -            <property name="maxSpareThreads" value="50"/>
>> -            <property name="maxThreads" value="100"/>
>> -            <property name="minSpareThreads" value="4"/>
>> -            <property name="port" value="8080"/>
>> +            <property name="maxThreads" value="200"/>
>> +            <property name="minSpareThreads" value="10"/>
>> +            <property name="acceptCount" value="100"/>
>>              <property name="restrictedUserAgents" value=""/>
>> -            <property name="server" value=""/>
>>              <property name="socketBuffer" value="9000"/>
>> -            <property name="strategy" value="lf"/>
>>              <property name="tcpNoDelay" value="true"/>
>> -            <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/>
>> +            <property name="threadPriority" value="5"/>
>> +            -->
>>          </property>
>>          <property name="https-connector" value="connector">
>> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference -->
>> -            <property name="allowTrace" value="false"/>
>> -            <property name="emptySessionPath" value="false"/>
>> -            <property name="enableLookups" value="true"/>
>> -            <property name="maxPostSize" value="2097152"/>
>> +            <!-- see http://tomcat.apache.org/tomcat-7.0-doc/config/http.html for reference -->
>> +            <property name="port" value="8443"/>
>>              <property name="protocol" value="HTTP/1.1"/>
>> -            <property name="proxyName" value=""/>
>> -            <property name="proxyPort" value=""/>
>> -            <property name="redirectPort" value=""/>
>>              <property name="scheme" value="https"/>
>>              <property name="secure" value="true"/>
>> +            <property name="SSLEnabled" value="true"/>
>>              <property name="URIEncoding" value="UTF-8"/>
>> -            <property name="useBodyEncodingForURI" value="false"/>
>>              <property name="xpoweredBy" value="true"/>
>> -            <!-- HTTP connector attributes -->
>> -            <property name="acceptCount" value="10"/>
>> -            <property name="address" value="0.0.0.0"/>
>> -            <property name="bufferSize" value="2048"/>
>> +            <property name="enableLookups" value="true"/> <!-- set to false to improve performance (false is the default value in Tomcat) -->
>>              <property name="compression" value="on"/>
>>              <property name="compressableMimeType" value="text/html,text/xml,text/plain,text/javascript,text/css"/>
>> -            <property name="noCompressionUserAgents" value=""/>
>> -            <property name="connectionLinger" value="-1"/>
>> -            <property name="connectionTimeout" value="60000"/>
>> -            <property name="disableUploadTimeout" value="false"/>
>> -            <property name="maxHttpHeaderSize" value="8192"/>
>> -            <property name="maxKeepAliveRequests" value="100"/>
>> -            <property name="maxSpareThreads" value="50"/>
>> -            <property name="maxThreads" value="100"/>
>> -            <property name="minSpareThreads" value="4"/>
>> -            <property name="port" value="8443"/>
>> -            <property name="restrictedUserAgents" value=""/>
>> -            <property name="server" value=""/>
>> -            <property name="socketBuffer" value="9000"/>
>> -            <property name="strategy" value="lf"/>
>> -            <property name="tcpNoDelay" value="true"/>
>> -            <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/>
>>              <!-- SSL connector attributes -->
>> -            <property name="sSLImplementation" value="org.ofbiz.catalina.container.SSLImpl"/>
>> +            <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
>>              <property name="algorithm" value="SunX509"/>
>>              <!-- the clientAuth to "want" in order to receive certs from the client;
>>                  note that this isn't set this way by default because with certain browsers
>>                  (like Safari) it breaks access via HTTPS, so until that problem is fixed
>> -                the default will be false -->
>> +                the default will be false
>>              <property name="clientAuth" value="false"/>
>> +            -->
>>              <property name="keystoreFile" value="framework/base/config/ofbizssl.jks"/>
>>              <property name="keystorePass" value="changeit"/>
>>              <property name="keystoreType" value="JKS"/>
>> @@ -202,133 +169,40 @@ under the License.
>>              <property name="access-log-prefix" value="access_log."/>
>>              <property name="access-log-dir" value="runtime/logs"/>
>>              <property name="enable-request-dump" value="false"/>
>> -            <!-- uncomment for cluster support
>> -            <property name="default-server-cluster" value="cluster">
>> -                <property name="rep-valve-filter">
>> -                <property-value>.*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;.*\.png;.*\.css;.*\.ico;.*\.htc;</property-value>
>> -                </property>
>> -                <property name="manager-class" value="org.apache.catalina.cluster.session.DeltaManager"/>
>> -                <property name="debug" value="5"/>
>> -                <property name="replication-mode" value="org.apache.catalina.tribes.transport.bio.PooledMultiSender"/>
>> -                <property name="tcp-listen-host" value="auto"/>
>> -                <property name="tcp-listen-port" value="4001"/>
>> -                <property name="tcp-sector-timeout" value="100"/>
>> -                <property name="tcp-thread-count" value="6"/>
>> -                <property name="mcast-bind-addr" value="192.168.2.1"/>
>> -                <property name="mcast-addr" value="224.0.0.1"/>
>> -                <property name="mcast-port" value="45564"/>
>> -                <property name="mcast-freq" value="500"/>
>> -                <property name="mcast-drop-time" value="3000"/>
>> -            </property>
>> -            -->
>> -            <!-- <property name="ssl-accelerator-port" value="8443"/> -->
>>          </property>
>> -        <!-- all connectors support type, host, port, enable-lookups -->
>>          <property name="ajp-connector" value="connector">
>> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/ajp.html for reference -->
>> -            <property name="allowTrace" value="false"/>
>> -            <property name="emptySessionPath" value="false"/>
>> -            <property name="enableLookups" value="true"/>
>> -            <property name="maxPostSize" value="2097152"/>
>> +            <property name="port" value="8010"/>
>>              <property name="protocol" value="AJP/1.3"/>
>> -            <property name="proxyName" value=""/>
>> -            <property name="proxyPort" value=""/>
>> -            <property name="redirectPort" value=""/>
>>              <property name="scheme" value="http"/>
>>              <property name="secure" value="false"/>
>>              <property name="URIEncoding" value="UTF-8"/>
>> -            <property name="useBodyEncodingForURI" value="false"/>
>>              <property name="xpoweredBy" value="true"/>
>> -            <!-- AJP/13 connector attributes -->
>> -            <property name="address" value="0.0.0.0"/>
>> -            <property name="backlog" value="10"/>
>> -            <property name="maxSpareThreads" value="50"/>
>> -            <property name="maxThreads" value="200"/>
>> -            <property name="minSpareThreads" value="4"/>
>> -            <property name="port" value="8010"/>
>> -            <property name="tcpNoDelay" value="true"/>
>> -            <property name="soTimeout" value="60000"/>
>> -            <property name="tomcatAuthentication" value="true"/>
>> +            <property name="enableLookups" value="true"/>
>>          </property>
>>          <property name="http-connector" value="connector">
>> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference -->
>> -            <property name="allowTrace" value="false"/>
>> -            <property name="emptySessionPath" value="false"/>
>> -            <property name="enableLookups" value="true"/>
>> -            <property name="maxPostSize" value="2097152"/>
>> +            <property name="port" value="8080"/>
>>              <property name="protocol" value="HTTP/1.1"/>
>> -            <property name="proxyName" value=""/>
>> -            <property name="proxyPort" value=""/>
>> -            <property name="redirectPort" value=""/>
>>              <property name="scheme" value="http"/>
>>              <property name="secure" value="false"/>
>>              <property name="URIEncoding" value="UTF-8"/>
>> -            <property name="useBodyEncodingForURI" value="false"/>
>>              <property name="xpoweredBy" value="true"/>
>> -            <!-- HTTP connector attributes -->
>> -            <property name="acceptCount" value="10"/>
>> -            <property name="address" value="0.0.0.0"/>
>> -            <property name="bufferSize" value="2048"/>
>> -            <property name="compressableMimeType" value="text/html,text/xml,text/plain"/>
>> +            <property name="enableLookups" value="true"/>
>>              <property name="compression" value="on"/>
>> -            <property name="connectionLinger" value="-1"/>
>> -            <property name="connectionTimeout" value="60000"/>
>> -            <property name="disableUploadTimeout" value="false"/>
>> -            <property name="maxHttpHeaderSize" value="8192"/>
>> -            <property name="maxKeepAliveRequests" value="100"/>
>> -            <property name="maxSpareThreads" value="50"/>
>> -            <property name="maxThreads" value="100"/>
>> -            <property name="minSpareThreads" value="4"/>
>> -            <property name="noCompressionUserAgents" value=""/>
>> -            <property name="port" value="8080"/>
>> -            <property name="restrictedUserAgents" value=""/>
>> -            <property name="server" value=""/>
>> -            <property name="socketBuffer" value="9000"/>
>> -            <property name="strategy" value="lf"/>
>> -            <property name="tcpNoDelay" value="true"/>
>> -            <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/>
>> +            <property name="compressableMimeType" value="text/html,text/xml,text/plain,text/javascript,text/css"/>
>>          </property>
>>          <property name="https-connector" value="connector">
>> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference -->
>> -            <property name="allowTrace" value="false"/>
>> -            <property name="emptySessionPath" value="false"/>
>> -            <property name="enableLookups" value="true"/>
>> -            <property name="maxPostSize" value="2097152"/>
>> +            <property name="port" value="8443"/>
>>              <property name="protocol" value="HTTP/1.1"/>
>> -            <property name="proxyName" value=""/>
>> -            <property name="proxyPort" value=""/>
>> -            <property name="redirectPort" value=""/>
>>              <property name="scheme" value="https"/>
>>              <property name="secure" value="true"/>
>> +            <property name="SSLEnabled" value="true"/>
>>              <property name="URIEncoding" value="UTF-8"/>
>> -            <property name="useBodyEncodingForURI" value="false"/>
>>              <property name="xpoweredBy" value="true"/>
>> -            <!-- HTTP connector attributes -->
>> -            <property name="acceptCount" value="10"/>
>> -            <property name="address" value="0.0.0.0"/>
>> -            <property name="bufferSize" value="2048"/>
>> -            <property name="compressableMimeType" value="text/html,text/xml,text/plain"/>
>> +            <property name="enableLookups" value="true"/>
>>              <property name="compression" value="on"/>
>> -            <property name="connectionLinger" value="-1"/>
>> -            <property name="connectionTimeout" value="60000"/>
>> -            <property name="disableUploadTimeout" value="false"/>
>> -            <property name="maxHttpHeaderSize" value="8192"/>
>> -            <property name="maxKeepAliveRequests" value="100"/>
>> -            <property name="maxSpareThreads" value="50"/>
>> -            <property name="maxThreads" value="100"/>
>> -            <property name="minSpareThreads" value="4"/>
>> -            <property name="noCompressionUserAgents" value=""/>
>> -            <property name="port" value="8443"/>
>> -            <property name="restrictedUserAgents" value=""/>
>> -            <property name="server" value=""/>
>> -            <property name="socketBuffer" value="9000"/>
>> -            <property name="strategy" value="lf"/>
>> -            <property name="tcpNoDelay" value="true"/>
>> -            <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/>
>> -            <!-- SSL connector attributes -->
>> -            <property name="sSLImplementation" value="org.ofbiz.catalina.container.SSLImpl"/>
>> +            <property name="compressableMimeType" value="text/html,text/xml,text/plain,text/javascript,text/css"/>
>> +            <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
>>              <property name="algorithm" value="SunX509"/>
>> -            <property name="clientAuth" value="want"/>
>>              <property name="keystoreFile" value="framework/base/config/ofbizssl.jks"/>
>>              <property name="keystorePass" value="changeit"/>
>>              <property name="keystoreType" value="JKS"/>
>> 
>> Modified: ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java?rev=1625919&r1=1625918&r2=1625919&view=diff
>> ==============================================================================
>> --- ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java (original)
>> +++ ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java Thu Sep 18 09:00:15 2014
>> @@ -21,6 +21,7 @@ package org.ofbiz.catalina.container;
>>  import java.io.File;
>>  import java.net.MalformedURLException;
>>  import java.net.URL;
>> +import java.util.ArrayList;
>>  import java.util.HashMap;
>>  import java.util.Iterator;
>>  import java.util.List;
>> @@ -32,8 +33,6 @@ import java.util.concurrent.ScheduledExe
>>  import javax.naming.InitialContext;
>>  import javax.naming.NamingException;
>>  -import javolution.util.FastList;
>> -
>>  import org.apache.catalina.Cluster;
>>  import org.apache.catalina.Context;
>>  import org.apache.catalina.Engine;
>> @@ -63,8 +62,6 @@ import org.apache.catalina.tribes.transp
>>  import org.apache.catalina.tribes.transport.nio.NioReceiver;
>>  import org.apache.catalina.util.ServerInfo;
>>  import org.apache.catalina.valves.AccessLogValve;
>> -import org.apache.coyote.ProtocolHandler;
>> -import org.apache.coyote.http11.Http11Protocol;
>>  import org.apache.tomcat.JarScanner;
>>  import org.apache.tomcat.util.IntrospectionUtils;
>>  import org.apache.tomcat.util.scan.StandardJarScanner;
>> @@ -236,25 +233,17 @@ public class CatalinaContainer implement
>>          // load the web applications
>>          loadComponents();
>>  -        for (Connector con: tomcat.getService().findConnectors()) {
>> -            ProtocolHandler ph = con.getProtocolHandler();
>> -            int port = con.getPort();
>> -            con.setAttribute("port", port);
>> -            if (ph instanceof Http11Protocol) {
>> -                Http11Protocol hph = (Http11Protocol) ph;
>> -                Debug.logInfo("Connector " + hph.getName() + " @ " + hph.getPort() + " - " +
>> -                    (hph.getSecure() ? "secure" : "not-secure") + " [" + con.getProtocolHandlerClassName() + "] started.", module);
>> -            } else {
>> -                Debug.logInfo("Connector " + con.getProtocol() + " @ " + con.getPort() + " - " +
>> -                    (con.getSecure() ? "secure" : "not-secure") + " [" + con.getProtocolHandlerClassName() + "] started.", module);
>> -            }
>> -        }
>>          // Start the Tomcat server
>>          try {
>>              tomcat.getServer().start();
>>          } catch (LifecycleException e) {
>>              throw new ContainerException(e);
>>          }
>> +
>> +        for (Connector con: tomcat.getService().findConnectors()) {
>> +            Debug.logInfo("Connector " + con.getProtocol() + " @ " + con.getPort() + " - " +
>> +                (con.getSecure() ? "secure" : "not-secure") + " [" + con.getProtocolHandlerClassName() + "] started.", module);
>> +        }
>>          Debug.logInfo("Started " + ServerInfo.getServerInfo(), module);
>>          return true;
>>      }
>> @@ -473,87 +462,28 @@ public class CatalinaContainer implement
>>          if (tomcat == null) {
>>              throw new ContainerException("Cannot create Connector without Tomcat instance!");
>>          }
>> -
>> -        // need some standard properties
>> -        String protocol = ContainerConfig.getPropertyValue(connectorProp, "protocol", "HTTP/1.1");
>> -        String address = ContainerConfig.getPropertyValue(connectorProp, "address", "0.0.0.0");
>> -        int port = ContainerConfig.getPropertyValue(connectorProp, "port", 0) + Start.getInstance().getConfig().portOffset;
>> -
>> -        boolean secure = ContainerConfig.getPropertyValue(connectorProp, "secure", false);
>> -        if (protocol.toLowerCase().startsWith("ajp")) {
>> -            protocol = "ajp";
>> -        } else if ("memory".equals(protocol.toLowerCase())) {
>> -            protocol = "memory";
>> -        } else if (secure) {
>> -            protocol = "https";
>> -        } else {
>> -            protocol = "http";
>> -        }
>> -
>>          Connector connector = null;
>>          if (UtilValidate.isNotEmpty(connectorProp.properties)) {
>> -            if (address != null) {
>> -                /*
>> -                 * InetAddress.toString() returns a string of the form
>> -                 * "<hostname>/<literal_IP>". Get the latter part, so that the
>> -                 * address can be parsed (back) into an InetAddress using
>> -                 * InetAddress.getByName().
>> -                 */
>> -                int index = address.indexOf('/');
>> -                if (index != -1) {
>> -                    address = address.substring(index + 1);
>> -                }
>> -            }
>> +            String protocol = ContainerConfig.getPropertyValue(connectorProp, "protocol", "HTTP/1.1");
>> +            int port = ContainerConfig.getPropertyValue(connectorProp, "port", 0) + Start.getInstance().getConfig().portOffset;
>>  -            Debug.logInfo("Creating connector for address='" +
>> -                          ((address == null) ? "ALL" : address) +
>> -                          "' port='" + port + "' protocol='" + protocol + "'", module);
>> -
>> -            try {
>> -
>> -                if (protocol.equals("ajp")) {
>> -                    connector = new Connector("org.apache.coyote.ajp.AjpProtocol");
>> -                } else if (protocol.equals("memory")) {
>> -                    connector = new Connector("org.apache.coyote.memory.MemoryProtocolHandler");
>> -                } else if (protocol.equals("http")) {
>> -                    connector = new Connector();
>> -                } else if (protocol.equals("https")) {
>> -                    connector = new Connector();
>> -                    connector.setScheme("https");
>> -                    connector.setSecure(true);
>> -                    connector.setProperty("SSLEnabled","true");
>> -                    // FIXME !!!! SET SSL PROPERTIES
>> -                } else {
>> -                    connector = new Connector(protocol);
>> +            // set the protocol and the port first
>> +            connector = new Connector(protocol);
>> +            connector.setPort(port);
>> +            // then set all the other parameters
>> +            for (ContainerConfig.Container.Property prop: connectorProp.properties.values()) {
>> +                if ("protocol".equals(prop.name) || "port".equals(prop.name)) {
>> +                    // protocol and port are already set
>> +                    continue;
>>                  }
>> -
>> -                if (address != null) {
>> -                    IntrospectionUtils.setProperty(connector, "address", "" + address);
>> +                if (IntrospectionUtils.setProperty(connector, prop.name, prop.value)) {
>> +                    Debug.logInfo("Tomcat " + connector + ": set " + prop.name + "=" + prop.value, module);
>> +                } else {
>> +                    Debug.logWarning("Tomcat " + connector + ": ignored parameter " + prop.name, module);
>>                  }
>> -                IntrospectionUtils.setProperty(connector, "port", "" + port);
>> -
>> -            } catch (Exception e) {
>> -                Debug.logError(e, "Couldn't create connector.", module);
>>              }
>>  -            try {
>> -                for (ContainerConfig.Container.Property prop: connectorProp.properties.values()) {
>> -                    if ("port".equals(prop.name)) {
>> -                        connector.setProperty(prop.name, "" + port);
>> -                    } else {
>> -                        connector.setProperty(prop.name, prop.value);
>> -                        //connector.setAttribute(prop.name, prop.value);
>> -                    }
>> -                }
>> -
>> -                if (connectorProp.properties.containsKey("URIEncoding")) {
>> -                    connector.setURIEncoding(connectorProp.properties.get("URIEncoding").value);
>> -                }
>> -
>> -                tomcat.getService().addConnector(connector);
>> -            } catch (Exception e) {
>> -                throw new ContainerException(e);
>> -            }
>> +            tomcat.getService().addConnector(connector);
>>          }
>>          return connector;
>>      }
>> @@ -728,21 +658,21 @@ public class CatalinaContainer implement
>>            // load the applications
>>          List<ComponentConfig.WebappInfo> webResourceInfos = ComponentConfig.getAllWebappResourceInfos();
>> -        List<String> loadedMounts = FastList.newInstance();
>> +        List<String> loadedMounts = new ArrayList<String>();
>>          if (webResourceInfos == null) {
>>              return;
>>          }
>>            ScheduledExecutorService executor = ExecutionPool.getScheduledExecutor(CATALINA_THREAD_GROUP, "catalina-startup", -1, true);
>>          try {
>> -            List<Future<Context>> futures = FastList.newInstance();
>> +            List<Future<Context>> futures = new ArrayList<Future<Context>>();
>>                for (int i = webResourceInfos.size(); i > 0; i--) {
>>                  ComponentConfig.WebappInfo appInfo = webResourceInfos.get(i - 1);
>>                  String engineName = appInfo.server;
>>                  List<String> virtualHosts = appInfo.getVirtualHosts();
>>                  String mount = appInfo.getContextRoot();
>> -                List<String> keys = FastList.newInstance();
>> +                List<String> keys = new ArrayList<String>();
>>                  if (virtualHosts.isEmpty()) {
>>                      keys.add(engineName + ":DEFAULT:" + mount);
>>                  } else {
>> 
>> 
>> 


Re: svn commit: r1625919 - in /ofbiz/trunk/framework/catalina: ofbiz-component.xml src/org/ofbiz/catalina/container/CatalinaContainer.java

Posted by Jacques Le Roux <ja...@les7arts.com>.
Hi Jacopo,

I was confused by the enableLookups parameter default value (false) which is now clearly defined in Tomcat 7.
Confusion came from here: http://www.baselogic.com/blog/development/java-javaee-j2ee/tomcat-6-connector-option-enablelookups-defaulting-true/
Do you know why are we not using the default value (once again false)?

Jacques

Le 18/09/2014 11:00, jacopoc@apache.org a écrit :
> Author: jacopoc
> Date: Thu Sep 18 09:00:15 2014
> New Revision: 1625919
>
> URL: http://svn.apache.org/r1625919
> Log:
> Simplified and improved the logic to setup the Tomcat connectors: the logic was overly complex and messed up (probably after all the various upgrades to new Tomcat versions), there were a series of parameters that could not be set, some hardcoded values, some old and no more used (by Tomcat) parameters.
>   Improved the information logged about the actual parameters set for the connectors.
> Removed Javolution from CatalinaContainer.
> Cleaned up the connector configuration file: removed no more used parameters, commented out some parameters (that didn't change the default), commented out some parameters in order to use the Tomcat default values that may improve the performance (e.g. maxThreads in OFBiz was set to a lower value than the default one of newer Tomcat releases and this limits the throughput in default OFBiz setups), updated URLs to Tomcat documentation.
>
> Modified:
>      ofbiz/trunk/framework/catalina/ofbiz-component.xml
>      ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
>
> Modified: ofbiz/trunk/framework/catalina/ofbiz-component.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/catalina/ofbiz-component.xml?rev=1625919&r1=1625918&r2=1625919&view=diff
> ==============================================================================
> --- ofbiz/trunk/framework/catalina/ofbiz-component.xml (original)
> +++ ofbiz/trunk/framework/catalina/ofbiz-component.xml Thu Sep 18 09:00:15 2014
> @@ -66,116 +66,83 @@ under the License.
>               <!-- <property name="ssl-accelerator-port" value="8443"/> -->
>               <property name="enable-cross-subdomain-sessions" value="false"/>
>           </property>
> -        <!-- all connectors support type, host, port, enable-lookups -->
>           <property name="ajp-connector" value="connector">
> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/ajp.html for reference -->
> -            <property name="allowTrace" value="false"/>
> -            <property name="emptySessionPath" value="false"/>
> -            <property name="enableLookups" value="true"/>
> -            <property name="maxPostSize" value="2097152"/>
> +            <!-- see http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html for reference -->
> +            <property name="port" value="8009"/>
>               <property name="protocol" value="AJP/1.3"/>
> -            <property name="proxyName" value=""/>
> -            <property name="proxyPort" value=""/>
> -            <property name="redirectPort" value=""/>
>               <property name="scheme" value="http"/>
>               <property name="secure" value="false"/>
>               <property name="URIEncoding" value="UTF-8"/>
> -            <property name="useBodyEncodingForURI" value="false"/>
>               <property name="xpoweredBy" value="true"/>
> +            <property name="enableLookups" value="true"/> <!-- set to false to improve performance (false is the default value in Tomcat) -->
>               <!-- AJP/13 connector attributes -->
> -            <property name="address" value="0.0.0.0"/>
> -            <property name="backlog" value="10"/>
> -            <property name="maxSpareThreads" value="50"/>
> +            <!-- commented out because the values match the Tomcat defaults:
> +            <property name="tomcatAuthentication" value="true"/>
> +            <property name="allowTrace" value="false"/>
> +            <property name="maxPostSize" value="2097152"/>
> +            <property name="noCompressionUserAgents" value=""/>
> +            <property name="connectionLinger" value="-1"/>
> +            <property name="connectionTimeout" value="60000"/>
> +            <property name="maxHttpHeaderSize" value="8192"/>
> +            <property name="maxKeepAliveRequests" value="100"/>
>               <property name="maxThreads" value="200"/>
> -            <property name="minSpareThreads" value="4"/>
> -            <property name="port" value="8009"/>
> +            <property name="minSpareThreads" value="10"/>
> +            <property name="acceptCount" value="100"/>
> +            <property name="restrictedUserAgents" value=""/>
> +            <property name="socketBuffer" value="9000"/>
>               <property name="tcpNoDelay" value="true"/>
> -            <property name="soTimeout" value="60000"/>
> -            <property name="tomcatAuthentication" value="true"/>
> +            <property name="threadPriority" value="5"/>
> +            -->
>           </property>
>           <property name="http-connector" value="connector">
> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference -->
> -            <property name="allowTrace" value="false"/>
> -            <property name="emptySessionPath" value="false"/>
> -            <property name="enableLookups" value="true"/>
> -            <property name="maxPostSize" value="2097152"/>
> +            <!-- see http://tomcat.apache.org/tomcat-7.0-doc/config/http.html for reference -->
> +            <property name="port" value="8080"/>
>               <property name="protocol" value="HTTP/1.1"/>
> -            <property name="proxyName" value=""/>
> -            <property name="proxyPort" value=""/>
> -            <property name="redirectPort" value=""/>
>               <property name="scheme" value="http"/>
>               <property name="secure" value="false"/>
>               <property name="URIEncoding" value="UTF-8"/>
> -            <property name="useBodyEncodingForURI" value="false"/>
>               <property name="xpoweredBy" value="true"/>
> -            <!-- HTTP connector attributes -->
> -            <property name="acceptCount" value="10"/>
> -            <property name="address" value="0.0.0.0"/>
> -            <property name="bufferSize" value="2048"/>
> +            <property name="enableLookups" value="true"/> <!-- set to false to improve performance (false is the default value in Tomcat) -->
>               <property name="compression" value="on"/>
>               <property name="compressableMimeType" value="text/html,text/xml,text/plain,text/javascript,text/css"/>
> +            <!-- commented out because the values match the Tomcat defaults:
> +            <property name="allowTrace" value="false"/>
> +            <property name="maxPostSize" value="2097152"/>
>               <property name="noCompressionUserAgents" value=""/>
>               <property name="connectionLinger" value="-1"/>
>               <property name="connectionTimeout" value="60000"/>
> -            <property name="disableUploadTimeout" value="false"/>
>               <property name="maxHttpHeaderSize" value="8192"/>
>               <property name="maxKeepAliveRequests" value="100"/>
> -            <property name="maxSpareThreads" value="50"/>
> -            <property name="maxThreads" value="100"/>
> -            <property name="minSpareThreads" value="4"/>
> -            <property name="port" value="8080"/>
> +            <property name="maxThreads" value="200"/>
> +            <property name="minSpareThreads" value="10"/>
> +            <property name="acceptCount" value="100"/>
>               <property name="restrictedUserAgents" value=""/>
> -            <property name="server" value=""/>
>               <property name="socketBuffer" value="9000"/>
> -            <property name="strategy" value="lf"/>
>               <property name="tcpNoDelay" value="true"/>
> -            <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/>
> +            <property name="threadPriority" value="5"/>
> +            -->
>           </property>
>           <property name="https-connector" value="connector">
> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference -->
> -            <property name="allowTrace" value="false"/>
> -            <property name="emptySessionPath" value="false"/>
> -            <property name="enableLookups" value="true"/>
> -            <property name="maxPostSize" value="2097152"/>
> +            <!-- see http://tomcat.apache.org/tomcat-7.0-doc/config/http.html for reference -->
> +            <property name="port" value="8443"/>
>               <property name="protocol" value="HTTP/1.1"/>
> -            <property name="proxyName" value=""/>
> -            <property name="proxyPort" value=""/>
> -            <property name="redirectPort" value=""/>
>               <property name="scheme" value="https"/>
>               <property name="secure" value="true"/>
> +            <property name="SSLEnabled" value="true"/>
>               <property name="URIEncoding" value="UTF-8"/>
> -            <property name="useBodyEncodingForURI" value="false"/>
>               <property name="xpoweredBy" value="true"/>
> -            <!-- HTTP connector attributes -->
> -            <property name="acceptCount" value="10"/>
> -            <property name="address" value="0.0.0.0"/>
> -            <property name="bufferSize" value="2048"/>
> +            <property name="enableLookups" value="true"/> <!-- set to false to improve performance (false is the default value in Tomcat) -->
>               <property name="compression" value="on"/>
>               <property name="compressableMimeType" value="text/html,text/xml,text/plain,text/javascript,text/css"/>
> -            <property name="noCompressionUserAgents" value=""/>
> -            <property name="connectionLinger" value="-1"/>
> -            <property name="connectionTimeout" value="60000"/>
> -            <property name="disableUploadTimeout" value="false"/>
> -            <property name="maxHttpHeaderSize" value="8192"/>
> -            <property name="maxKeepAliveRequests" value="100"/>
> -            <property name="maxSpareThreads" value="50"/>
> -            <property name="maxThreads" value="100"/>
> -            <property name="minSpareThreads" value="4"/>
> -            <property name="port" value="8443"/>
> -            <property name="restrictedUserAgents" value=""/>
> -            <property name="server" value=""/>
> -            <property name="socketBuffer" value="9000"/>
> -            <property name="strategy" value="lf"/>
> -            <property name="tcpNoDelay" value="true"/>
> -            <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/>
>               <!-- SSL connector attributes -->
> -            <property name="sSLImplementation" value="org.ofbiz.catalina.container.SSLImpl"/>
> +            <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
>               <property name="algorithm" value="SunX509"/>
>               <!-- the clientAuth to "want" in order to receive certs from the client;
>                   note that this isn't set this way by default because with certain browsers
>                   (like Safari) it breaks access via HTTPS, so until that problem is fixed
> -                the default will be false -->
> +                the default will be false
>               <property name="clientAuth" value="false"/>
> +            -->
>               <property name="keystoreFile" value="framework/base/config/ofbizssl.jks"/>
>               <property name="keystorePass" value="changeit"/>
>               <property name="keystoreType" value="JKS"/>
> @@ -202,133 +169,40 @@ under the License.
>               <property name="access-log-prefix" value="access_log."/>
>               <property name="access-log-dir" value="runtime/logs"/>
>               <property name="enable-request-dump" value="false"/>
> -            <!-- uncomment for cluster support
> -            <property name="default-server-cluster" value="cluster">
> -                <property name="rep-valve-filter">
> -                <property-value>.*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;.*\.png;.*\.css;.*\.ico;.*\.htc;</property-value>
> -                </property>
> -                <property name="manager-class" value="org.apache.catalina.cluster.session.DeltaManager"/>
> -                <property name="debug" value="5"/>
> -                <property name="replication-mode" value="org.apache.catalina.tribes.transport.bio.PooledMultiSender"/>
> -                <property name="tcp-listen-host" value="auto"/>
> -                <property name="tcp-listen-port" value="4001"/>
> -                <property name="tcp-sector-timeout" value="100"/>
> -                <property name="tcp-thread-count" value="6"/>
> -                <property name="mcast-bind-addr" value="192.168.2.1"/>
> -                <property name="mcast-addr" value="224.0.0.1"/>
> -                <property name="mcast-port" value="45564"/>
> -                <property name="mcast-freq" value="500"/>
> -                <property name="mcast-drop-time" value="3000"/>
> -            </property>
> -            -->
> -            <!-- <property name="ssl-accelerator-port" value="8443"/> -->
>           </property>
> -        <!-- all connectors support type, host, port, enable-lookups -->
>           <property name="ajp-connector" value="connector">
> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/ajp.html for reference -->
> -            <property name="allowTrace" value="false"/>
> -            <property name="emptySessionPath" value="false"/>
> -            <property name="enableLookups" value="true"/>
> -            <property name="maxPostSize" value="2097152"/>
> +            <property name="port" value="8010"/>
>               <property name="protocol" value="AJP/1.3"/>
> -            <property name="proxyName" value=""/>
> -            <property name="proxyPort" value=""/>
> -            <property name="redirectPort" value=""/>
>               <property name="scheme" value="http"/>
>               <property name="secure" value="false"/>
>               <property name="URIEncoding" value="UTF-8"/>
> -            <property name="useBodyEncodingForURI" value="false"/>
>               <property name="xpoweredBy" value="true"/>
> -            <!-- AJP/13 connector attributes -->
> -            <property name="address" value="0.0.0.0"/>
> -            <property name="backlog" value="10"/>
> -            <property name="maxSpareThreads" value="50"/>
> -            <property name="maxThreads" value="200"/>
> -            <property name="minSpareThreads" value="4"/>
> -            <property name="port" value="8010"/>
> -            <property name="tcpNoDelay" value="true"/>
> -            <property name="soTimeout" value="60000"/>
> -            <property name="tomcatAuthentication" value="true"/>
> +            <property name="enableLookups" value="true"/>
>           </property>
>           <property name="http-connector" value="connector">
> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference -->
> -            <property name="allowTrace" value="false"/>
> -            <property name="emptySessionPath" value="false"/>
> -            <property name="enableLookups" value="true"/>
> -            <property name="maxPostSize" value="2097152"/>
> +            <property name="port" value="8080"/>
>               <property name="protocol" value="HTTP/1.1"/>
> -            <property name="proxyName" value=""/>
> -            <property name="proxyPort" value=""/>
> -            <property name="redirectPort" value=""/>
>               <property name="scheme" value="http"/>
>               <property name="secure" value="false"/>
>               <property name="URIEncoding" value="UTF-8"/>
> -            <property name="useBodyEncodingForURI" value="false"/>
>               <property name="xpoweredBy" value="true"/>
> -            <!-- HTTP connector attributes -->
> -            <property name="acceptCount" value="10"/>
> -            <property name="address" value="0.0.0.0"/>
> -            <property name="bufferSize" value="2048"/>
> -            <property name="compressableMimeType" value="text/html,text/xml,text/plain"/>
> +            <property name="enableLookups" value="true"/>
>               <property name="compression" value="on"/>
> -            <property name="connectionLinger" value="-1"/>
> -            <property name="connectionTimeout" value="60000"/>
> -            <property name="disableUploadTimeout" value="false"/>
> -            <property name="maxHttpHeaderSize" value="8192"/>
> -            <property name="maxKeepAliveRequests" value="100"/>
> -            <property name="maxSpareThreads" value="50"/>
> -            <property name="maxThreads" value="100"/>
> -            <property name="minSpareThreads" value="4"/>
> -            <property name="noCompressionUserAgents" value=""/>
> -            <property name="port" value="8080"/>
> -            <property name="restrictedUserAgents" value=""/>
> -            <property name="server" value=""/>
> -            <property name="socketBuffer" value="9000"/>
> -            <property name="strategy" value="lf"/>
> -            <property name="tcpNoDelay" value="true"/>
> -            <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/>
> +            <property name="compressableMimeType" value="text/html,text/xml,text/plain,text/javascript,text/css"/>
>           </property>
>           <property name="https-connector" value="connector">
> -            <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference -->
> -            <property name="allowTrace" value="false"/>
> -            <property name="emptySessionPath" value="false"/>
> -            <property name="enableLookups" value="true"/>
> -            <property name="maxPostSize" value="2097152"/>
> +            <property name="port" value="8443"/>
>               <property name="protocol" value="HTTP/1.1"/>
> -            <property name="proxyName" value=""/>
> -            <property name="proxyPort" value=""/>
> -            <property name="redirectPort" value=""/>
>               <property name="scheme" value="https"/>
>               <property name="secure" value="true"/>
> +            <property name="SSLEnabled" value="true"/>
>               <property name="URIEncoding" value="UTF-8"/>
> -            <property name="useBodyEncodingForURI" value="false"/>
>               <property name="xpoweredBy" value="true"/>
> -            <!-- HTTP connector attributes -->
> -            <property name="acceptCount" value="10"/>
> -            <property name="address" value="0.0.0.0"/>
> -            <property name="bufferSize" value="2048"/>
> -            <property name="compressableMimeType" value="text/html,text/xml,text/plain"/>
> +            <property name="enableLookups" value="true"/>
>               <property name="compression" value="on"/>
> -            <property name="connectionLinger" value="-1"/>
> -            <property name="connectionTimeout" value="60000"/>
> -            <property name="disableUploadTimeout" value="false"/>
> -            <property name="maxHttpHeaderSize" value="8192"/>
> -            <property name="maxKeepAliveRequests" value="100"/>
> -            <property name="maxSpareThreads" value="50"/>
> -            <property name="maxThreads" value="100"/>
> -            <property name="minSpareThreads" value="4"/>
> -            <property name="noCompressionUserAgents" value=""/>
> -            <property name="port" value="8443"/>
> -            <property name="restrictedUserAgents" value=""/>
> -            <property name="server" value=""/>
> -            <property name="socketBuffer" value="9000"/>
> -            <property name="strategy" value="lf"/>
> -            <property name="tcpNoDelay" value="true"/>
> -            <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/>
> -            <!-- SSL connector attributes -->
> -            <property name="sSLImplementation" value="org.ofbiz.catalina.container.SSLImpl"/>
> +            <property name="compressableMimeType" value="text/html,text/xml,text/plain,text/javascript,text/css"/>
> +            <property name="sslImplementationName" value="org.ofbiz.catalina.container.SSLImpl"/>
>               <property name="algorithm" value="SunX509"/>
> -            <property name="clientAuth" value="want"/>
>               <property name="keystoreFile" value="framework/base/config/ofbizssl.jks"/>
>               <property name="keystorePass" value="changeit"/>
>               <property name="keystoreType" value="JKS"/>
>
> Modified: ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java?rev=1625919&r1=1625918&r2=1625919&view=diff
> ==============================================================================
> --- ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java (original)
> +++ ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java Thu Sep 18 09:00:15 2014
> @@ -21,6 +21,7 @@ package org.ofbiz.catalina.container;
>   import java.io.File;
>   import java.net.MalformedURLException;
>   import java.net.URL;
> +import java.util.ArrayList;
>   import java.util.HashMap;
>   import java.util.Iterator;
>   import java.util.List;
> @@ -32,8 +33,6 @@ import java.util.concurrent.ScheduledExe
>   import javax.naming.InitialContext;
>   import javax.naming.NamingException;
>   
> -import javolution.util.FastList;
> -
>   import org.apache.catalina.Cluster;
>   import org.apache.catalina.Context;
>   import org.apache.catalina.Engine;
> @@ -63,8 +62,6 @@ import org.apache.catalina.tribes.transp
>   import org.apache.catalina.tribes.transport.nio.NioReceiver;
>   import org.apache.catalina.util.ServerInfo;
>   import org.apache.catalina.valves.AccessLogValve;
> -import org.apache.coyote.ProtocolHandler;
> -import org.apache.coyote.http11.Http11Protocol;
>   import org.apache.tomcat.JarScanner;
>   import org.apache.tomcat.util.IntrospectionUtils;
>   import org.apache.tomcat.util.scan.StandardJarScanner;
> @@ -236,25 +233,17 @@ public class CatalinaContainer implement
>           // load the web applications
>           loadComponents();
>   
> -        for (Connector con: tomcat.getService().findConnectors()) {
> -            ProtocolHandler ph = con.getProtocolHandler();
> -            int port = con.getPort();
> -            con.setAttribute("port", port);
> -            if (ph instanceof Http11Protocol) {
> -                Http11Protocol hph = (Http11Protocol) ph;
> -                Debug.logInfo("Connector " + hph.getName() + " @ " + hph.getPort() + " - " +
> -                    (hph.getSecure() ? "secure" : "not-secure") + " [" + con.getProtocolHandlerClassName() + "] started.", module);
> -            } else {
> -                Debug.logInfo("Connector " + con.getProtocol() + " @ " + con.getPort() + " - " +
> -                    (con.getSecure() ? "secure" : "not-secure") + " [" + con.getProtocolHandlerClassName() + "] started.", module);
> -            }
> -        }
>           // Start the Tomcat server
>           try {
>               tomcat.getServer().start();
>           } catch (LifecycleException e) {
>               throw new ContainerException(e);
>           }
> +
> +        for (Connector con: tomcat.getService().findConnectors()) {
> +            Debug.logInfo("Connector " + con.getProtocol() + " @ " + con.getPort() + " - " +
> +                (con.getSecure() ? "secure" : "not-secure") + " [" + con.getProtocolHandlerClassName() + "] started.", module);
> +        }
>           Debug.logInfo("Started " + ServerInfo.getServerInfo(), module);
>           return true;
>       }
> @@ -473,87 +462,28 @@ public class CatalinaContainer implement
>           if (tomcat == null) {
>               throw new ContainerException("Cannot create Connector without Tomcat instance!");
>           }
> -
> -        // need some standard properties
> -        String protocol = ContainerConfig.getPropertyValue(connectorProp, "protocol", "HTTP/1.1");
> -        String address = ContainerConfig.getPropertyValue(connectorProp, "address", "0.0.0.0");
> -        int port = ContainerConfig.getPropertyValue(connectorProp, "port", 0) + Start.getInstance().getConfig().portOffset;
> -
> -        boolean secure = ContainerConfig.getPropertyValue(connectorProp, "secure", false);
> -        if (protocol.toLowerCase().startsWith("ajp")) {
> -            protocol = "ajp";
> -        } else if ("memory".equals(protocol.toLowerCase())) {
> -            protocol = "memory";
> -        } else if (secure) {
> -            protocol = "https";
> -        } else {
> -            protocol = "http";
> -        }
> -
>           Connector connector = null;
>           if (UtilValidate.isNotEmpty(connectorProp.properties)) {
> -            if (address != null) {
> -                /*
> -                 * InetAddress.toString() returns a string of the form
> -                 * "<hostname>/<literal_IP>". Get the latter part, so that the
> -                 * address can be parsed (back) into an InetAddress using
> -                 * InetAddress.getByName().
> -                 */
> -                int index = address.indexOf('/');
> -                if (index != -1) {
> -                    address = address.substring(index + 1);
> -                }
> -            }
> +            String protocol = ContainerConfig.getPropertyValue(connectorProp, "protocol", "HTTP/1.1");
> +            int port = ContainerConfig.getPropertyValue(connectorProp, "port", 0) + Start.getInstance().getConfig().portOffset;
>   
> -            Debug.logInfo("Creating connector for address='" +
> -                          ((address == null) ? "ALL" : address) +
> -                          "' port='" + port + "' protocol='" + protocol + "'", module);
> -
> -            try {
> -
> -                if (protocol.equals("ajp")) {
> -                    connector = new Connector("org.apache.coyote.ajp.AjpProtocol");
> -                } else if (protocol.equals("memory")) {
> -                    connector = new Connector("org.apache.coyote.memory.MemoryProtocolHandler");
> -                } else if (protocol.equals("http")) {
> -                    connector = new Connector();
> -                } else if (protocol.equals("https")) {
> -                    connector = new Connector();
> -                    connector.setScheme("https");
> -                    connector.setSecure(true);
> -                    connector.setProperty("SSLEnabled","true");
> -                    // FIXME !!!! SET SSL PROPERTIES
> -                } else {
> -                    connector = new Connector(protocol);
> +            // set the protocol and the port first
> +            connector = new Connector(protocol);
> +            connector.setPort(port);
> +            // then set all the other parameters
> +            for (ContainerConfig.Container.Property prop: connectorProp.properties.values()) {
> +                if ("protocol".equals(prop.name) || "port".equals(prop.name)) {
> +                    // protocol and port are already set
> +                    continue;
>                   }
> -
> -                if (address != null) {
> -                    IntrospectionUtils.setProperty(connector, "address", "" + address);
> +                if (IntrospectionUtils.setProperty(connector, prop.name, prop.value)) {
> +                    Debug.logInfo("Tomcat " + connector + ": set " + prop.name + "=" + prop.value, module);
> +                } else {
> +                    Debug.logWarning("Tomcat " + connector + ": ignored parameter " + prop.name, module);
>                   }
> -                IntrospectionUtils.setProperty(connector, "port", "" + port);
> -
> -            } catch (Exception e) {
> -                Debug.logError(e, "Couldn't create connector.", module);
>               }
>   
> -            try {
> -                for (ContainerConfig.Container.Property prop: connectorProp.properties.values()) {
> -                    if ("port".equals(prop.name)) {
> -                        connector.setProperty(prop.name, "" + port);
> -                    } else {
> -                        connector.setProperty(prop.name, prop.value);
> -                        //connector.setAttribute(prop.name, prop.value);
> -                    }
> -                }
> -
> -                if (connectorProp.properties.containsKey("URIEncoding")) {
> -                    connector.setURIEncoding(connectorProp.properties.get("URIEncoding").value);
> -                }
> -
> -                tomcat.getService().addConnector(connector);
> -            } catch (Exception e) {
> -                throw new ContainerException(e);
> -            }
> +            tomcat.getService().addConnector(connector);
>           }
>           return connector;
>       }
> @@ -728,21 +658,21 @@ public class CatalinaContainer implement
>   
>           // load the applications
>           List<ComponentConfig.WebappInfo> webResourceInfos = ComponentConfig.getAllWebappResourceInfos();
> -        List<String> loadedMounts = FastList.newInstance();
> +        List<String> loadedMounts = new ArrayList<String>();
>           if (webResourceInfos == null) {
>               return;
>           }
>   
>           ScheduledExecutorService executor = ExecutionPool.getScheduledExecutor(CATALINA_THREAD_GROUP, "catalina-startup", -1, true);
>           try {
> -            List<Future<Context>> futures = FastList.newInstance();
> +            List<Future<Context>> futures = new ArrayList<Future<Context>>();
>   
>               for (int i = webResourceInfos.size(); i > 0; i--) {
>                   ComponentConfig.WebappInfo appInfo = webResourceInfos.get(i - 1);
>                   String engineName = appInfo.server;
>                   List<String> virtualHosts = appInfo.getVirtualHosts();
>                   String mount = appInfo.getContextRoot();
> -                List<String> keys = FastList.newInstance();
> +                List<String> keys = new ArrayList<String>();
>                   if (virtualHosts.isEmpty()) {
>                       keys.add(engineName + ":DEFAULT:" + mount);
>                   } else {
>
>
>