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

相关内容

热门资讯

黑科技科技(WePoKe)we... 黑科技科技(WePoKe)wepoke开发者(辅助挂)其实真的是有挂(2025已更新)(哔哩哔哩)1...
黑科技辅助(德扑之星有规律吗)... 黑科技辅助(德扑之星有规律吗)外挂透明挂辅助挂(透视)总是真的是有挂(有挂攻略)-哔哩哔哩1、下载好...
一分钟了解!!wepoke线上... 一分钟了解!!wepoke线上(智能ai)高科技教程(2024已更新)(哔哩哔哩);人气非常高,ai...
黑科技私人局(WePoKe)w... 黑科技私人局(WePoKe)wepoke插件(透明挂黑科技)其实存在有挂(2026已更新)(哔哩哔哩...
黑科技教学(微扑克辅助是真的吗... 黑科技教学(微扑克辅助是真的吗)外挂透明挂辅助黑科技(透视)真是真的有挂(有挂分享)-哔哩哔哩一、微...
玩家爆料!wpk使用ai辅助会... 玩家爆料!wpk使用ai辅助会封号吗(透明黑科技)攻略教程(2026已更新)(哔哩哔哩)1、完成wp...
黑科技辅助(WePoKe)德扑... 黑科技辅助(WePoKe)德扑之星软件真的有辅吗(透明挂黑科技)确实是有挂(2021已更新)(哔哩哔...
黑科技讲解(微扑克系统发牌)外... 黑科技讲解(微扑克系统发牌)外挂透明挂辅助黑科技(透视)其实存在有挂(有挂分享)-哔哩哔哩;1、打开...
最新研发!微扑克私人局后台操控... 最新研发!微扑克私人局后台操控(智能ai)我来教教你(2020已更新)(哔哩哔哩)1、在微扑克私人局...
黑科技总结(WePoKe)we... 黑科技总结(WePoKe)wepoke辅助工具的使用教程(透明挂黑科技)都是是真的有挂(2024已更...