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

相关内容

热门资讯

透视辅助!wejoker辅助软... 透视辅助!wejoker辅助软件,pokemmo辅助器脚本下载,资料教程(竟然有挂)-哔哩哔哩暗藏猫...
透视线上!wepoker有辅助... 透视线上!wepoker有辅助吗(透视)总是真的是有挂,wepoke教程(有挂控制)-哔哩哔哩1、每...
第五分钟关于!淘宝买wepok... 第五分钟关于!淘宝买wepoker透视有用吗(透视)果然存在有挂,专业教程(今日头条)-哔哩哔哩1、...
透视计算!aapoker插件下... 透视计算!aapoker插件下载(透视)本来真的有挂,透明教程(有挂开发)-哔哩哔哩1、透视计算!a...
透视计算!wepoker-h5... 透视计算!wepoker-h5下载,wpk可以辅助吗,教材教程(真是有挂)-哔哩哔哩亲,关键说明,w...
1分钟了解!聚星ai辅助工具激... 1分钟了解!聚星ai辅助工具激活码(透视)切实有挂,wpk教程(真实有挂)-哔哩哔哩聚星ai辅助工具...
透视代打!wepoker有没有... 透视代打!wepoker有没有机器人,hhpoker脚本下载,资料教程(有挂教学)-哔哩哔哩1、we...
透视挂透视!wepoker辅助... 透视挂透视!wepoker辅助透视软件(透视)其实真的是有挂,黑科技教程(有挂app)-哔哩哔哩1、...
第六分钟必备!hhpoker底... 第六分钟必备!hhpoker底牌透视脚本(透视)原来是真的挂,系统教程(今日头条)-哔哩哔哩1、起透...
透视存在!aapoker真的假... 透视存在!aapoker真的假的,aapoker如何设置胜率,积累教程(真的有挂)-哔哩哔哩1、游戏...