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

相关内容

热门资讯

黑科技教程(AApOKER)外... 黑科技教程(AApOKER)外挂透视辅助助手(透视)安装教程(本来真的有挂)1、实时AApOKER开...
wepoke有没有挂(Wepo... wepoke有没有挂(WepoKe)wepoke模拟器(黑科技)插件教程(原来真的是有挂);1、we...
黑科技软件!wepoke辅助,... 黑科技软件!wepoke辅助,we-poke有挂吗,存在挂教程(一贯是有挂);wepoke辅助软件透...
黑科技存在!(Aapoker)... 黑科技存在!(Aapoker)透明挂辅助器,(aapoker)都是真的有挂,详细教程(有挂技巧)关于...
aapoker俱乐部后台可以操... aapoker俱乐部后台可以操作吗(AAPOKeR)aapoker透明挂(辅助挂)透明教程(原来是有...
黑科技能赢(微扑克私人局)外挂... 黑科技能赢(微扑克私人局)外挂透视辅助器(透视)揭秘教程(总是是真的有挂)1、实时微扑克私人局开挂更...
黑科技辅助挂!wpkai辅助,... 1、黑科技辅助挂!wpkai辅助,wpk胜利跟号有关吗,分享教程(切实存在有挂);详细教程。2、wp...
黑科技辅助!(德扑)外挂辅助插... 黑科技辅助!(德扑)外挂辅助插件,(德扑ai)都是有挂,必胜教程(有挂透视);实战中需综合运用上述技...
黑科技安卓版!微扑克系统发牌规... 黑科技安卓版!微扑克系统发牌规律,微扑克有辅助软件吗,技巧教程(先前是真的有挂);支持2-10人实时...
黑科技辅助(wpk德州扑克)外... 黑科技辅助(wpk德州扑克)外挂透视辅助安装(透视)揭秘教程(本来真的有挂)1、wpk德州扑克系统规...