今天在开发代码的时候遇到了一个启动错误,错误内容大致就是:
org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'classA': Bean with name 'classA' has been injected into other beans [classB] 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. This is often the result of over-eager type matching - consider using 'getBeanNamesOfType' with the 'allowEagerInit' flag turned off, for example
后面经过分析是跟我前面使用@Async注解有关,主要原因就是@Async 导致循环依赖失效,以下是我网上寻找的一些相关资料: