运行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.ReflectionUtils.makeAccessible(Ljava/lang/reflect/Constructor;)V
...(不包括整个堆栈跟踪)
我知道代码没有任何问题,因为它在Windows和OSX中都工作得很好。现在我正在使用Ubuntu karmic koala,并通过apt-get安装了maven,有没有什么东西是我忘记在linux中配置来让它工作的呢?在执行mvn全新安装时,我没有得到任何错误。
有没有人?
发布于 2009-11-15 21:01:18
一定是某个地方的兼容性不匹配。也许您的本地存储库包含某个jar的“陈旧”版本。我建议重试一个新的干净的本地存储库。
首先,制作备份副本:
mv ~/.m2/repository ~/.m2/repository.save然后再试一次。
发布于 2013-05-01 23:11:33
我认为问题出在本地存储库。我猜您的maven代码库应该存储为root/.m2/repository旧jar可能是问题所在
我猜你已经像下面这样写过Jetty依赖
<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>检查"mvn install“是否成功,然后运行Jetty。
https://stackoverflow.com/questions/1734794
复制相似问题