栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

解决循环依赖BUG。Relying upon circular references is discouraged and they are prohibited by default.

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

解决循环依赖BUG。Relying upon circular references is discouraged and they are prohibited by default.

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.allow-circular-references 设置为 true 来自动中断循环。

解决方法如下:

1.如果是.properties文件,在文件中添加

spring.main.allow-circular-references=true

2.如果是.yml文件,则在文件中添加

spring:
  main:
    allow-circular-references:true

然后重新启动项目就可以了。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/952779.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号