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

相关内容

热门资讯

红龙扑克辅助器!红龙扑克辅助器... 1、红龙扑克辅助器!红龙扑克辅助器(红龙扑克)好像存在有挂(详细辅助教程);详细教程。2、透视辅助简...
黑科技辅助挂!Wepoke一直... 黑科技辅助挂!Wepoke一直真的是有挂,Wepoke必胜都是真的有挂(详细计算辅助教程)1、ai机...
透视辅助!WpK透视辅助教程,... 透视辅助!WpK透视辅助教程,WPK透视本来是有挂(详细外卦挂教程)1、用户打开应用后不用登录就可以...
wepoke辅助机器人!wEP... wepoke辅助机器人!wEPOKE本来真的有挂,德州ai辅助神器wpk(详细透视辅助神器教程)1)...
德扑之星辅助器购买(德扑之星实... 德扑之星辅助器购买(德扑之星实战)辅助软件(辅助挂)一直是真的有挂(详细有作弊教程)1、起透看视 德...
黑科技透明挂!WEPoke辅助... 黑科技透明挂!WEPoke辅助工具,wepoke模拟器一贯有挂(详细ai代打教程)1、黑科技透明挂!...
透视辅助!红龙扑克辅助软件,红... 透视辅助!红龙扑克辅助软件,红龙扑克确实存在有挂(详细辅助教程)运辅助工具,进入游戏界面。进入辅助器...
wepoke有辅助挂!poke... wepoke有辅助挂!pokerworld真是存在有挂,wepower有外挂(详细ai代打辅助插件教...
aapoker透视辅助(aap... aapoker透视辅助(aapoker猫腻)aapoker 辅助工具(辅助挂)都是是有挂(详细辅助教...
透视辅助!AAPOKEr软件透... 透视辅助!AAPOKEr软件透明挂,aapoker有挂竟然是真的有挂(详细猫腻教程)1、aapoke...