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

相关内容

热门资讯

黑科技了解!红龙扑克辅助器第一... 黑科技了解!红龙扑克辅助器第一视角,GG扑克辅助软件,2025新版(一直是有挂)1、许多玩家不知道红...
wepoke是真的有挂(Wep... wepoke是真的有挂(WepOke)wepoke保险(黑科技)安装教程(确实有挂);一、wepok...
黑科技辅助挂!(wEpoke)... 黑科技辅助挂!(wEpoke)果然真的是有挂,(wepoke)竟然有挂,可靠教程(有挂总结)1、全新...
透明辅助挂!德州ai辅助器,(... 透明辅助挂!德州ai辅助器,(德州ai)切实存在有挂,玩家教你(有挂插件);进入游戏-大厅左侧-新手...
黑科技安卓版!红龙扑克透牌辅助... 黑科技安卓版!红龙扑克透牌辅助器,约局吧发牌逻辑,2025新版技巧(一贯是有挂);小薇(透视辅助)致...
wpk到底有没有外挂(WPK)... wpk到底有没有外挂(WPK)德州wpk德州真的(透视)必胜教程(果然真的有挂)一、wpk到底有没有...
黑科技辅助挂!(德州aapok... 黑科技辅助挂!(德州aapoker俱乐部)一贯是有挂,(德州aapoker)确实是真的有挂,介绍教程...
透视数据!wpk有辅助插件吗,... 透视数据!wpk有辅助插件吗,(wPK)好像是真的有挂,wpk教程(有挂详情)1、下载好wpk有辅助...
黑科技辅助!AApoker靠谱... 1、黑科技辅助!AApoker靠谱吗,aa扑克有挂吗,系统教程(素来是有挂);详细教程。2、AApo...
wepoke模拟器(WepOk... wepoke模拟器(WepOke)wepoke有机器人吗(黑科技)科技教程(一贯是真的有挂);1、w...