java.lang.NoSuchMethodError: org.springframework.aop.scope.ScopedProxyUtils.isScopedTarget

Spring整合AvtiveMQ时,用@Test测试报错

java.lang.NoSuchMethodError: org.springframework.aop.scope.ScopedProxyUtils.isScopedTarget(Ljava/lang/String;)Z

	at org.springframework.context.event.EventListenerMethodProcessor.afterSingletonsInstantiated(EventListenerMethodProcessor.java:77)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:776)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)

在这里插入图片描述
原因是我引入了activemq-all-5.10.0版本,这个版本的activemq-all自带很多组件,包括spring的很多组件

<include>org.springframework:spring-core</include>
<include>org.springframework:spring-beans</include>
<include>org.springframework:spring-context</include>
<include>org.springframework:spring-expression</include>
<include>org.springframework:spring-jms</include>
<include>org.springframework:spring-messaging</include>
<include>org.springframework:spring-tx</include>

而且他是直接将这些打入了自己的包中,不是通过依赖的方式,所以检查依赖没看出来错误
他自带的spring的包的版本是4.3.24.RELEASE

From: 'Spring IO' (https://projects.spring.io/spring-framework)
  - Spring AOP (https://github.com/spring-projects/spring-framework) org.springframework:spring-aop:jar:4.3.24.RELEASE
    License: Apache License, Version 2.0  (https://www.apache.org/licenses/LICENSE-2.0)
  - Spring Beans (https://github.com/spring-projects/spring-framework) org.springframework:spring-beans:jar:4.3.24.RELEASE
    License: Apache License, Version 2.0  (https://www.apache.org/licenses/LICENSE-2.0)
  - Spring Context (https://github.com/spring-projects/spring-framework) org.springframework:spring-context:jar:4.3.24.RELEASE
    License: Apache License, Version 2.0  (https://www.apache.org/licenses/LICENSE-2.0)
  - Spring Core (https://github.com/spring-projects/spring-framework) org.springframework:spring-core:jar:4.3.24.RELEASE
    License: Apache License, Version 2.0  (https://www.apache.org/licenses/LICENSE-2.0)
  - Spring Expression Language (SpEL) (https://github.com/spring-projects/spring-framework) org.springframework:spring-expression:jar:4.3.24.RELEASE
    License: Apache License, Version 2.0  (https://www.apache.org/licenses/LICENSE-2.0)
  - Spring JMS (https://github.com/spring-projects/spring-framework) org.springframework:spring-jms:jar:4.3.24.RELEASE
    License: Apache License, Version 2.0  (https://www.apache.org/licenses/LICENSE-2.0)
  - Spring Messaging (https://github.com/spring-projects/spring-framework) org.springframework:spring-messaging:jar:4.3.24.RELEASE
    License: Apache License, Version 2.0  (https://www.apache.org/licenses/LICENSE-2.0)
  - Spring Transaction (https://github.com/spring-projects/spring-framework) org.springframework:spring-tx:jar:4.3.24.RELEASE
    License: Apache License, Version 2.0  (https://www.apache.org/licenses/LICENSE-2.0)

而我在项目中引入的spring是4.1.3.RELEASE版本,报错信息中的org.springframework.aop是activemq-all下的包,spring-test版本低,所以报错。
感觉spring的版本应该自己来控制,我引入了低版本的activemq-all-5.10.0依赖,这个里面没有spring组件
activemq-pool的依赖也改为5.10.0
然后运行就可以了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值