
@Async
代理冲突事件报告:raw version as part of a circular reference,but has eventually been wrapped.关键信息 | 详情 |
---|---|
发生环境 | 预生产环境(Spring MVC 4.3.9) |
报错特征 | BeanCurrentlyInCreationException + 循环依赖警告 |
触发条件 | 循环依赖链中的Service使用@Async 注解 |
影响范围 | 服务启动失败,涉及一些service及相关依赖链 |
org.springframework.beans.factory.BeanCurrentlyInCreationException:
Error creating bean with name ‘…Service’:
Bean has been injected into other beans […] in its raw version as part of a circular reference,
but has eventually been wrapped.This is often the result of over-eager type matching - consider using ‘getBeanNamesOfType’ with the ‘allowEagerInit’ flag turned off, for example.
@Async
代理需求避免在循环依赖的Bean中使用以下注解:
@Transactional
其他需要代理的AOP增强
根本原因是不应该循环依赖
2025-05-09