Coder Social home page Coder Social logo

Caused by: java.lang.IllegalArgumentException: Could not find class [org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration] about resilience4j-spring-boot2-demo HOT 11 CLOSED

resilience4j avatar resilience4j commented on May 18, 2024
Caused by: java.lang.IllegalArgumentException: Could not find class [org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration]

from resilience4j-spring-boot2-demo.

Comments (11)

RobWin avatar RobWin commented on May 18, 2024 4

Spring Boot 2.4.x requires resilience4j 1.7.0

Did you add spring actuator?

compile('org.springframework.boot:spring-boot-starter-actuator')

from resilience4j-spring-boot2-demo.

RobWin avatar RobWin commented on May 18, 2024 1

Did you try the answer from https://stackoverflow.com/questions/27934418/how-to-exclude-transitive-dependencies-of-spring-boot-dependencies-from-maven-im

from resilience4j-spring-boot2-demo.

HabeebCycle avatar HabeebCycle commented on May 18, 2024 1

Thanks, @RobWin and @Romeh

I solved the issue by updating my spring-cloud-dpendencies version to 2020.0.2 which has the circuitbreaker-resilience4j version of 1.7.0

Note: 2020.0.2 was released on Mar 18, 2021

from resilience4j-spring-boot2-demo.

Romeh avatar Romeh commented on May 18, 2024

do ur health enabled for target resilience4j type for example:

management.health.circuitbreakers.enabled: true

example here : https://github.com/resilience4j/resilience4j-spring-boot2-demo/blob/master/src/main/resources/application.yml#L12

from resilience4j-spring-boot2-demo.

HabeebCycle avatar HabeebCycle commented on May 18, 2024

Hi @RobWin

It raises other issues

Error processing condition on io.github.resilience4j.retry.autoconfigure.AbstractRetryConfigurationOnMissingBean.retryRegistry

Failed to introspect Class [io.github.resilience4j.retry.autoconfigure.AbstractRetryConfigurationOnMissingBean] from ClassLoader [jdk.internal.loader.ClassLoaders$AppClassLoader@9e89d68]

Caused by: java.lang.NoClassDefFoundError: io/github/resilience4j/core/ContextAwareScheduledThreadPoolExecutor

Caused by: java.lang.ClassNotFoundException: io.github.resilience4j.core.ContextAwareScheduledThreadPoolExecutor

from resilience4j-spring-boot2-demo.

Romeh avatar Romeh commented on May 18, 2024

check resilienc4j dependencies version in ur project and make sure it is all 1.7 and no transitive dependencies that has conflicting versions

from resilience4j-spring-boot2-demo.

HabeebCycle avatar HabeebCycle commented on May 18, 2024

Thanks @Romeh

If you could check my POM file for any conflicts

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.4.1</version>
		<relativePath/> <!-- lookup parent from repository -->
	</parent>
	<groupId>com.habeebcycle.microservice.composite</groupId>
	<artifactId>directive-composite-service</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<name>directive-composite-service</name>
	<description>Directive Composite Service</description>

	<properties>
		<java.version>11</java.version>
		<spring-cloud.version>2020.0.0</spring-cloud.version>
		<swagger.version>3.0.0</swagger.version>
		<resilience4j.version>1.7.0</resilience4j.version>
		<api.version>0.0.1-SNAPSHOT</api.version>
		<util.version>0.0.1-SNAPSHOT</util.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-actuator</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-webflux</artifactId>
		</dependency>

		<dependency>
			<groupId>io.springfox</groupId>
			<artifactId>springfox-boot-starter</artifactId>
			<version>${swagger.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>io.projectreactor</groupId>
			<artifactId>reactor-test</artifactId>
			<scope>test</scope>
		</dependency>

		<!-- Resource server Security -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-security</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-oauth2-resource-server</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-oauth2-jose</artifactId>
		</dependency>

		<!-- Cloud Streaming Dependencies -->
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-stream-kafka</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-stream-test-support</artifactId>
			<scope>test</scope>
		</dependency>

		<!-- Cloud services -->
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-config</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.retry</groupId>
			<artifactId>spring-retry</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-bootstrap</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-aop</artifactId>
		</dependency>

		<!-- Resilient API dependencies -->
		<dependency>
			<groupId>io.github.resilience4j</groupId>
			<artifactId>resilience4j-spring-boot2</artifactId>
			<version>${resilience4j.version}</version>
		</dependency>
		<dependency>
			<groupId>io.github.resilience4j</groupId>
			<artifactId>resilience4j-reactor</artifactId>
			<version>${resilience4j.version}</version>
		</dependency>

		<!-- Application Libraries -->
		<dependency>
			<groupId>com.habeebcycle.microservice.library</groupId>
			<artifactId>api</artifactId>
			<version>${api.version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>com.habeebcycle.microservice.library</groupId>
			<artifactId>util</artifactId>
			<version>${util.version}</version>
			<scope>compile</scope>
		</dependency>

	</dependencies>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.springframework.cloud</groupId>
				<artifactId>spring-cloud-dependencies</artifactId>
				<version>${spring-cloud.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<finalName>directive-composite-service</finalName>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>

</project>


from resilience4j-spring-boot2-demo.

Romeh avatar Romeh commented on May 18, 2024

https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-circuitbreaker-resilience4j/2.0.0 it has 1.6.1 not latest so there is older transitive dependency from spring cloud used version

from resilience4j-spring-boot2-demo.

HabeebCycle avatar HabeebCycle commented on May 18, 2024

Still can't get it to work after the exclusion of the transitive dependency from the spring cloud. Even the latest cloud version Hoxton.SR10 used 2.0.0 (the same 1.6.1)

<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.springframework.cloud</groupId>
				<artifactId>spring-cloud-dependencies</artifactId>
				<version>${spring-cloud.version}</version>
				<type>pom</type>
				<scope>import</scope>
				<exclusions>
					<exclusion>
						<groupId>org.springframework.cloud</groupId>
						<artifactId>spring-cloud-starter-circuitbreaker-resilience4j</artifactId>
					</exclusion>
				</exclusions>
			</dependency>
		</dependencies>
	</dependencyManagement>

still getting

java.lang.IllegalStateException: Error processing condition on io.github.resilience4j.retry.autoconfigure.AbstractRetryConfigurationOnMissingBean.retryRegistry

java.lang.NoClassDefFoundError: io/github/resilience4j/core/ContextAwareScheduledThreadPoolExecutor

java.lang.IllegalStateException: Failed to introspect Class [io.github.resilience4j.retry.autoconfigure.AbstractRetryConfigurationOnMissingBean]

from resilience4j-spring-boot2-demo.

HabeebCycle avatar HabeebCycle commented on May 18, 2024

@RobWin @Romeh

Any suggestions on this issue?
Thanks

from resilience4j-spring-boot2-demo.

krishnasheth17 avatar krishnasheth17 commented on May 18, 2024

Does spring boot 2.7.7 support Hystrix.

I have spring-cloud-starter-hysrtrix - 1.1.5.RELEASE.
I am getting the same error with the above dependencies

from resilience4j-spring-boot2-demo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.