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

相关内容

热门资讯

黑科技科技"红龙扑克... 黑科技科技"红龙扑克有没有作假!外挂透明挂辅助神器(黑科技)新版2025教程"都是是真的有挂1、点击...
攻略黑科技(aapoKer)辅... 攻略黑科技(aapoKer)辅助工具ai(透视)辅助工具(都是有挂)一、AI软件牌型概率发牌机制”必...
黑科技辅助"德扑之星... 黑科技辅助"德扑之星的优势!外挂透明挂辅助助手(黑科技)科技教程"原来是真的有挂1、首先打开德扑之星...
教你黑科技(aApoker)外... 教你黑科技(aApoker)外挂安全吗(透视)外挂(真是存在有挂);1、在ai机器人技巧中,中转单元...
黑科技教学"用ai外... 黑科技教学"用ai外挂打德州有用吗!外挂透明挂辅助工具(黑科技)揭秘攻略"原来真的有挂1、用ai外挂...
好友房辅助挂(德州之星)讲解(... 好友房辅助挂(德州之星)讲解(Ai)讲解(总是真的有挂)辅助器中分为三种模型:软件透明挂、辅助挂、辅...
黑科技存在"wpk德... 黑科技存在"wpk德州!外挂透明挂辅助app(黑科技)透明挂教程"确实真的有挂;1、全新机制【wpk...
真的辅助挂(德扑ai)软件铺牌... 真的辅助挂(德扑ai)软件铺牌器(AI)ai代打(都是存在有挂);软件透明挂微扑克wpk插件教程:1...
黑科技ai代打"手机... 黑科技ai代打"手机云扑克辅助是真的假的!外挂透明挂辅助下载(黑科技)解密教程"本来存在有挂;1、手...
好友房辅助挂(德州之星)有透视... 好友房辅助挂(德州之星)有透视外挂吗(Ai)app辅助器可以用(一贯真的有挂);1、每一步都需要思考...