Bean with name 'xxxService' has been injected into other beans [xxxServiceA,xxxServiceB] in its raw version as part of a circular reference, but has eventually been wrapped
2024-08-28 08:33:58
启动项目,通过@Autowired注入对象,出现循环依赖,导致项目启动失败,具体报错信息如下:
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'xxxtController':
Unsatisfied dependency expressed through field 'xxxService'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException:
Error creating bean with name 'xxxService': Bean with name 'xxxService' has been injected into other beans [xxxServiceA,xxxServiceB]
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
Bean with name 'xxxService' has been injected into other beans [xxxServiceA,xxxServiceB] in its raw version as part of a circular reference, but has eventually been wrapped
翻译:xxxService 这个bean已经被注入到xxxServiceA、xxxServiceB这两个bean中了,他们之间存在循环引用(依赖),也就是说:xxxServiceA中注入了xxxService,而xxxService中也要注入xxxServiceA,所以就会出现这种情况
参考:https://www.cnblogs.com/leng39/p/9530569.html
最新文章
- Android PopupWindow怎么合理控制弹出位置(showAtLocation)
- Android学习---通过内容提供者(ContentProvider)操作另外一个应用私有数据库的内容
- 《BI那点儿事》Microsoft 时序算法——验证神奇的斐波那契数列
- [问题2014S07] 解答
- Nginx实现多个站点使用一个端口(配置Nginx的虚拟主机)
- CAKeyframeAnimation 旋转动画
- BSTR共享内存问题
- PHP的curl常用的5种写法
- css hr 设置
- Webform中Repeater控件--绑定嵌入C#代码四种方式
- [置顶] IOS培训资料
- Ubuntu设置程序开机自启或者开机禁止加载
- Spring整合JMS(四)——事务管理
- 学号:201621123032 《Java程序设计》第9周学习总结(
- SQL Server 统计信息(Statistics)-概念,原理,应用,维护
- MAC &; Xcode 快捷键的使用
- 强连通tarjan模版
- JSP中的一个树型结构
- 财务软件(gnucash)
- java 学习知识汇总