it may be possible to break the cycle automatically by setting spring.main.allow-circular-references
***************************
APPLICATION FAILED TO START
***************************
Description:
The dependencies of some of the beans in the application context form a cycle:
┌──->──┐
| consoleInitData (field private xxx.xxx.xxx.xxx.xxx com.xxx.xxx.xxx.xxx.xxx)
└──<-──┘
Action:
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.

解决方法,在配置中加上:

上面这种仅对内部配置文件生效,还可以改代码
https://blog.csdn.net/weixin_60387745/article/details/129921488

return application.sources(Application.class).allowCircularReferences(true);

更多推荐
所有评论(0)