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
40
1
下载
A rewrite of the old legacy software "depends.exe" in C# for Windows devs to troubleshoot dll load dependencies issues.
最近提交(Master分支:3 个月前 )
1997a400 - 4 年前
2f423539 - 4 年前
Logo

AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。

更多推荐