I want to report a bug. When I creata a simple project with spring-boot-starter-web, spring-boot-starter-jdbc, spring-cloud-and starter-netflix-eureka-client, it failed to start with an error below.
***************************
APPLICATION FAILED TO START
***************************
Description:
The dependencies of some of the beans in the application context form a cycle:
org.springframework.boot.autoconfigure.jdbc.DataSourceJmxConfiguration$Hikari
โโโโโโโ
| scopedTarget.dataSource defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]
โ โ
| org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker
โโโโโโโ
Versions:
Spring Cloud: Finchley.RC1 or M7
Spring Boot: 2.0.0 or 2.0.1
Example codes:
https://github.com/cero-t/jdbc-example-bug
When I remove eureka-client from pom.xml, it works well. When I remove HikariCP from pom.xml, changing spring-boot-starter-jdbc to spring-jdbc, it works well, too. Then I suspect that the combination of eureka-client and HikariCP causes this error.
Thanks.
This is a duplicate. I'll find the issue number later. Thanks for the sample.
I believe this is the issue https://github.com/spring-cloud/spring-cloud-commons/issues/355
yup, I've started looking at this. He has a sample that is helpful.
Setting --spring.cloud.refresh.refreshable=none will work around the issue in the mean time.