admin管理员组文章数量:1565350
报错:has been injected into other beans [] in its raw version as part of a circular reference,but has eventually been wrapped.This meas that said other beans do not use the final version of the bean
原因:循环依赖的bean被动态代理重新包装了。我在项目中使用BeanPostProcessor动态代理包装了一个有循环依赖的bean就报了这个错误。
解决办法:使用SmartInstantiationAwareBeanPostProcessor代替BeanPostProcessor,重写下面的getEarlyBeanReference方法创建动态代理可以解决。
原理:
可以参考此篇博客,了解下SmartInstantiationAwareBeanPostProcessor是在何处调用的:
SmartInstantiationAwareBeanPostProcessor-CSDN博客
本文标签: RAWbeansinjectedVersionreference
版权声明:本文标题:【问题解决】has been injected into other beans [] in its raw version as part of a circular reference,but h 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/dianzi/1726872561a1087990.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论