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作弊!每日必看... 总结透视!wpk作弊!每日必看辅助神器(有挂存在)-哔哩哔哩1、首先打开wpk作弊辅助器下载最新版本...
日前!hhpoker哪个俱乐部... 日前!hhpoker哪个俱乐部靠谱(透视)竟然存在有辅助平台(有挂头条)-哔哩哔哩进入游戏-大厅左侧...
揭露透视!wepoker透视挂... 揭露透视!wepoker透视挂底牌!分享实测辅助技巧(有挂细节)-哔哩哔哩1)wepoker透视挂底...
透视脚本!wepoker俱乐部... 透视脚本!wepoker俱乐部辅助(透视)其实真的是有辅助下载(有挂透视)-哔哩哔哩1、点击下载安装...
总结透视!wepoker免费脚... 总结透视!wepoker免费脚本弱密码!程序员教你辅助器(真实有挂)-哔哩哔哩亲,关键说明,wepo...
目前!pokemmo辅助器脚本... 目前!pokemmo辅助器脚本下载(透视)确实真的是有辅助平台(真是有挂)-哔哩哔哩1、进入游戏-大...
普及透视!aapoker ai... 普及透视!aapoker ai插件!推荐几款新版辅助工具(证实有挂)-哔哩哔哩aapoker ai插...
透视真的!wepoker透视器... 透视真的!wepoker透视器免费(透视)都是真的是有辅助辅助器(有挂神器)-哔哩哔哩1、让任何用户...
辅助透视!hhpoker德州挂... 辅助透视!hhpoker德州挂真的有吗!普及知识辅助器(有挂方法)-哔哩哔哩1、hhpoker德州挂...
透视玄学!pokerworld... 透视玄学!pokerworld破解版下载(透视)原来真的有辅助app(揭秘有挂)-哔哩哔哩1、让任何...