Is Tomcat 7 support planned ?
I saw in the forums that there's been some attempts to get Nuxeo running on Tomcat 7 so I was wondering if this is in the roadmap for upcoming versions. If not, this could be used to gather links and references for what needs to be done to get Nuxeo running on Tomcat. Websocket support is what i'm looking for, especially with Atmosphere and its JAX-RS integration…
Nuxeo will be moved to Tomcat 7 when there is customer demand, or if we have some free time…
EDIT Tomcat 7 is supported since Nuxeo 5.7.2, see NXP-10071.
Ok, so I finally had some time and managed to get Nuxeo 5.5 running in Tomcat 7 so, for reference, this is what I had to do:
Start with clean Apache Tomcat 7.0.27 and just use meld or some directory diff tool to do the following:
Add nuxeoctl, nuxeo-lanucher.jar, etc .. to bin
Add endorsed libs
Add missing jars to lib
Add nxserver directory
Setup the templates (templates/default/conf) diff from nuxeo 5.5:
server.xml / server.xml.nx
Remove:
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
Add :
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
Changes to nuxeo-launcher.jar (just clone nuxeo-distribution and change):
nuxeo-distribution/nuxeo-launcher/src/main/java/org/nuxeo/launcher/NuxeoTomcatLauncher.java
protected String getClassPath() { String cp = "."; // This is not needed - cp = addToClassPath(cp, "nxserver" + File.separator + "lib"); cp = addToClassPath(cp, "bin" + File.separator + "bootstrap.jar"); cp = addToClassPath(cp, "bin" + File.separator + "tomcat-juli.jar"); // Add tomcat-juli.jar return cp; }
Changes to nuxeo-runtime-tomcat-adapter.jar (just clone nuxeo-runtime and change):
nuxeo-runtime/nuxeo-runtime-tomcat-adapter/src/main/java/org/nuxeo/runtime/tomcat/NuxeoLauncher.java
protected void handleEvent(NuxeoWebappLoader loader, LifecycleEvent event) {
... // Was Lifecycle.START but should probably be Lifecycle.CONFIGURE_START in Tomcat 7 // hardcoded just for testing! if (type == "configure_start") { ... }
} `
UPDATE
After properly changing the Lifecycle event to “configure_start” most of my previous changes are not needed and in fact break the classloading. I've updated the answer to match the proper changes to make.