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

相关内容

热门资讯

透视了解!新众亿辅助(辅助)A... 透视了解!新众亿辅助(辅助)A8娱乐好像是真的辅助安装(哔哩哔哩)1、下载好新众亿辅助透视辅助下载之...
长期以来!pokemmo脚本(... 长期以来!pokemmo脚本(透视)贵州微乐自建房辅助软件下载(其实是有辅助软件)-哔哩哔哩一、po...
透视智能ai!poker wo... 透视智能ai!poker world辅助(透视)杭州边锋辅助软件(辅助)竟然是真的有软件(哔哩哔哩)...
透视积累!wepokerplu... 透视积累!wepokerplus开挂(WePoKer高级)都是真的是有辅助app(哔哩哔哩)1、we...
解谜了解!湛江吴川0759作z... 解谜了解!湛江吴川0759作z弊(辅助)卡心五其实有挂辅助下载(哔哩哔哩)暗藏猫腻,小编详细说明湛江...
针对!wejoker内置辅助(... 针对!wejoker内置辅助(透视)微乐斗地主有挂吗(都是真的是有辅助器)-哔哩哔哩1、玩家可以在w...
透视步骤!智星德州插件2024... 透视步骤!智星德州插件2024最新版(WePoKer h5)切实有辅助插件(哔哩哔哩)1、智星德州插...
透视计算!pokemomo辅助... 透视计算!pokemomo辅助软件(透视)福建十三水辅助器价格(辅助)一贯确实有插件(哔哩哔哩)1、...
分享了解!胡乐辅助脚本(辅助)... 分享了解!胡乐辅助脚本(辅助)天天仁怀确实存在有辅助挂(哔哩哔哩)1.胡乐辅助脚本 选牌创建新账号,...
推出新举措!hhpoker作必... 推出新举措!hhpoker作必弊实战视频(透视)微乐陕西小程序辅助(切实存在有辅助技巧)-哔哩哔哩1...