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

相关内容

热门资讯

黑科技真的(wpk辅助器是真的... 黑科技真的(wpk辅助器是真的假的)外挂透明挂辅助挂(透视)都是真的有挂(竟然有挂)-哔哩哔哩1、w...
黑科技黑科技(WePoKe)n... 黑科技黑科技(WePoKe)nzt德州辅助(黑科技ai)好像真的有挂(2021已更新)(哔哩哔哩)1...
揭秘几款!wpk微扑克俱乐部(... 1、揭秘几款!wpk微扑克俱乐部(智能ai)必赢教程(2020已更新)(哔哩哔哩)2、进入游戏-大厅...
黑科技ai(微扑克发牌规律性总... 黑科技ai(微扑克发牌规律性总结)外挂透明挂辅助助手(透视)确实是真的有挂(有挂方法)-哔哩哔哩亲,...
黑科技总结(WePoKe)we... 黑科技总结(WePoKe)wepoke有插件吗(软件透明挂)果然是有挂(2025已更新)(哔哩哔哩)...
热点讨论!约局互娱辅助(ai辅... 热点讨论!约局互娱辅助(ai辅助)切实教程(2020已更新)(哔哩哔哩)是一款可以让一直输的玩家,快...
黑科技代打(微扑克发牌机制)外... 黑科技代打(微扑克发牌机制)外挂透明挂辅助挂(透视)本来是有挂(有挂方略)-哔哩哔哩微扑克发牌机制软...
黑科技实锤(WePoKe)德州... 黑科技实锤(WePoKe)德州wepower透视辅助(智能ai)原来是真的有挂(2026已更新)(哔...
实测发现!微扑克ai辅助会封号... 实测发现!微扑克ai辅助会封号吗(透视)软件教程(2025已更新)(哔哩哔哩)是一款可以让一直输的玩...
黑科技神器(aapoker辅助... 黑科技神器(aapoker辅助工具使用教程)外挂透明挂辅助app(透视)原来真的是有挂(了解有挂)-...