Maven 2 jetty-noSuchMethodError
我在运行mvn jetty时遇到以下错误:run war:Maven 2 jetty-noSuchMethodError,maven-2,jetty,nosuchmethoderror,Maven 2,Jetty,Nosuchmethoderror,我在运行mvn jetty时遇到以下错误:run war: 2009-11-14 15:19:28.459:/:INFO: Initializing Spring root WebApplicationContext * ERROR 15:19:28,491 Context initialization failed (ContextLoader.java [main]) java.lang.NoSuchMethodError: org.springframework.util.Reflect
2009-11-14 15:19:28.459:/:INFO: Initializing Spring root WebApplicationContext
* ERROR 15:19:28,491 Context initialization failed (ContextLoader.java [main])
java.lang.NoSuchMethodError: org.springframework.util.ReflectionUtils.makeAccessible(Ljava/lang/reflect/Constructor;)V
...
(不包括整个stacktrace)
我知道这段代码没有什么问题,因为它在Windows和OSX中都能很好地工作。现在我正在使用Ubuntu karmic koala,并通过apt get安装了maven,有没有什么我忘记在linux中配置的东西可以让它工作呢?在执行mvn清理安装时,我没有收到任何错误
有人吗 一定有不匹配的地方。也许您的本地存储库包含某个jar的“过时”版本。我建议使用一个新的、干净的本地存储库重试 首先,制作备份副本:
mv ~/.m2/repository ~/.m2/repository.save
然后,再试一次。我认为问题在于本地存储库。 我猜您的maven repo应该像root/.m2/存储库那样存储 旧罐子可能是个问题 我想你已经写了如下的Jetty depanders
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.version}</version>
<configuration>
<webAppSourceDirectory>WebContent</webAppSourceDirectory>
<!-- <classesDirectory>WebContent/WEB-INF/classes</classesDirectory> -->
<!-- Redeploy every 1 seconds if changes are detected, 0 for no automatic
redeployment -->
<scanIntervalSeconds>0</scanIntervalSeconds>
<!-- reload manually by hitting enter on console -->
<reload>manual</reload>
<webApp>
<contextPath>/</contextPath>
<descriptor>WebContent/WEB-INF/web.xml</descriptor>
</webApp>
<connectors>
<connector implementation="org.eclipse.jetty.server.bio.SocketConnector">
<port>8080</port>
<maxIdleTime>600000</maxIdleTime>
</connector>
</connectors>
</configuration>
</plugin>
org.mortbay.jetty
jetty maven插件
${jetty.version}
网络内容
0
手册
/
WebContent/WEB-INF/WEB.xml
8080
600000
检查“mvn安装”是否成功,然后运行Jetty。可能您没有使用相同版本的Spring framework。但是,如果在pom.xml文件中指定了此依赖项,我怎么能拥有两个不同版本的Spring framework?我是说。。它适用于所有其他平台。