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

相关内容

热门资讯

第6分钟体悟!wepoker私... 第6分钟体悟!wepoker私人局辅助器怎么用,hhpoker软件可以玩吗(透视)普及教程(有挂详情...
重大通报!aapoker德州线... 重大通报!aapoker德州线上扑克辅助工具,德州ai辅助有用,解密教程(了解有挂)-哔哩哔哩;一、...
第5分钟辅助挂!wpk透视怎么... 第5分钟辅助挂!wpk透视怎么安装,pokemmo手机脚本辅助器(透视)解密教程(有挂存在)1、po...
黑科技中牌率!wepoke辅助... 黑科技中牌率!wepoke辅助,微扑克的辅助工具苹果,实用技巧(今日头条)-哔哩哔哩;大家肯定在之前...
三分钟黑科技!hhpoker有... 三分钟黑科技!hhpoker有后台操作吗,wepoker开辅助能查到吗(透视)揭秘教程(有挂方法)在...
终于清楚!wpk发牌机制,wp... 终于清楚!wpk发牌机制,wpk发牌规律算法,线上教程(确实有挂)-哔哩哔哩;小薇(透视辅助)致您一...
第八分钟指导!wepoker底... 第八分钟指导!wepoker底牌透视脚本app,wepoker可以免费玩吗(透视)必胜教程(有挂细节...
盘点一款!微扑克的辅助工具苹果... 盘点一款!微扑克的辅助工具苹果,aapoker挂,教你攻略(有挂技术)-哔哩哔哩,微扑克的辅助工具苹...
第九分钟辅助!hhpoker辅... 第九分钟辅助!hhpoker辅助软件,德州透视脚本(透视)必赢教程(有挂技巧)hhpoker辅助软件...
每日必备!wepoke ai代... 每日必备!wepoke ai代打,wepoke辅助插件,wpk教程(有挂技巧)-哔哩哔哩;一、wep...