SpringBoot的bean循环引用错误

阅读量: 56 编辑

SpringBoot的bean循环引用错误

SpringBoot默认禁止bean循环依赖

Spring Boot 2.6.0 is officially released: circular dependencies are prohibited by default, and Docker image construction is enhanced

给出的提示

当然也给出了解决办法

在application.yml文件中加上下面代码即可

spring:
  ## 加上即可
  main:
    allow-circular-references: true