我有以下配置:
@EnableTurbineStream
@EnableDiscoveryClient
@SpringBootApplication
public class SquintTurbineServerApplication {
public static void main(final String... args) {
SpringApplication.run(SquintTurbineServerApplication.class, args);
}
}
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-reactor-netty</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-turbine-stream</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-binder-rabbit</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
当我尝试启动我的应用程序时,会抛出此错误:
引起:org.springframework.beans.BeanInstantiationException:无法实例化[org.springframework.boot.actuate.health.HealthIndicator]:工厂方法&#39; binderHealthIndicator&#39;抛出异常;嵌套异常是java.lang.NoClassDefFoundError:org / spr ingframework的/ boot /开动/健康/ RabbitHealthIndicator 在org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:186) 在org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597) ......还有40多个 引起:java.lang.NoClassDefFoundError:org / springframework / boot / actuate / health / RabbitHealthIndicator 在org.springframework.cloud.stream.binder.rabbit.config.RabbitServiceAutoConfiguration $ RabbitHealthIndicatorConfiguration.binderHealthIndicator(RabbitServiceAutoConfiguration.java:141) at org.springframework.cloud.stream.binder.rabbit.config.RabbitServiceAutoConfiguration $ RabbitHealthIndicatorConfiguration $$ EnhancerBySpringCGLIB $$ f894963c.CGLIB $ binderHealthIndicator $ 0() 在org.springframework.cloud.stream.binder.rabbit.config.RabbitServiceAutoConfiguration $ RabbitHealthIndicatorConfiguration $$ EnhancerBySpringCGLIB $$ f894963c $$ FastClassBySpringCGLIB $$ 2435cd8c.invoke() 在org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer $ BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:361) at org.springframework.cloud.stream.binder.rabbit.config.RabbitServiceAutoConfiguration $ RabbitHealthIndicatorConfiguration $$ EnhancerBySpringCGLIB $$ f894963c.binderHealthIndicator() at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) 在org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:155) ......还有41个
我试图禁用该属性:
management.health.rabbit.enabled = false
但错误仍在被抛出。我注意到涡轮流正在寻找&#34; org.springframework.boot.actuate.health.RabbitHealthIndicator&#34; 这个类,但是当搜索它时,这些类现在是在&#34; org.springframework.boot.actuate.amqp.RabbitHealthIndicator&#34; 中。有人能帮助我吗?
答案 0 :(得分:1)
M4的最新引导更新改变了执行器类,包并从Metrics中删除了一些类。
这仍然与Spring Cloud Stream不兼容。
由于这个原因,SCSt上2.0的快照会拉M2,在我们将它固定在master上之前它不会兼容。