Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AutoConfigure cycle detected with Spring cloud #918

Open
elewis-weborama opened this issue May 5, 2023 · 0 comments
Open

AutoConfigure cycle detected with Spring cloud #918

elewis-weborama opened this issue May 5, 2023 · 0 comments
Labels

Comments

@elewis-weborama
Copy link

elewis-weborama commented May 5, 2023

When adding Zalando problem-spring-web dependency to a project using Spring boot 2.7 and Spring Cloud 3.1, an error occurs

Description

Consider the following dependencies:

  • spring-cloud-starter-bus-amqp 3.1.2
  • spring-boot-starter-actuator 2.7.11
  • spring-boot-starter-security 2.7.11
  • problem-spring-web-starter (Zalando) 0.27.0

If you run an app with these, the app will fail to start, and show the following error:
java.lang.IllegalStateException: AutoConfigure cycle detected between org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration and org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration

Expected Behavior

Spring Boot should start correctly.

Actual Behavior

Spring fails to start, and shows the following error:
java.lang.IllegalStateException: AutoConfigure cycle detected between org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration and org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration at org.springframework.util.Assert.state(Assert.java:97) ~[spring-core-5.3.27.jar:5.3.27] at org.springframework.boot.autoconfigure.AutoConfigurationSorter.checkForCycles(AutoConfigurationSorter.java:101) ~[spring-boot-autoconfigure-2.7.11.jar:2.7.11] at org.springframework.boot.autoconfigure.AutoConfigurationSorter.doSortByAfterAnnotation(AutoConfigurationSorter.java:91) ~[spring-boot-autoconfigure-2.7.11.jar:2.7.11] at org.springframework.boot.autoconfigure.AutoConfigurationSorter.doSortByAfterAnnotation(AutoConfigurationSorter.java:93) ~[spring-boot-autoconfigure-2.7.11.jar:2.7.11] at org.springframework.boot.autoconfigure.AutoConfigurationSorter.doSortByAfterAnnotation(AutoConfigurationSorter.java:93) ~[spring-boot-autoconfigure-2.7.11.jar:2.7.11] at org.springframework.boot.autoconfigure.AutoConfigurationSorter.doSortByAfterAnnotation(AutoConfigurationSorter.java:93) ~[spring-boot-autoconfigure-2.7.11.jar:2.7.11] at org.springframework.boot.autoconfigure.AutoConfigurationSorter.doSortByAfterAnnotation(AutoConfigurationSorter.java:93) ~[spring-boot-autoconfigure-2.7.11.jar:2.7.11] at org.springframework.boot.autoconfigure.AutoConfigurationSorter.doSortByAfterAnnotation(AutoConfigurationSorter.java:93) ~[spring-boot-autoconfigure-2.7.11.jar:2.7.11] at org.springframework.boot.autoconfigure.AutoConfigurationSorter.doSortByAfterAnnotation(AutoConfigurationSorter.java:93) ~[spring-boot-autoconfigure-2.7.11.jar:2.7.11] at org.springframework.boot.autoconfigure.AutoConfigurationSorter.doSortByAfterAnnotation(AutoConfigurationSorter.java:93) ~[spring-boot-autoconfigure-2.7.11.jar:2.7.11] at org.springframework.boot.autoconfigure.AutoConfigurationSorter.doSortByAfterAnnotation(AutoConfigurationSorter.java:93) ~[spring-boot-autoconfigure-2.7.11.jar:2.7.11] at org.springframework.boot.autoconfigure.AutoConfigurationSorter.doSortByAfterAnnotation(AutoConfigurationSorter.java:93) ~[spring-boot-autoconfigure-2.7.11.jar:2.7.11] at org.springframework.boot.autoconfigure.AutoConfigurationSorter.doSortByAfterAnnotation(AutoConfigurationSorter.java:93) ~[spring-boot-autoconfigure-2.7.11.jar:2.7.11] at org.springframework.boot.autoconfigure.AutoConfigurationSorter.sortByAnnotation(AutoConfigurationSorter.java:78) ~[spring-boot-autoconfigure-2.7.11.jar:2.7.11] at org.springframework.boot.autoconfigure.AutoConfigurationSorter.getInPriorityOrder(AutoConfigurationSorter.java:68) ~[spring-boot-autoconfigure-2.7.11.jar:2.7.11] at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector$AutoConfigurationGroup.sortAutoConfigurations(AutoConfigurationImportSelector.java:478) ~[spring-boot-autoconfigure-2.7.11.jar:2.7.11] at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector$AutoConfigurationGroup.selectImports(AutoConfigurationImportSelector.java:463) ~[spring-boot-autoconfigure-2.7.11.jar:2.7.11] at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGrouping.getImports(ConfigurationClassParser.java:882) ~[spring-context-5.3.27.jar:5.3.27] at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGroupingHandler.processGroupImports(ConfigurationClassParser.java:809) ~[spring-context-5.3.27.jar:5.3.27] at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorHandler.process(ConfigurationClassParser.java:780) ~[spring-context-5.3.27.jar:5.3.27] at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:192) ~[spring-context-5.3.27.jar:5.3.27] at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:331) ~[spring-context-5.3.27.jar:5.3.27] at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:247) ~[spring-context-5.3.27.jar:5.3.27] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:311) ~[spring-context-5.3.27.jar:5.3.27] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:112) ~[spring-context-5.3.27.jar:5.3.27] at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:748) ~[spring-context-5.3.27.jar:5.3.27] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564) ~[spring-context-5.3.27.jar:5.3.27] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731) ~[spring-boot-2.7.11.jar:2.7.11] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) ~[spring-boot-2.7.11.jar:2.7.11] at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-2.7.11.jar:2.7.11] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303) ~[spring-boot-2.7.11.jar:2.7.11] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292) ~[spring-boot-2.7.11.jar:2.7.11] at com.weborama.zalandospringcloudissue.Application.main(Application.java:10) ~[classes/:na]

Steps to Reproduce

Clone the following project: https://github.com/elewis-weborama/zalando-spring-cloud-issue
Launch the app and notice the error message.
Then remove the zalando dependency from the pom.xml and launch the app again. It should start successfully this time.

Your Environment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant