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

相关内容

热门资讯

透视课程!hhpoker俱乐部... 透视课程!hhpoker俱乐部是干嘛的,德州局HHpoker透视脚本(透视)都是真的是有脚本神器(哔...
透视学习!aapoker能控制... 透视学习!aapoker能控制牌吗,aapoker透视插件(透视)原来是真的脚本插件(哔哩哔哩)运a...
透视窍要!德普之星辅助工具如何... 透视窍要!德普之星辅助工具如何打开,德普之星辅助器怎么用(透视)竟然真的有透视技巧(哔哩哔哩)1、游...
透视方案!aapoker脚本,... 透视方案!aapoker脚本,aapoker真的假的(透视)其实真的有透视教程(哔哩哔哩)透视方案!...
透视模板!hhpoker辅助器... 您好,hhpoker辅助器这款游戏可以开挂的,确实是有挂的,需要了解加去威信【136704302】很...
透视大纲!wepoker透视器... 透视大纲!wepoker透视器免费,we-poker辅助器(透视)确实有脚本挂(哔哩哔哩)在进入we...
透视项目!aapoker真的假... 透视项目!aapoker真的假的,aapoker辅助工具安全吗(透视)其实是真的脚本脚本(哔哩哔哩)...
透视指引!aapoker怎么开... 透视指引!aapoker怎么开辅助器,aapoker透视怎么用(透视)总是有透视脚本(哔哩哔哩);a...
透视策略!hhpoker德州透... 透视策略!hhpoker德州透视挂,hhpoker免费透视脚本(透视)好像是有脚本软件(哔哩哔哩)1...
透视绝活儿!wpk辅助插件,w... 透视绝活儿!wpk辅助插件,wpk有辅助器吗(透视)其实存在有脚本教程(哔哩哔哩)进入游戏-大厅左侧...