1
votes

I am trying to configure my Spring Boot app as Admin Client, but it can not be build after setting the following dependency:

    <dependency>
        <groupId>de.codecentric</groupId>
        <artifactId>spring-boot-admin-starter-client</artifactId>
        <version>2.1.6</version>
    </dependency>

When trying to build the app after setting this dependency in pom.xml I get following error:

Description:

An attempt was made to call the method org.springframework.boot.web.client.RestTemplateBuilder.setConnectTimeout(Ljava/time/Duration;)Lorg/springframework/boot/web/client/RestTemplateBuilder; but it does not exist. Its class, org.springframework.boot.web.client.RestTemplateBuilder, is available from the following locations:

jar:file:/Users/sherzad/.m2/repository/org/springframework/boot/spring-boot/2.0.6.RELEASE/spring-boot-2.0.6.RELEASE.jar!/org/springframework/boot/web/client/RestTemplateBuilder.class

It was loaded from the following location:

file:/Users/sherzad/.m2/repository/org/springframework/boot/spring-boot/2.0.6.RELEASE/spring-boot-2.0.6.RELEASE.jar

Action:

Correct the classpath of your application so that it contains a single, compatible version of org.springframework.boot.web.client.RestTemplateBuilder

I don“t know why it has two same RestTemplateBuilder...

How to fix this issue?

1
please attached mvn dependency:tree result and also try with spring-boot-admin-starter-client - 2.0.6 version - Sarjit
What do you exactly mean? What should I do with this dependency:tree inside my project? - skm
output of mvn dependency:tree and can you please try with spring-boot-admin-starter-client - 2.0.6 version - Sarjit
Thanks! changed to version 2.0.6 - and it worked! - skm

1 Answers

0
votes

Could you please try with spring-boot-admin-starter-client - 2.0.6 version

hope it will work for you