Issue with io.github.resilience4j version 1.7.2 (SpelResolverConfigurationOnMissingBean.spelResolver() method that does not exist)
Asked Answered
D

2

15

I'm using io.github.resilience4j. Everything is working fine with 1.6.1 version but when upgraded to 1.7.1 version my application is not running. Please find my code changes below.

My pom.xml dependencies

<dependency>
    <groupId>io.github.resilience4j</groupId>
    <artifactId>resilience4j-core</artifactId>
    <version>1.7.1</version>
</dependency>
<dependency>
    <groupId>io.github.resilience4j</groupId>
    <artifactId>resilience4j-spring-boot2</artifactId>
    <version>1.7.1</version>
</dependency>

Here is application.propertes changes

resilience4j.circuitbreaker.configs.default.registerHealthIndicator=true
resilience4j.circuitbreaker.configs.default.slidingWindowSize= 10
resilience4j.circuitbreaker.configs.default.minimumNumberOfCalls=5
resilience4j.circuitbreaker.configs.default.permittedNumberOfCallsInHalfOpenState= 3
resilience4j.circuitbreaker.configs.default.automaticTransitionFromOpenToHalfOpenEnabled=true
resilience4j.circuitbreaker.configs.default.waitDurationInOpenState=5s
resilience4j.circuitbreaker.configs.default.failureRateThreshold=50
resilience4j.circuitbreaker.configs.default.eventConsumerBufferSize=10
resilience4j.circuitbreaker.configs.shared.slidingWindowSize=100
resilience4j.circuitbreaker.configs.shared.permittedNumberOfCallsInHalfOpenState=30
resilience4j.circuitbreaker.configs.shared.waitDurationInOpenState=1s
resilience4j.circuitbreaker.configs.shared.failureRateThreshold=50
resilience4j.circuitbreaker.configs.shared.eventConsumerBufferSize=10
resilience4j.circuitbreaker.instances.profile.registerHealthIndicator=true
resilience4j.circuitbreaker.instances.profile.slidingWindowSize=10
resilience4j.circuitbreaker.instances.profile.minimumNumberOfCalls=10
resilience4j.circuitbreaker.instances.profile.permittedNumberOfCallsInHalfOpenState=3
resilience4j.circuitbreaker.instances.profile.waitDurationInOpenState=5s
resilience4j.circuitbreaker.instances.profile.failureRateThreshold=50
resilience4j.circuitbreaker.instances.profile.eventConsumerBufferSize=10

resilience4j.retry.configs.default.maxAttempts=3
resilience4j.retry.configs.default.waitDuration=100
resilience4j.retry.instances.profile.baseConfig=default

resilience4j.bulkhead.configs.default.maxConcurrentCalls=30
resilience4j.bulkhead.configs.instances.profile.maxWaitDuration=10ms
resilience4j.bulkhead.configs.instances.profile.maxConcurrentCalls=20

resilience4j.thread-pool-bulkhead.configs.default.maxThreadPoolSize=4
resilience4j.thread-pool-bulkhead.configs.default.coreThreadPoolSize=2
resilience4j.thread-pool-bulkhead.configs.default.queueCapacity=2
resilience4j.thread-pool-bulkhead.instances.profile.maxThreadPoolSize=1
resilience4j.thread-pool-bulkhead.instances.profile.coreThreadPoolSize=1
resilience4j.thread-pool-bulkhead.instances.profile.queueCapacity=1

resilience4j.ratelimiter.configs.default.registerHealthIndicator=false
resilience4j.ratelimiter.configs.default.limitForPeriod=10
resilience4j.ratelimiter.configs.default.limitRefreshPeriod=1s
resilience4j.ratelimiter.configs.default.timeoutDuration=0
resilience4j.ratelimiter.configs.default.eventConsumerBufferSize=100

resilience4j.timelimiter.configs.default.cancelRunningFuture=false
resilience4j.timelimiter.configs.default.timeoutDuration=2s
resilience4j.timelimiter.instances.profile.baseConfig=default

Here is controller API changes

private static final String PROFILE="profile";    


@GetMapping("/{programType}/profile")
@AdobeIOAuthentication
@RateLimiter(name = PROFILE)
@TimeLimiter(name = PROFILE)
@CircuitBreaker(name = PROFILE)
@Bulkhead(name = PROFILE)

Error I'm getting while getting building

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-08-11 14:37:21.503 IST ERROR requestId=NA x-correlation-id=NA 17200 --- [           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:

    io.github.resilience4j.spelresolver.autoconfigure.SpelResolverConfigurationOnMissingBean.spelResolver(SpelResolverConfigurationOnMissingBean.java:54)

The following method did not exist:

    'io.github.resilience4j.spelresolver.SpelResolver io.github.resilience4j.spelresolver.configure.SpelResolverConfiguration.spelResolver(org.springframework.expression.spel.standard.SpelExpressionParser, org.springframework.core.ParameterNameDiscoverer, org.springframework.beans.factory.BeanFactory)'

The method's class, io.github.resilience4j.spelresolver.configure.SpelResolverConfiguration, is available from the following locations:

    jar:file:/C:/Users/169576/.m2/repository/io/github/resilience4j/resilience4j-spring/1.6.0/resilience4j-spring-1.6.0.jar!/io/github/resilience4j/spelresolver/configure/SpelResolverConfiguration.class

The class hierarchy was loaded from the following locations:

    io.github.resilience4j.spelresolver.configure.SpelResolverConfiguration: file:/C:/Users/169576/.m2/repository/io/github/resilience4j/resilience4j-spring/1.6.0/resilience4j-spring-1.6.0.jar

Can some one please help me to fix this issue.

Donegal answered 11/8, 2021 at 12:24 Comment(3)
You are mixing jars from different versions... resilience4j-spring-1.6.0.jar is not really 1.7.Sirajuddaula
Can you please explain where I did the mistake?Donegal
No as I don't know which depndencies you use. But you only upgraded part of the dependencies.Sirajuddaula
W
24

Try version 1.7.0

<dependency>
    <groupId>io.github.resilience4j</groupId>
    <artifactId>resilience4j-core</artifactId>
    <version>1.7.0</version>
</dependency>
<dependency>
    <groupId>io.github.resilience4j</groupId>
    <artifactId>resilience4j-spring-boot2</artifactId>
    <version>1.7.0</version>
</dependency>
Wehrle answered 9/10, 2021 at 10:24 Comment(6)
resilience4j-spring-boot2 contains resilience4j-core but downgrade to version 1.7.0 helps, I assume Spring boot version is missing something I have 2.5.6Wrestle
I had the same problem with 1.7.1 and downgrading to 1.7.0 worked for me as well. Spring boot 2.6.1 here.Breather
I got the same issue when setting 1.7.1 version explicitly with Spring Boot 2.6.3. Downgrading to 1.7.0 fixed it. FWIW: when using Gradle, I also noticed this issue doesn't happen if we skip the version and leave the dependency configuration to the plugin: implementation 'io.github.resilience4j:resilience4j-spring-boot2'Grannie
Same version 1.7.0 works with the Spring-Boot version 2.6.6Capillaceous
Same with Spring Boot 2.7.11: downgrading from 1.7.1 to 1.7.0 worked. BUT WHY?Nectareous
How to know what version are compatible with what versions of spring boot ?Afghani
S
0

I have encountered this issue. I update also to version 1.7.0 but it not works. I saw that the log information is show version to reference like that:

io.github.resilience4j.spelresolver.configure.SpelResolverConfiguration: file:/C:/Users/169576/.m2/repository/io/github/resilience4j/resilience4j-spring/1.6.0/resilience4j-spring-1.6.0.jar

We need only follow on log and update version to 1.6.0 means that same version in log

Schluter answered 25/10, 2022 at 14:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.