Maven / Spring:AopNamespaceUtils NoSuchMethod错误

问题描述

|| 使用Maven在Windows下构建我的项目可以很好地工作,但是当我在Linux下构建它时,关于其中一个Spring库,我得到一个“ 0”。 我猜想这与跨平台的类加载器差异以及我的依赖项中的某个地方有关,我可能有两次相同的类,但是Windows正在加载一个,而Linux正在加载另一个? 有没有人遇到过这个问题,或者对我如何进一步调试此错误有任何建议?
nested exception is java.lang.NoSuchMethodError:             
org.springframework.aop.config.AopNamespaceUtils.registerautoproxyCreatorIfNecessary(Lorg/springframework/beans/factory/xml/ParserContext;Lorg/w3c/dom/Element;)V:
java.lang.NoSuchMethodError:     
org.springframework.aop.config.AopNamespaceUtils.registerautoproxyCreatorIfNecessary(Lorg/springframework/beans/factory/xml/ParserContext;Lorg/w3c/dom/Element;)V
 at org.springframework.transaction.config.AnnotationDrivenBeanDeFinitionParser$AopAutoproxyConf
堆栈跟踪粘贴 POM.xml粘贴     

解决方法

        您的spring依赖项有太多不同的版本:   org.springframework:spring-beans:jar:2.5.6:compile   org.springframework:spring-aop:jar:2.0.8:compile   org.springframework:spring-jms:jar:3.0.5.RELEASE:compile 使所有spring依赖项具有相同的版本(最好是3.0.5.RELEASE)