spring-cloud-bus
spring-cloud-bus copied to clipboard
Correct the classpath of your application so that it contains a single, compatible version of org.springframework.integration.amqp.inbound.AmqpInboundChannelAdapter
springboot version:2.5.3 <spring-cloud.version>2020.0.3</spring-cloud.version>
when i use these version to run a demo project,and only use two dependency:
- spring-cloud-starter-netflix-eureka-client
- spring-cloud-starter-bus-amqp
when i run the project,it show the error below(my rabbitmq is ok):
2021-09-06 14:39:01.316 INFO 13968 --- [ main] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: [localhost:5672]
2021-09-06 14:39:01.383 INFO 13968 --- [ main] o.s.a.r.c.CachingConnectionFactory : Created new connection: rabbitConnectionFactory#2b680207:0/SimpleConnection@69feb4d9 [delegate=amqp://[email protected]:5672/, localPort= 52415]
2021-09-06 14:39:01.476 WARN 13968 --- [ main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'inputBindingLifecycle'; nested exception is java.lang.NoSuchMethodError: org.springframework.integration.amqp.inbound.AmqpInboundChannelAdapter.
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2021-09-06 14:39:04.586 ERROR 13968 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
APPLICATION FAILED TO START
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
org.springframework.cloud.stream.binder.rabbit.RabbitMessageChannelBinder.createConsumerEndpoint(RabbitMessageChannelBinder.java:517)
The following method did not exist:
org.springframework.integration.amqp.inbound.AmqpInboundChannelAdapter.<init>(Lorg/springframework/amqp/rabbit/listener/AbstractMessageListenerContainer;)V
The method's class, org.springframework.integration.amqp.inbound.AmqpInboundChannelAdapter, is available from the following locations:
jar:file:/C:/Users/xinxin/.m2/repository/org/springframework/integration/spring-integration-amqp/5.5.2/spring-integration-amqp-5.5.2.jar!/org/springframework/integration/amqp/inbound/AmqpInboundChannelAdapter.class
The class hierarchy was loaded from the following locations:
org.springframework.integration.amqp.inbound.AmqpInboundChannelAdapter: file:/C:/Users/xinxin/.m2/repository/org/springframework/integration/spring-integration-amqp/5.5.2/spring-integration-amqp-5.5.2.jar
org.springframework.integration.endpoint.MessageProducerSupport: file:/C:/Users/xinxin/.m2/repository/org/springframework/integration/spring-integration-core/5.5.2/spring-integration-core-5.5.2.jar
org.springframework.integration.endpoint.AbstractEndpoint: file:/C:/Users/xinxin/.m2/repository/org/springframework/integration/spring-integration-core/5.5.2/spring-integration-core-5.5.2.jar
org.springframework.integration.context.IntegrationObjectSupport: file:/C:/Users/xinxin/.m2/repository/org/springframework/integration/spring-integration-core/5.5.2/spring-integration-core-5.5.2.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.springframework.integration.amqp.inbound.AmqpInboundChannelAdapter
Disconnected from the target VM, address: '127.0.0.1:52404', transport: 'socket'
Process finished with exit code 1
i try to google something to rosole it,but i can not get useful anwser. i try to updowm the springboot version to 2.4.10, my project can run normally.
So, i think some bug with the 2.5.3 verson, or i dont know some config to user the bus, can someone give me some advise, thanks