作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我升级了我的 Maven 项目以使用 Spring 3.0.7(从 3.0.5 开始)。现在,我所有使用
的 junit 测试@RunWith(SpringJUnit4ClassRunner.class)
注解失败(下面有异常(exception)),但只有在从 Eclipse 中运行时才会失败。我正在运行“Eclipse Indigo Service Release 2”。当我从 Linux 控制台运行时,一切都通过了。
以前有人遇到过这个吗?
java.lang.NoSuchMethodError: org.springframework.core.BridgeMethodResolver.isVisibilityBridgeMethodPair(Ljava/lang/reflect/Method;Ljava/lang/reflect/Method;)Z
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.buildAutowiringMetadata(AutowiredAnnotationBeanPostProcessor.java:346)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.findAutowiringMetadata(AutowiredAnnotationBeanPostProcessor.java:317)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessMergedBeanDefinition(AutowiredAnnotationBeanPostProcessor.java:216)
at
etc & so forth...
最佳答案
已解决 - 归结为类路径中同时包含 3.0.5 和 3.0.7 JAR。我从这个问题中得到了线索:Error loading Jar file with Tomcat 7, Spring 3 and Camel 2.9.1
尽管 Eclipse 报告所有 spring jar 文件都是 3.0.7,但我发现它卡在对旧 jar (3.0.5) 的引用上。我通过从我的 Maven 存储库中删除所有现有的 spring 文件并重建来找到它。然后我开始收到有关丢失 $M2_REPO/com/spring...../3.0.5 jar 文件的明确消息。
关于spring - junit 测试因 NoSuchMethodError BridgeMethodResolver.isVisibilityBridgeMethodPair 而失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10683672/
我升级了我的 Maven 项目以使用 Spring 3.0.7(从 3.0.5 开始)。现在,我所有使用 的 junit 测试 @RunWith(SpringJUnit4ClassRunner.cla
我是一名优秀的程序员,十分优秀!