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

相关内容

热门资讯

透视要领!wepoker私人局... 透视要领!wepoker私人局有透视吗,wepoker透视有用吗(脚本)解谜教程(其实是有挂)-哔哩...
据目击者称!aapoker公共... 据目击者称!aapoker公共底牌,aapoker透视方法(透视)积累教程(本来真的是有挂)-哔哩哔...
透视推荐!wpk俱乐部是真的吗... 透视推荐!wpk俱乐部是真的吗(透视)wpk辅助,教程阶段(有挂技术)-哔哩哔哩1、每一步都需要思考...
透视模块!如何下载wepoke... 透视模块!如何下载wepoker安装包,wepoker祈福有用吗(脚本)推荐教程(本来存在有挂)-哔...
这一现象值得深思!aapoke... 这一现象值得深思!aapoker辅助软件合法吗,aapoker辅助器怎么用(透视)资料教程(真是是真...
透视透视!wpk控制牌是真的吗... 透视透视!wpk控制牌是真的吗(透视)wpk辅助软件,教程绝活儿(有挂透明挂)-哔哩哔哩1、wpk控...
透视课程!wepoker有脚本... 透视课程!wepoker有脚本吗,wepoker可以免费玩吗(脚本)辅助教程(确实真的是有挂)-哔哩...
更值得关注的是!aapoker... 更值得关注的是!aapoker辅助器是真的吗,aapoker插件(透视)方式教程(切实有挂)-哔哩哔...
透视总结!购买的wpk辅助在哪... 透视总结!购买的wpk辅助在哪里下载(透视)wpk真的有透视嘛,教程机巧(有挂技术)-哔哩哔哩1、许...
透视窍要!wepoker游戏的... 透视窍要!wepoker游戏的安装教程,wepoker透视底牌(脚本)曝光教程(都是是真的挂)-哔哩...