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辅助器视频,wepoker辅助工具,一贯确实有挂(了解有挂)1、很好的工具软件,...
围绕透视问题!德普之星有辅助软... 围绕透视问题!德普之星有辅助软件吗,德州来玩辅助器,一贯真的是有挂(有人有挂)小薇(辅助器软件下载)...
第三方插件!aa poker辅... 第三方插件!aa poker辅助,xpoker辅助,一贯存在有挂(有挂助手);1、aa poker辅...
随着!德州局怎么透视,uupo... 随着!德州局怎么透视,uupoker有透视吗,总是是有挂(有挂分享)该软件可以轻松地帮助玩家将德州局...
最新消息!wepoker透视脚... 最新消息!wepoker透视脚本苹果版,hhpoker透视脚本,真是确实有挂(有挂规律)wepoke...
2026版软件!wepoker... 2026版软件!wepoker免费脚本咨询,wepoker免费透视,切实真的有挂(的确有挂)1、we...
2026版技巧!we-poke... 您好,we-poker有人玩吗这款游戏可以开挂的,确实是有挂的,需要了解加去威信【136704302...
不少玩家反映!wepoker轻... 不少玩家反映!wepoker轻量版有透视吗,hhpoker透视脚本,一直确实有挂(有挂解惑)wepo...
现就发布提示!wepoker透... 现就发布提示!wepoker透视脚本免费app,wepoker软件靠谱么,好像确实有挂(有挂方式)1...
在玩家背景下!wepoker有... 在玩家背景下!wepoker有辅助器吗,wepoker养号规律,好像确实有挂(有人有挂);1、进入到...