Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring boot application fails to start after upgrading to 2.6.0 due to circular dependency[ unresolvable circular reference]

Spring boot upgrade Error

Spring boot application fails to start after upgrading to 2.6.0 due to circular dependency

Error creating bean with name 'securityConfig': 
Requested bean is currently in creation: Is there an 
      unresolvable circular reference?
like image 288
Thirumal Avatar asked Sep 02 '25 16:09

Thirumal


1 Answers

Circular References Prohibited by Default in spring boot version 2.6

If your application fails to start due to a BeanCurrentlyInCreationException you are strongly encouraged to update your configuration to break the dependency cycle.

The temporary solution is to restore 2.5’s behavior, set the following in .properties/yml,

spring: 
  main:
    allow-circular-references: true

See this article for an in-depth description and some possible remedies.

like image 56
Thirumal Avatar answered Sep 05 '25 05:09

Thirumal