Skip to content
Preptima
mediumScenarioConceptMidSenior

After a Spring Boot upgrade the app refuses to start with a circular reference between two services. Do you turn the check off?

Spring Boot has prohibited circular references by default since 2.6. Setting spring.main.allow-circular-references=true restores the old behaviour, defensible only as a dated stopgap. The fix is to break the cycle, usually by extracting what both services need, and to use constructor injection so new cycles fail fast.

5 min readUpdated 2026-10-09Target archetype: Enterprise Captive, Product Startup

Answer

Short answer

Not as the fix. Spring Boot has prohibited circular references by default since 2.6, and setting spring.main.allow-circular-references=true restores the old behaviour. That is acceptable as a dated stopgap to finish an upgrade. The fix is to break the cycle by extracting the responsibility both services reach for, and to use constructor injection so any new cycle fails the moment it is written.

Was this answer helpful?

Likely follow-ups

  • Why does a cycle through constructor injection fail even with circular references allowed?
  • The two services are in different teams' modules. Does that change how you break the cycle?
  • If you replace the call with an application event, which transaction does the listener run in?
  • How would you stop a new cycle being merged after this one is fixed?

Related questions