博主首页

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

Description:

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

┌─────┐
|  t1 defined in file [D:\yirui-supervisor\yirui-supervisor-web\target\classes\com\yirui\supervisor\service\construction\T1.class]
↑     ↓
|  t2 defined in file [D:\yirui-supervisor\yirui-supervisor-web\target\classes\com\yirui\supervisor\service\construction\T2.class]
└─────┘


Disconnected from the target VM, address: '127.0.0.1:58912', transport: 'socket'

Process finished with exit code 1

spring循环依赖异常;两个类互相构造方法引用,改为set方式注入即可

 

加上注解也行

@Lazy注解

 

posted @ 2020-11-10 11:25  笑~笑  阅读(609)  评论(0编辑  收藏  举报