【问题标题】:Spring boot application fails to start after upgrading to 2.6.0 due to circular dependency[ unresolvable circular reference] [closed]由于循环依赖[无法解析的循环引用] [关闭],升级到 2.6.0 后 Spring Boot 应用程序无法启动
【发布时间】:2021-12-30 08:23:33
【问题描述】:
Spring boot 升级错误
Spring boot应用升级到2.6.0后由于循环依赖无法启动
Error creating bean with name 'securityConfig':
Requested bean is currently in creation: Is there an
unresolvable circular reference?
【问题讨论】:
标签:
java
spring-boot
java-17
【解决方案1】:
Circular References Prohibited by Default 在 Spring Boot 2.6 版中
如果您的应用程序由于 BeanCurrentlyInCreationException 而无法启动,强烈建议您更新配置以中断依赖循环。
临时解决办法是恢复2.5的行为,在.properties/yml中设置如下,
spring:
main:
allow-circular-references: true