@lazy 解决循环依赖

业务场景:在启动项目的时候,报错!

BeanCurrentlyInCreationException: Error creating bean with name 'MaintPlanService':
Requested bean is currently in creation: Is there an unresolvable circular reference?

解决方案

在注入MaintPlanService的前面添加 @lazy 注解,让其进行懒加载。
问题的本质原因是因为出现了循环依赖的的原因。

posted @ 2021-05-23 13:43  XuTingYin  阅读(698)  评论(0)    收藏  举报