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注解