2019-04-11 | Hystrix | UNLOCK

微服务项目 集成hystrix 实现熔断降级出现“循环依赖”

框架版本

SpringBoot 2.0.1.RELEASE
spring-cloud-starter-netflix-hystrix 2.0.0.RELEASE
spring-boot-starter-actuator 2.0.1.RELEASE

出现如下 循环依赖问题,查了一些资料,可能是springboot 本身的Bug,解决方案最后给出

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-04-10 23:00:48.818 ERROR 16952 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :

***************************
APPLICATION FAILED TO START
***************************

Description:

The dependencies of some of the beans in the application context form a cycle:

servletEndpointRegistrar defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration.class]

healthEndpoint defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]

org.springframework.boot.actuate.autoconfigure.jdbc.DataSourceHealthIndicatorAutoConfiguration
┌─────┐
| dataSource
↑ ↓
| scopedTarget.dataSource defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]
↑ ↓
| org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker
└─────┘



Process finished with exit code 1

配置文件加入

1
2
3
4
spring:
cloud:
refresh:
refreshable: none

参考:
1.https://www.oschina.net/question/3647019_2284247
2.https://blog.csdn.net/huangguojun00/article/details/81583993

评论加载中