cancel
Showing results for 
Search instead for 
Did you mean: 

Exception launching JUnit test nuxeo-opencmis-tests org/nuxeo/ecm/core/opencmis/impl/TestNuxeoSessionAtomPub.java from Eclipse

ron_1
Star Contributor
Star Contributor

I receive the following error when I attempt to launch JUnit test org/nuxeo/ecm/core/opencmis/impl/TestNuxeoSessionAtomPub.java from Eclipse. The tests run fine from Maven command-line so I suspect this is a "Tomcat running within Eclipse" anomaly. Any suggestions?

DatabaseHelper: Database used for VCS tests: org.nuxeo.ecm.core.storage.sql.DatabaseH2
Unknown JNDI Context class: null
Jun 5, 2012 6:43:39 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-17488"]
Jun 5, 2012 6:43:40 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Tomcat
Jun 5, 2012 6:43:40 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.23
Jun 5, 2012 6:43:40 AM org.apache.catalina.startup.DigesterFactory register
WARNING: Could not get url for /javax/servlet/jsp/resources/jsp_2_2.xsd
Jun 5, 2012 6:43:40 AM org.apache.catalina.startup.DigesterFactory register
WARNING: Could not get url for /javax/servlet/jsp/resources/web-jsptaglibrary_2_1.xsd
Jun 5, 2012 6:43:40 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-17488"]
Jun 5, 2012 6:44:03 AM org.apache.coyote.http11.AbstractHttp11Processor process
SEVERE: Error processing request
java.lang.NoSuchMethodError: javax.servlet.ServletContext.getEffectiveSessionTrackingModes()Ljava/util/Set;
at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:674)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:402)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
6 REPLIES 6

Florent_Guillau
World-Class Innovator
World-Class Innovator

We don't quite support Tomcat 7 at the moment. It requires Servlet 3 but Nuxeo only has Servlet 2.5.

I see that the nuxeo-opencmis-tests pom.xml includes the following tomcat 7 dependencies

I went ahead and reconfigured NuxeoSessionClientServerTestCase to use Jetty instead of Tomcat to workaround the problem and as expected, the Servlet 3 problem disappeared. However, now I receive the following error, again when running within Eclipse. Any thoughts?

The use of embedded Tomcat 7 in tests is not a reflection of the ability of the whole platform to run under Tomcat.

The stacktrace I listed above with the JVM_Bind was a Red Herring. The real stacktrace that occurs when I run a TestNuxeoSessionAtomPub test in Eclipse with the test reconfigured for Jetty (USE_TOMCAT=false) is listed at the bottom of this comment.

Florent_Guillau
World-Class Innovator
World-Class Innovator

Not sure why it runs via maven indeed...

Yes HttpUtils.splitPath is a bit strange. NXP-9550 includes a fix for this.

Note that when running the CMIS tests from Eclipse you must make sure that the classpath has tomcat-embed-core early in the list of dependencies as it includes a version of servlet-api 3.0 which, if later in the classpath, could be overridden by the standard servlet-api 2.5 dependency of the rest of Nuxeo.