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

相关内容

热门资讯

透视新版!pokermaste... 透视新版!pokermaster脚本,德州之星扫描器,要领教程(果真有挂)-哔哩哔哩1)德州之星扫描...
第9分钟曝光!wepoker是... 第9分钟曝光!wepoker是不是有人用挂(透视)原来存在有挂,教你攻略(有挂攻略)-哔哩哔哩一、w...
透视私人局!hardrock透... 透视私人局!hardrock透视工具(透视)其实是真的挂,揭秘教程(有挂最新版)-哔哩哔哩1、该软件...
透视安卓版!wepokerpl... 透视安卓版!wepokerplus透视脚本免费,德普之星辅助工具如何打开,窍门教程(详细教程)-哔哩...
第九分钟关于!wepoker辅... 第九分钟关于!wepoker辅助插件功能(透视)其实存在有挂,透明挂教程(有挂教程)-哔哩哔哩1、操...
透视挂!wepoker黑侠辅助... 透视挂!wepoker黑侠辅助器(透视)一贯是真的挂,AI教程(有挂代码)-哔哩哔哩;1、玩家可以在...
透视有挂!wpk辅助,xpok... 透视有挂!wpk辅助,xpoker辅助工具,法子教程(今日头条)-哔哩哔哩1、实时xpoker辅助工...
1分钟辅助!xpoker辅助怎... 1分钟辅助!xpoker辅助怎么用(透视)其实有挂,2025新版总结(有人有挂)-哔哩哔哩1、该软件...
透视肯定!wpk辅助购买(透视... 透视肯定!wpk辅助购买(透视)原来存在有挂,德州教程(有挂靠谱)-哔哩哔哩1、任何wpk辅助购买a...
透视计算!aapoker怎么设... 透视计算!aapoker怎么设置提高好牌几率,如何下载wpk透视版,法子教程(有挂存在)-哔哩哔哩在...