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…

0 votes

2 answers

2966 views

ANSWER



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.

0 votes



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.


3 votes



Sorry if this seems messy.. but I thougth it would be nice to have these notes here. I would gladly create a JIRA issue for this and submit pull requests but not sure how Tomcat 7 support should be added. Should a new launcher and adapter be created or should we try to make it work with both Tomcat 6 and 7 ?
05/07/2012

Could have been good here as well: http://dev.blogs.nuxeo.com/2012/04/qa-friday-cdi-tomcat7.html Pull request would be awe but I will let the tech lead drive the discussion :-) cheers
05/07/2012

Thanks a lot Nelson. We'll take what you did and update the platform for Nuxeo 5.6 to support Tomcat 7 (if time permits). If you want you can open a JIRA issues for the technical discussion yes.
05/07/2012