1

プロジェクトを Maven 2.1 ではなく Maven 3 で実行しようとすると、jetty-maven-plugin から例外が発生します。Maven 2.1 ではすべて問題ありません。

構成は次のようになります。

<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>

そして、このような例外:

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(DelegatingMethodAcces
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)

Maven 3 で jetty-maven-plugin を実行するにはどうすればよいですか?

4

2 に答える 2

2

これは、 JETTY-1257と同じ問題である可能性があります。プラグインのバージョン8.0.0.M2で試してください。

于 2010-11-11T16:54:18.573 に答える
0

servlet-api の依存関係の問題のようです。

于 2010-11-11T13:26:22.450 に答える