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底牌透视脚本(透视)本来是真的挂,安装教程(竟然有挂)-哔哩哔哩1、wep...
透视脚本!hhpoker有没有... 透视脚本!hhpoker有没有辅助挂,hardrock透视工具,诀窍教程(真的有挂)-哔哩哔哩暗藏猫...
辅助工具!wepoker软件有... 无需打开直接搜索;操作使用教程:辅助工具!wepoker软件有挂吗,wepoker有没有挂透视挂,(...
透视模拟器!wepoker辅助... 透视模拟器!wepoker辅助真的假的(透视)竟然真的有挂,揭秘攻略(有挂测试)-哔哩哔哩1、完成w...
第二分钟关于!wepoker好... 第二分钟关于!wepoker好友助力码(透视)其实真的有挂,细节揭秘(有挂技术)-哔哩哔哩1、用户打...
透视存在!hhpoker免费透... 透视存在!hhpoker免费透视脚本,pokemmo辅助器,绝活教程(有挂分享)-哔哩哔哩进入游戏-...
透视脚本!wepoker透视挂... 透视脚本!wepoker透视挂试用,wepoker透视软件挂教程,(玩家必看科普外挂辅助挂)是一款可...
透视ai代打!hhpoker辅... 透视ai代打!hhpoker辅助软件下载(透视)竟然是真的挂,安装教程(有挂漏洞)-哔哩哔哩透视ai...
第九分钟解迷!福建大菠萝万能辅... 第九分钟解迷!福建大菠萝万能辅助器(透视)真是是有挂,详细教程(有挂规律)-哔哩哔哩1、福建大菠萝万...
透视安装!hhpoker可以开... 透视安装!hhpoker可以开挂吗,wepoker透视脚本免费下载,技法教程(有挂功能)-哔哩哔哩1...