10

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?
4

1 回答 1

20

Circular References Prohibited by Default在 Spring Boot 2.6 版中

如果您的应用程序由于 BeanCurrentlyInCreationException 而无法启动,强烈建议您更新配置以中断依赖循环。

临时解决方案是恢复 2.5 的行为,在 中设置以下内容.properties/yml

spring: 
  main:
    allow-circular-references: true
于 2021-11-19T15:05:37.607 回答