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

相关内容

热门资讯

能赢辅助挂(德扑)ai代打(A... 能赢辅助挂(德扑)ai代打(AI)ai代打可靠(原来真的是有挂)1、每一步都需要思考,不同水平的挑战...
黑科技辅助挂挂(WepoKe)... 黑科技辅助挂挂(WepoKe)是不是有挂(黑科技)挂靠谱推荐(原来真的有挂);《WPK辅助透视》‌:...
科普黑科技(aapokeR)辅... 科普黑科技(aapokeR)辅助(透视)辅助工具存在(都是存在有挂)1)辅助挂:进一步探索辅助透视大...
黑科技好友房(德扑之星)AI辅... 黑科技好友房(德扑之星)AI辅助神器(透视)线上wpkai机器人(从前真的是有挂);科技安装教程;1...
代打辅助挂(德州)线上ai辅助... 代打辅助挂(德州)线上ai辅助(Ai)AI辅助神器(确实存在有挂);小薇(透视辅助)致您一封信;亲爱...
黑科技模拟器(WEPoke)软... 黑科技模拟器(WEPoke)软件规律(黑科技)透明挂要多少钱(其实真的有挂)科技教程也叫必备教程,这...
模拟器辅助挂(德扑之星)透明软... 模拟器辅助挂(德扑之星)透明软件的使用方法(AI)ai智能系统(一贯真的有挂)1、任何ai辅助神器的...
黑科技代打(wePoKe)透明... 黑科技代打(wePoKe)透明黑科技(黑科技)辅助工具的使用教程(真是真的是有挂);1. ai辅助创...
最新辅助挂(德州ai)有辅助挂... 最新辅助挂(德州ai)有辅助挂吗(Ai)透牌器(真是有挂);所有人都在同一条线上,像星星一样排成一排...
黑科技新版(wPK)微扑克ai... 黑科技新版(wPK)微扑克ai辅助(透视)有辅助挂(其实是真的有挂)1、点击下载安装,微扑克wpk插...