It just appear when i use spring-boot-starter-actuator and spring-boot-starter-data-jpa together.

***************************
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
β””β”€β”€β”€β”€β”€β”˜

Comment From: philwebb

@chinfeng I'm not seeing the same error when I add actuator to our JPA sample. Can you please share a zip file or github repo with a project that shows the problem?

Comment From: wilkinsona

I think this is a duplicate of #13042. It’s triggered by Spring Cloud where a workaround has also now been implemented.

Comment From: chinfeng

Thanks @wilkinsona . The problem gone when I remove @EnableDiscoveryClient from application class.

Comment From: wenfei3

hi ,I met the same problem.

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.1.RELEASE</version>
</parent>

If I modify the spring boot version 2.0.1 to 2.0.2, it will be gone.

Comment From: samo-esure

I'm able to work around this issue by specifying management.server.port different than the server.port

Comment From: sunqb

mark。i fixed my project with this way

Comment From: flowmaster

That's rt @wenfei3 , post update to 2.0.2.RELEASE version of spring boot parent , it works fine .

Comment From: JerrinThomas

hi ,I met the same problem.

<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.1.RELEASE</version> </parent>

If I modify the spring boot version 2.0.1 to 2.0.2, it will be gone.

This one worked :)

Comment From: yangmingsen

That's rt @wenfei3 , post update to 2.0.2.RELEASE version of spring boot parent , it works fine .

This is a good suggestion. Thank you.

Comment From: osys

hi ,I met the same problem.

<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.1.RELEASE</version> </parent>

If I modify the spring boot version 2.0.1 to 2.0.2, it will be gone.

I have changed the Spring boot version to 2.0.2, but this situation still occurs. I don't know what the situation is.

Comment From: wilkinsona

@LeeYiua This issue was originally tracking a problem that was then fixed in Spring Cloud. I suspect that those whose problem was solved by upgrading to Spring Boot 2.0.2 from 2.0.1 had a different problem as no change was made in Spring Boot as a result of this issue. Also, please not that Spring Boot 2.0.x is no longer supported. I would recommend upgrading to Spring Boot 2.3.x.