springboot2.0.1 后內存數據庫與actuator不能同時使用
springboot2.0.1 后內存數據庫H2與actuator不能同時使用
報datasource循環依賴,可有遇到的幫忙看下是啥問題,怎么解決,只要把兩個包放進maven啟動就報錯
he 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
└─────┘
解決方法:
升級springboot到2.0.4,這應該是個bug,springcloud官方修復了

浙公網安備 33010602011771號