Bean with name ‘‘ has been injected into other beans [] in its raw version as part of a circular ref

Bean with name ‘你自己项目中A类’ has been injected into other beans [你自己项目中类另外的B类] in its raw version as part of a circular reference, but has eventually been wrapped.This means that said other beans do not use the final version of the bean.

1、原因: 你自己项目中A 类中注入了你自己项目中类另外的B类, 而在 你自己项目中类另外的B 类中也注入了 你自己项目中A 类 ,从而引起该异常。(循环引用)

2、解决: 你自己项目中A 类注入 你自己项目中类另外的B类时,增加注解@Lazy,反之同理。

在平时的项目编码过程中,尽量不要导致循环依赖。

你可能感兴趣的:(java,Linux部署,java,开发语言)