org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'crmVoucherBlackListService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.ainemo.console.service.CrmVoucherWalletService com.ainemo.console.service.CrmVoucherBlackListService.crmVoucherWalletService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'crmVoucherWalletService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.ainemo.console.service.AsyncMethods com.ainemo.console.service.CrmVoucherWalletService.asyncMethods; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'asyncMethods': Bean with name 'asyncMethods' has been injected into other beans [enterpriseProxy] 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.
今天写了一个controller,注入了CrmVoucherBlackListService,报上图错误提示
其中CrmVoucherBlackListService中又注入了CrmVoucherWalletService,
CrmVoucherWalletService其中注入有一个异步方法类AsyncMethods,
AsyncMethods中又注入了EnterpriseProxy类 来实现调用EnterpriseProxy中的方法实现业务,但EnterpriseProxy中最开始也注入了AsyncMethods来实现业务逻辑,这就出现了AsyncMethods和EnterpriseProxy之间循环依赖注入,报上面的错误