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

相关内容

热门资讯

玩家必看"aapok... 玩家必看"aapoker发牌机制"AApoker辅助(本来真的有挂)-哔哩哔哩1、构建自己的aapo...
wPK最新黑科技!wpk辅助n... 1、wPK最新黑科技!wpk辅助nzt(WPK ai辅助)一直真的是有挂(2024已更新)(哔哩哔哩...
wepoke黑科技!WePoK... wepoke黑科技!WePoKe有挂,(wopoker)总是真的是有挂,黑科技软件(有人有挂)-哔哩...
wepoke智能ai!wepo... wepoke智能ai!wepoke辅助软件靠谱吗(WePoKe黑科技)其实真的是有挂(真的有挂)-哔...
aa poker有外挂!aap... 这是一款非常优秀的 ia辅助检测软件,能够让你了解到中牌率当中全部隐藏参数,与同类被系统制裁软件相比...
一起来探讨"aapo... 一起来探讨"aapokerai辅助"aapoker辅助器是真的吗(切实有挂)-哔哩哔哩一、aapok...
wPk最新黑科技!wpk长期盈... wPk最新黑科技!wpk长期盈利打法(WPK ai辅助)从前真的有挂(2020已更新)(哔哩哔哩);...
wepoke智能ai!wepo... wepoke智能ai!wepoke有辅助挂,(wepOke)一般是有挂,黑科技科技(有挂规律)-哔哩...
wepoke真的有挂!wepo... wepoke真的有挂!wepoke辅助从哪里下载(WePoKe黑科技)一直真的有挂(了解有挂)-哔哩...
记者揭秘"aapok... 记者揭秘"aapokerai辅助"AApoker透视辅助器安装教程(好像真的有挂)-哔哩哔哩1、不需...