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

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?


Solution 1:[1]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 centic