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

相关内容

热门资讯

黑科技脚本"fish... 黑科技脚本"fishpoker下载!外挂透明挂辅助工具(黑科技)AI教程"本来是有挂1、玩家可以在f...
黑科技实锤!(推扑克)外挂辅助... 黑科技实锤!(推扑克)外挂辅助工具,(扑克时间)往昔存在有挂,可靠教程(有挂软件);实战中需综合运用...
可靠黑科技(aApoker)辅... 可靠黑科技(aApoker)辅助工具ai(透视)辅助器是真的(其实是有挂);1、在ai机器人技巧中,...
黑科技线上"德扑之星... 黑科技线上"德扑之星发牌规律!外挂透明挂辅助工具(黑科技)AI教程"总是是有挂;1、实时德扑之星发牌...
黑科技透明挂挂!(AAPOKE... 黑科技透明挂挂!(AAPOKER)透明挂辅助安装,(aapoKER)竟然存在有挂,科技教程(有挂神器...
辅助挂辅助挂(德州)ai人工智... 辅助挂辅助挂(德州)ai人工智能软件下载(Ai)ai神器下载(一直有挂)1、操作简单,无需注册,只需...
黑科技辅助"德州aa... 黑科技辅助"德州aa扑克透明挂!外挂透明挂辅助工具(黑科技)微扑克教程"总是是真的有挂;1)德州aa...
黑科技工具!(AAPOKEr)... 黑科技工具!(AAPOKEr)透明挂辅助脚本,(aapOKER)本来是有挂,wpk教程(有挂辅助);...
系统辅助挂(德扑之星)ai代打... 系统辅助挂(德扑之星)ai代打怎么弄(AI)ai代打怎么弄(竟然是真的有挂)1、让任何用户在无需AI...
黑科技脚本"wpk俱... 黑科技脚本"wpk俱乐部开挂实锤!外挂透明挂辅助挂(黑科技)AI教程"都是有挂1、任何wpk俱乐部开...