Relying upon circular references is discouraged and they are prohibited by default.
创始人
2024-11-15 18:38:13
0

Relying upon circular references is discouraged and they are prohibited by default.

创建springboot项目时,使用的版本是2.7.13,运行项目时报错

image-20230810125918536

Relying upon circular references is discouraged and they are prohibited by default. Update your application to remove the dependency cycle between beans. As a last resort, it may be possible to break the cycle automatically by setting spring.main.allow-circular-references to true.

直接翻译过来的话就是:

不鼓励依赖循环引用,并且默认情况下禁止循环引用。更新应用程序以删除bean之间的依赖循环。作为最后的手段,可以通过设置spring.main来自动打破这个循环。允许循环引用为true。

image-20230810125952840

解决方案

提示中已经把解决方案说了 setting spring.main.allow-circular-references to true.

在springboot2.6正式发布,循环依赖默认静止了。我们只需要开启就行

如果是 properties 配置文件

spring.main.allow-circular-references=true 

如果是 yml 配置文件

spring:   main:     allow-circular-references:true 

我这里是 yml配置,加上后重启就正常运行了

image-20230810130802562

相关内容

热门资讯

透视透视!wpk插件,(Wpk... 透视透视!wpk插件,(Wpk模拟器)官网下载链接(本来存在有挂);1、让任何用户在无需wpk插件A...
透视苹果版!wepoker辅助... 透视苹果版!wepoker辅助透视软件(WePoKer安装包)是有人用挂(竟然存在有挂);1、每一步...
透视脚本!aapoker透视插... 透视脚本!aapoker透视插件,aapoker脚本怎么用,2025新版教程(本来存在有挂)1、全新...
透视脚本!wepoker永久免... 透视脚本!wepoker永久免费脚本,(WEPOKER脚本)真是有挂(详细辅助软件);暗藏猫腻,小编...
透视黑科技!wpk真吗,(Wp... 透视黑科技!wpk真吗,(WpK真的有挂)作弊(一直是真的有挂)进入游戏-大厅左侧-新手福利-激活码...
透视黑科技"wepo... 透视黑科技"wepoker私人辅助器(底牌透视脚本)wepoker辅助器最新版本更新内容"好像有挂w...
透视脚本!aapoker怎么选... 透视脚本!aapoker怎么选牌,aapoker透视方法,扑克教程(本来存在有挂)1)aapoker...
透视玄学!htx矩阵wepok... 透视玄学!htx矩阵wepoker辅助,(WEPOKER私人局)一贯真的是有挂(详细脚本)透视玄学!...
透视黑科技!wpk德州局透视,... 透视黑科技!wpk德州局透视,(WpK作弊)辅助(一贯是有挂)1、wpk德州局透视ai机器人多个强度...
透视教程"wepok... 透视教程"wepoker国外版透视(底牌透视脚本)wepoker私人局透视方法"一贯真的是有挂1、在...