spring-cloud / spring-cloud-bus

Spring Cloud event bus
http://cloud.spring.io/spring-cloud-bus/
Apache License 2.0
408 stars 242 forks source link

Correct the classpath of your application so that it contains a single, compatible version of org.springframework.integration.amqp.inbound.AmqpInboundChannelAdapter #258

Open zhangxx0 opened 3 years ago

zhangxx0 commented 3 years ago

springboot version:2.5.3

2020.0.3 when i use these version to run a demo project,and only use two dependency: 1. spring-cloud-starter-netflix-eureka-client 2. 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://guest@127.0.0.1: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.(Lorg/springframework/amqp/rabbit/listener/AbstractMessageListenerContainer;)V 2021-09-06 14:39:01.477 INFO 13968 --- [ main] o.s.i.endpoint.EventDrivenConsumer : Removing {logging-channel-adapter:_org.springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel 2021-09-06 14:39:01.477 INFO 13968 --- [ main] o.s.i.channel.PublishSubscribeChannel : Channel 'application.errorChannel' has 0 subscriber(s). 2021-09-06 14:39:01.477 INFO 13968 --- [ main] o.s.i.endpoint.EventDrivenConsumer : stopped bean '_org.springframework.integration.errorLogger' 2021-09-06 14:39:01.520 INFO 13968 --- [ main] com.netflix.discovery.DiscoveryClient : Shutting down DiscoveryClient ... 2021-09-06 14:39:04.537 INFO 13968 --- [ main] com.netflix.discovery.DiscoveryClient : Unregistering ... 2021-09-06 14:39:04.553 INFO 13968 --- [ main] com.netflix.discovery.DiscoveryClient : DiscoveryClient_UNKNOWN/host.docker.internal - deregister status: 200 2021-09-06 14:39:04.559 INFO 13968 --- [ main] com.netflix.discovery.DiscoveryClient : Completed shut down of DiscoveryClient 2021-09-06 14:39:04.565 INFO 13968 --- [ main] ConditionEvaluationReportLoggingListener : 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.(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**