【问题标题】: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

【讨论】:

  • 为我节省了几个小时,谢谢
猜你喜欢
  • 1970-01-01
  • 2018-10-31
  • 2015-02-26
  • 2022-01-14
  • 2022-01-23
  • 2017-11-24
  • 2017-04-27
  • 2016-09-28
  • 2011-10-28
相关资源
最近更新 更多