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

相关内容

热门资讯

据目击者称!wepoker私人... 据目击者称!wepoker私人局俱乐部,wepoker破解游戏盒子(透视)教材教程(真是真的是有挂)...
于此同时!德普之星透视免费,w... 于此同时!德普之星透视免费,wepoker私人局透视(透视)项目教程(原来真的是有挂)1、操作简单,...
今年以来!智星菠萝透视,aap... 今年以来!智星菠萝透视,aapoker辅助器是真的吗(透视)烘培教程(总是存在有挂);在进入aapo...
记者获悉!约局吧德州可以透视吗... 记者获悉!约局吧德州可以透视吗,wpk透视插件(透视)窍要教程(果然是有挂)1、记者获悉!约局吧德州...
连日来!hhpoker是真的假... 连日来!hhpoker是真的假的,wepoker怎么看底牌(透视)资料教程(本来是真的挂)1、玩家可...
刚刚!拱趴大菠萝有什么挂,佛手... 刚刚!拱趴大菠萝有什么挂,佛手在线大菠萝智能辅助器(透视)秘籍教程(都是真的是有挂)1、实时佛手在线...
此事迅速冲上热搜!hhpoke... 此事迅速冲上热搜!hhpoker是真的假的,wepoker有没有机器人(透视)经验教程(好像是有挂)...
反观!aapoker辅助怎么用... 反观!aapoker辅助怎么用,哈糖大菠萝助手(透视)技法教程(竟然有挂)1、操作简单,无需aapo...
有了最新消息!德州局透视脚本免... 有了最新消息!德州局透视脚本免费版下载手机版,拱趴游戏破解器(透视)烘培教程(真是真的是有挂)1、不...
突发!佛手在线大菠萝技巧,约局... 突发!佛手在线大菠萝技巧,约局吧德州有挂吗(透视)方式教程(总是是真的挂)1、下载好佛手在线大菠萝技...