Skip to content

Error dependency cycle between beans when upgrade spring boot version from 3.4.3 to 3.4.4 #44988

Closed as duplicate
@kridtakom

Description

@kridtakom

I am currently upgrading the Spring Boot and Spring Cloud versions for my project as follows:

build.gradle file

plugins {
    id 'org.springframework.boot' version '3.4.4'
}

dependencyManagement {
    imports {
        mavenBom "org.springframework.cloud:spring-cloud-dependencies:2024.0.1"
    }
}

error log

***************************

APPLICATION FAILED TO START

***************************

� Description:

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

   citizenController defined in URL [jar:nested:/app/app.jar/!BOOT-INF/classes/!/com/company/project/abc/controller/CitizenController.class]

�

      ↓

   citizenServiceImpl defined in URL [jar:nested:/app/app.jar/!BOOT-INF/classes/!/com/company/project/abc/service/CitizenServiceImpl.class]

�

      ↓

   digitallendingDataSourceImpl defined in URL [jar:nested:/app/app.jar/!BOOT-INF/classes/!/com/company/project/abc/datasource/DigitallendingDataSourceImpl.class]

�

      ↓

   com.company.project.digitallendingclient.DigitallendingClient

┌─────┐

|  consulAutoServiceRegistrationListener defined in class path resource [org/springframework/cloud/consul/serviceregistry/ConsulAutoServiceRegistrationAutoConfiguration.class]

↑     ↓

|  consulAutoServiceRegistration defined in class path resource [org/springframework/cloud/consul/serviceregistry/ConsulAutoServiceRegistrationAutoConfiguration.class]

↑     ↓

|  consulServiceRegistry defined in class path resource [org/springframework/cloud/consul/serviceregistry/ConsulServiceRegistryAutoConfiguration.class]

↑     ↓

|  ttlScheduler defined in class path resource [org/springframework/cloud/consul/support/ConsulHeartbeatAutoConfiguration.class]

↑     ↓

|  actuatorHealthStatusProvider defined in class path resource [org/springframework/cloud/consul/support/ConsulHeartbeatAutoConfiguration$ActuatorBasedApplicationStatusProviderConfig.class]

↑     ↓

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

↑     ↓

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

↑     ↓

|  dbHealthContributor defined in class path resource [org/springframework/boot/actuate/autoconfigure/jdbc/DataSourceHealthContributorAutoConfiguration.class]

↑     ↓

|  documentDetailRepository defined in com.company.project.abc.repository.document.DocumentDetailRepository defined in @EnableRedisRepositories declared on RedisRepositoriesRegistrar.EnableRedisRepositoriesConfiguration

└─────┘

Action:

Relying upon circular references is discouraged and they are prohibited by default. Update your application to remove the dependency cycle between beans. As a last resort, it may be possible to break the cycle automatically by setting spring.main.allow-circular-references to true.

I downgraded Spring Boot to version 3.4.3 and Spring Cloud to version 2024.0.0, and everything is functioning well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: external-projectFor an external project and not something we can fixstatus: duplicateA duplicate of another issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions