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?
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.