1、描述

正在愉快的写代码,突然报错

The dependencies of some of the beans in the application context form a cycle:

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.

截图
在这里插入图片描述
根据报错我们很容易就可以理解了,是由于我在userService和EchoSerice两个类里循环引用了对方,找到问题所在就好解决了,我去把userService里注入的echoService去掉,问题解决!

GitHub 加速计划 / de / Dependencies
36
1
下载
A rewrite of the old legacy software "depends.exe" in C# for Windows devs to troubleshoot dll load dependencies issues.
最近提交(Master分支:17 天前 )
1997a400 - 3 年前
2f423539 - 3 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐