gpt4 book ai didi

spring - junit 测试因 NoSuchMethodError BridgeMethodResolver.isVisibilityBridgeMethodPair 而失败

转载 作者:行者123 更新时间:2023-12-02 02:15:54 25 4
gpt4 key购买 nike

我升级了我的 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com