Spring Cloud Bus with rabbit - Application Failed to Start

555 Views Asked by At

I'm triying to create a Config Server that listens to Git event and streams events to client. I followed several examples and also the documentation, but I cant manage to get application to start. I guess I have a problem with spring boot and cloud versions.

It is important to mention im running rabbitmq with docker.

This is my build.gradle

plugins {
    id 'org.springframework.boot' version '2.5.3'
    id 'io.spring.dependency-management' version '1.0.11.RELEASE'
    id 'java'
}

group = 'com.pal.pocs.config'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories {
    mavenCentral()
}

ext {
    set('springCloudVersion', "2020.0.3")
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-actuator'
    implementation 'org.springframework.cloud:spring-cloud-config-server'
    implementation 'org.springframework.cloud:spring-cloud-starter-bus-amqp'
    compileOnly 'org.projectlombok:lombok'
    annotationProcessor 'org.projectlombok:lombok'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

dependencyManagement {
    imports {
        mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
    }
}

test {
    useJUnitPlatform()
}

And this is the exception Im getting:

***************************
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/lambe/.gradle/caches/modules-2/files-2.1/org.springframework.integration/spring-integration-amqp/5.5.2/7195ed265b0f6c24e52c3ed84253f7974b2d5014/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/lambe/.gradle/caches/modules-2/files-2.1/org.springframework.integration/spring-integration-amqp/5.5.2/7195ed265b0f6c24e52c3ed84253f7974b2d5014/spring-integration-amqp-5.5.2.jar
    org.springframework.integration.endpoint.MessageProducerSupport: file:/C:/Users/lambe/.gradle/caches/modules-2/files-2.1/org.springframework.integration/spring-integration-core/5.5.2/d6822cb2d758d2a5d821879778c31120b4a3c86c/spring-integration-core-5.5.2.jar
    org.springframework.integration.endpoint.AbstractEndpoint: file:/C:/Users/lambe/.gradle/caches/modules-2/files-2.1/org.springframework.integration/spring-integration-core/5.5.2/d6822cb2d758d2a5d821879778c31120b4a3c86c/spring-integration-core-5.5.2.jar
    org.springframework.integration.context.IntegrationObjectSupport: file:/C:/Users/lambe/.gradle/caches/modules-2/files-2.1/org.springframework.integration/spring-integration-core/5.5.2/d6822cb2d758d2a5d821879778c31120b4a3c86c/spring-integration-core-5.5.2.jar
2

Action:

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

Does anyone has a clue about where is the missconfiguration?

1

There are 1 best solutions below

0
On BEST ANSWER

Well, I figured out

I turns out that Spring Cloud 2020.0.3 is supported by Spring Boot 2.4.6

So I downgraded to 2.4.6 and application started!

Hope it is helpfull for someone else