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有透视辅助妙招!wepo... WPK有透视辅助妙招!wepoker如何设置透视,微扑克ai多功能辅助脚本wepoker如何设置透视...
WPK透视透视挂方式!wpk模... WPK透视透视挂方式!wpk模拟器是什么,红龙PoKerai多功能透视挂软件1、wpk模拟器是什么模...
WPK四人辅助要领!wepok... WPK四人辅助要领!wepoker怎么拿到好牌,aapokerai多功能辅助教程1、wepoker怎...
WPK俱乐部透视妙计!wepo... WPK俱乐部透视妙计!wepoker透视脚本免费下载,菠萝智星德州ai多功能透视教程1、很好的工具软...
WPK真假开挂经验!wepok... WPK真假开挂经验!wepoker好友局透视,aapokerai多功能开挂脚本1、不需要AI权限,帮...
WPK透视版辅助器妙计!wpk... WPK透视版辅助器妙计!wpk作弊,红龙PoKerai多功能辅助器插件1、在wpk作弊插件功能辅助器...
WPK俱乐部透视挂方式!wpk... WPK俱乐部透视挂方式!wpk透视辅助靠谱吗,aapokerai多功能透视挂app1、超多福利:超高...
WPK模拟器开挂演示!德普之星... WPK模拟器开挂演示!德普之星透视,aapokerai多功能开挂插件德普之星透视能透视中分为三种模型...
WPK辅助透视课程!智星菠萝有... WPK辅助透视课程!智星菠萝有挂吗,德州扑克ai多功能透视攻略1)智星菠萝有挂吗辅助插件:进一步探索...
WPK辅助器透视操作!wepo... WPK辅助器透视操作!wepoker私人局透视教程,德扑之星ai多功能透视插件1、上手简单,内置详细...