0

我在 Spring Boot 版本 2.0.6 上运行了 Spring Boot 应用程序。我添加了resilience4j 以具有断路器功能,但应用程序抱怨CircuitBreakerConfigurationOnMissingBean。

Caused by: java.lang.IllegalStateException: Failed to introspect Class [io.github.resilience4j.circuitbreaker.autoconfigure.CircuitBreakerConfigurationOnMissingBean] from ClassLoader [jdk.internal.loader.ClassLoaders$AppClassLoader@1b9e1916

尝试添加所有必需的依赖项。POM 片段

       <dependency>
            <groupId>io.github.resilience4j</groupId>
            <artifactId>resilience4j-spring-boot2</artifactId>
            <version>0.17.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-web</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-aop</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-actuator</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.github.resilience4j</groupId>
            <artifactId>resilience4j-rxjava2</artifactId>
            <version>0.17.0</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
4

1 回答 1

0

您需要使用 Spring Boot 2.1.0 版本,因为CircuitBreakerConfigurationOnMissingBean它具有仅在 2.1.0 或更高版本中可用的依赖项。

于 2019-09-06T17:31:56.897 回答