开发者

jetty-maven-plugin does not work with Maven 3

When I try to run my project with Maven 3 instead of Maven 2.1, I get an exception from the jetty-maven-plugin. Everything is fine with Maven 2.1.

The config looks like this:

<plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <version>8.0.0.M1</version>
        <configuration>
          <scanIntervalSeconds>1</scanIntervalSeconds>
          <stopPort>9966</stopPort>
          <stopKey>foo</stopKey>
        </configuration>
      </plugin>

and the exception like this:

2010-11-11 12:53:01.217:WARN::FAILED guiceFilter: java.lang.NoSuchMethodError: j
avax.servlet.ServletContext.createFilter(Ljava/lang/Class;)Ljavax/servlet/Filter
;
2010-11-11 12:53:01.219:WARN::FAILED JettyWebAppContext@58d51a54@58d51a54/,file:
/C:/path/to/webapp/,file:
/C:/path/to/webapp/: java
.lang.NoSuchMethodError: javax.servlet.ServletContext.createFilter(Ljava/lang/Cl
ass;)Ljavax/servlet/Filter;
2010-11-11 12:53:01.223:WARN::FAILED ContextHandlerCollection@77c118ae: java.lan
g.NoSuchMethodError: javax.servlet.ServletContext.createFilter(Ljava/lang/Class;
)Ljavax/servlet/Filter;
2010-11-11 12:53:01.224:WARN::FAILED HandlerCollection@263b84ee: java.lang.NoSuc
hMethodError: javax.servlet.ServletContext.createFilter(Ljava/lang/Class;)Ljavax
/servlet/Filter;
2010-11-11 12:53:01.226:WARN::Error starting handlers
java.lang.NoSuchMethodError: javax.servlet.ServletContext.createFilter(Ljava/lan
g/Class;)Ljavax/servlet/Filter;
        at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:94)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:55)
        at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.ja
va:698)
        at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletC
ontextHandler.java:279)
        at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.jav
a:999)
        at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandle
r.java:610)
        at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContex
tHandler.java:155)
        at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:384
)
        at org.mortbay.jetty.plugin.JettyWebAppContext.doStart(JettyWebAppContex
t.java:127)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:55)
        at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCol
lection.java:165)
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(Con
textHandlerCollection.java:162)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:55)
        at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCol
lection.java:165)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:55)
        at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrappe
r.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(AbstractLife
Cycle.java:55)
        at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMo
jo.java:437)
        at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.
java:377)
        at org.mortbay.jetty.plugin.JettyRunMojo.execute(JettyRunMojo.java:546)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:107)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:195)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:148)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:140)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:314)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:151)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:445)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:168)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:132)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Delegat开发者_Go百科ingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)

How can I execute the jetty-maven-plugin with Maven 3?


This might be the same problem as in JETTY-1257. Try with the version 8.0.0.M2 of the plugin.


Looks suspiciously like a dependency issue with servlet-api.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜