question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

compile error in resilience4j-cloud2-1.4.0-release (incompatible version of io.github.resilience4j.circuitbreaker.CircuitBreakerRegistry)

See original GitHub issue

Resilience4j version: resilience4j-cloud2-1.4.0-release

Java version: 1.8

Problem description: after adding compile "io.github.resilience4j:resilience4j-spring-cloud2:1.4.0-SNAPSHOT" in gradle project, there is a compile error in CircuitBreakerConfiguration.java. image I just follow the instruction in spring-cloud / Getting Started.

it is the output when spring boot application started.


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:

io.github.resilience4j.circuitbreaker.configure.CircuitBreakerConfiguration.createCircuitBreakerRegistry(CircuitBreakerConfiguration.java:141)

The following method did not exist:

io.github.resilience4j.circuitbreaker.CircuitBreakerRegistry.of(Ljava/util/Map;Lio/github/resilience4j/core/registry/RegistryEventConsumer;Lio/vavr/collection/Map;)Lio/github/resilience4j/circuitbreaker/CircuitBreakerRegistry;

The method’s class, io.github.resilience4j.circuitbreaker.CircuitBreakerRegistry, is available from the following locations:

jar:file:/Users/Tsing/.gradle/caches/modules-2/files-2.1/io.github.resilience4j/resilience4j-circuitbreaker/1.1.0/d80782b928298b4c0c174af3fe659a4c01ba7533/resilience4j-circuitbreaker-1.1.0.jar!/io/github/resilience4j/circuitbreaker/CircuitBreakerRegistry.class

It was loaded from the following location:

file:/Users/Tsing/.gradle/caches/modules-2/files-2.1/io.github.resilience4j/resilience4j-circuitbreaker/1.1.0/d80782b928298b4c0c174af3fe659a4c01ba7533/resilience4j-circuitbreaker-1.1.0.jar

Action:

Correct the classpath of your application so that it contains a single, compatible version of io.github.resilience4j.circuitbreaker.CircuitBreakerRegistry

gradle file:

ext { set(‘springCloudVersion’, “Hoxton.RELEASE”) } dependencyManagement { imports { mavenBom “org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}” } } dependencies { implementation ‘org.springframework.boot:spring-boot-starter’ compile ‘io.micrometer:micrometer-registry-prometheus:latest.release’ implementation ‘io.github.resilience4j:resilience4j-micrometer’ implementation ‘org.springframework.boot:spring-boot-starter-actuator’ implementation ‘org.springframework.boot:spring-boot-starter-web’ implementation ‘org.springframework.boot:spring-boot-starter-aop’ implementation ‘org.springframework.cloud:spring-cloud-starter-netflix-eureka-client’ compile “io.github.resilience4j:resilience4j-spring-cloud2:1.4.0-SNAPSHOT” compile(‘org.springframework.cloud:spring-cloud-starter-zookeeper-config’) { exclude group: ‘org.apache.zookeeper’, module: ‘zookeeper’ } compile(‘org.apache.zookeeper:zookeeper:3.4.12’) { exclude group: ‘org.slf4j’, module: ‘slf4j-log4j12’ } testImplementation(‘org.springframework.boot:spring-boot-starter-test’) { exclude group: ‘org.junit.vintage’, module: ‘junit-vintage-engine’ } }

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

9reactions
mrafayaleemcommented, Apr 6, 2020

You can override it like this to fix this issue if you can’t figure what dependency is including the older version of resiliency4j. resilience4j-spring-boot2 would include the other dependencies but we still need to override it here to circumvent the issue.

   <!--Spring resilience4j dependency-->
    <dependency>
      <groupId>io.github.resilience4j</groupId>
      <artifactId>resilience4j-spring-boot2</artifactId>
      <version>1.3.1</version>
    </dependency>

    <dependency>
      <groupId>io.github.resilience4j</groupId>
      <artifactId>resilience4j-circuitbreaker</artifactId>
      <version>1.3.1</version>
    </dependency>

    <dependency>
      <groupId>io.github.resilience4j</groupId>
      <artifactId>resilience4j-timelimiter</artifactId>
      <version>1.3.1</version>
    </dependency>
0reactions
imashwanicommented, Mar 25, 2020

can you please send the correct build.gradle file; what dependencied to exclude, i couldnot figureout.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting compatible version issue when running spring boot ...
The resilience4j-spring-boot2 seemed to be defined by another transitive dependency. If you printout the whole tree you can see which one is ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found