2

Resilience4j version: 1.1.0

Java version: 1.8

Spring boot : 2.2.0

I am trying to configure the Resilience4j with spring boot project but getting below class not found

org.springframework.boot.SpringApplication: Application run failed java.lang.IllegalArgumentException: Could not find class [org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration] at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:327)

Java Code as follows :

@RateLimiter(name ="service1",fallbackMethod = "rateLimiterfallback")
    @PostMapping(value = "${URL_AUTH}")
    public ResponseEntity<AuthRespDTO> fetchToken(@RequestParam("userId") String Id, @RequestParam("password") String pwd, HttpServletRequest httpRequest) { 
    }

application.yml as below

resilience4j.ratelimiter:
    instances:
    service1:
      limitForPeriod: 1
      limitRefreshPeriod: 100000
      timeoutDuration: 1000ms

I have below dependencies mentioned in POM.xml .

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

<dependency>
    <groupId>io.github.resilience4j</groupId>
    <artifactId>resilience4j-ratelimiter</artifactId>
    <version>1.1.0</version>
</dependency>

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-actuator</artifactId>
    <version>2.2.0.RELEASE</version>
</dependency>

Please help me in resolving the issue .

Sivanagaiah
  • 153
  • 3
  • 10
  • Please show your code – Sanil Khurana Nov 14 '19 at 07:15
  • Resilience4j is build against Spring Boot 2.1.4, 2.2.x contains breaking changes and will generally not work. You have to wait for 2.2 support or do the configuration yourself. Also please add your dependencies as code instead of an image. – M. Deinum Nov 14 '19 at 07:49
  • I am able to fix the issue , it was required spring-boot-starter-actuator and spring-boot-starter-aop to fix issue . – Sivanagaiah Nov 15 '19 at 12:00

1 Answers1

1

For fixing this issue you have to update the POM with the spring-boot-starter-actuator and spring-boot-starter-aop dependencies.

At present you have a dependency of spring-boot-actuator which should be updated to spring-boot-starter-actuator.

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-aop</artifactId>
    <version>2.3.0.RELEASE</version>
</dependency>

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
    <version>2.3.2.RELEASE</version>
</dependency>

Note : Release version of spring boot depends on your project.

Similar issue reference

TriS
  • 3,668
  • 3
  • 11
  • 25