Details
Description
Over in Maven land I encountered the following failure while debugging a user provided test project:
2010-08-05 12:03:26.114:WARN::Failed startup of context JettyWebAppContext@19fc25@19fc25/test,file:/M:/downloads/TestJavaAgent/src/main/webapp/,file:/M:/downloa
ds/TestJavaAgent/src/main/webapp/
MultiException[java.lang.NoSuchMethodError: javax.servlet.ServletContext.createServlet(Ljava/lang/Class;)Ljavax/servlet/Servlet;, java.lang.NoSuchMethodError: j
avax.servlet.ServletContext.createServlet(Ljava/lang/Class;)Ljavax/servlet/Servlet;, java.lang.NoSuchMethodError: javax.servlet.ServletContext.createServlet(Lja
va/lang/Class;)Ljavax/servlet/Servlet;]
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:692)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:279)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:999)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:610)
at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:155)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:384)
at org.mortbay.jetty.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:127)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:165)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:162)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:165)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:92)
at org.eclipse.jetty.server.Server.doStart(Server.java:243)
at org.mortbay.jetty.plugin.JettyServer.doStart(JettyServer.java:67)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:437)
at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:377)
at org.mortbay.jetty.plugin.JettyRunMojo.execute(JettyRunMojo.java:546)
Turns out the Jetty Maven Plugin depends on two different versions of the Servlet API:
org.mortbay.jetty:jetty-maven-plugin:jar:8.0.0.M1:
org.eclipse.jetty:jetty-webapp:jar:8.0.0.M1:compile
org.eclipse.jetty:jetty-xml:jar:8.0.0.M1:compile
org.eclipse.jetty:jetty-util:jar:8.0.0.M1:compile
org.eclipse.jetty:jetty-servlet:jar:8.0.0.M1:compile
org.eclipse.jetty:jetty-security:jar:8.0.0.M1:compile
org.apache.maven:maven-project:jar:2.0.8:compile
org.apache.maven:maven-settings:jar:2.0.8:compile
org.apache.maven:maven-profile:jar:2.0.8:compile
org.apache.maven:maven-model:jar:2.0.8:compile
org.apache.maven:maven-artifact-manager:jar:2.0.8:compile
org.apache.maven:maven-repository-metadata:jar:2.0.8:compile
org.apache.maven:maven-plugin-registry:jar:2.0.8:compile
org.codehaus.plexus:plexus-utils:jar:1.4.6:compile
org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
junit:junit:jar:3.8.1:compile
classworlds:classworlds:jar:1.1-alpha-2:compile
org.apache.maven:maven-plugin-api:jar:2.0.8:compile
org.apache.maven:maven-artifact:jar:2.0.8:compile
org.apache.maven.plugin-tools:maven-plugin-tools-api:jar:2.5.1:compile
org.apache.maven.reporting:maven-reporting-api:jar:2.0.6:compile
org.apache.maven.doxia:doxia-sink-api:jar:1.0-alpha-7:compile
org.apache.maven:maven-plugin-descriptor:jar:2.0.6:compile
jtidy:jtidy:jar:4aug2000r7-dev:compile
org.eclipse.jetty:jetty-plus:jar:8.0.0.M1:compile
org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1.1:compile
org.eclipse.jetty:jetty-jndi:jar:8.0.0.M1:compile
javax.mail:mail:jar:1.4.1:compile
org.eclipse.jetty:jetty-jmx:jar:8.0.0.M1:compile
org.glassfish.web:jsp-impl:jar:2.2:compile
javax.servlet.jsp:jsp-api:jar:2.2:compile
javax.servlet.jsp.jstl:jstl-api:jar:1.2:compile
javax.servlet:servlet-api:jar:2.5:compile
org.glassfish.web:jstl-impl:jar:1.2:compile
javax.el:el-api:jar:2.2:compile
org.glassfish.web:el-impl:jar:2.2:compile
org.eclipse.jetty:jetty-annotations:jar:8.0.0.M1:compile
org.apache.geronimo.specs:geronimo-annotation_1.0_spec:jar:1.1.1:compile
asm:asm-commons:jar:3.1:compile
asm:asm-tree:jar:3.1:compile
asm:asm:jar:3.1:compile
org.eclipse.jetty:jetty-start:jar:8.0.0.M1:compile
org.eclipse.jetty:jetty-websocket:jar:8.0.0.M1:compile
org.eclipse.jetty:jetty-server:jar:8.0.0.M1:compile
org.mortbay.jetty:servlet-api:jar:3.0.20100224:compile
org.eclipse.jetty:jetty-continuation:jar:8.0.0.M1:compile
org.eclipse.jetty:jetty-http:jar:8.0.0.M1:compile
org.eclipse.jetty:jetty-io:jar:8.0.0.M1:compile
i.e. javax.servlet:servlet-api:jar:2.5 and org.mortbay.jetty:servlet-api:jar:3.0.20100224. The 2.5 version needs to be excluded or the plugin fails depending on the exact class path order.
Thanks for that report. Strange it wasn't failing in testing, however it might be a different version of maven orders the jars differently. In any case the servlet-api transitive dep has been excluded from the jstl jars.