Spring-cloud-netflix: Application failed to start when I use netflix-eureka-client and HikariCP

Created on 26 Apr 2018  ยท  4Comments  ยท  Source: spring-cloud/spring-cloud-netflix

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.

All 4 comments

This is a duplicate. I'll find the issue number later. Thanks for the sample.

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.

Was this page helpful?
0 / 5 - 0 ratings