2009-11-14 38 views
1

我跑mvn jetty:run-war时,遇到下列错误:码头 - 的NoSuchMethodError

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 clean install时,我没有收到任何错误。

有人吗?

+0

也许你没有使用相同版本的Spring框架。 – Geo 2009-11-14 17:45:41

+0

但是,如何在我的pom.xml文件中指定此依赖关系时如何获得两个不同版本的Spring框架?我的意思是......它适用于所有其他平台。 – Pap 2009-11-14 17:52:28

回答

0

某处存在兼容性不匹配。也许你的本地仓库包含一些jar的“陈旧”版本。我建议重新尝试一个新鲜和干净的本地存储库。

首先,制作备份副本:

mv ~/.m2/repository ~/.m2/repository.save 

然后,再次尝试。

0

我认为问题是与本地存储库。 我猜你的Maven的回购协议会像储存根/ .m2目录/库 旧罐子可能是问题

我想你已经写码头depandencies像下面

<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安装“是一个成功,然后运行码头。