启动项目,通过@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

最新文章

  1. Android PopupWindow怎么合理控制弹出位置(showAtLocation)
  2. Android学习---通过内容提供者(ContentProvider)操作另外一个应用私有数据库的内容
  3. 《BI那点儿事》Microsoft 时序算法——验证神奇的斐波那契数列
  4. [问题2014S07] 解答
  5. Nginx实现多个站点使用一个端口(配置Nginx的虚拟主机)
  6. CAKeyframeAnimation 旋转动画
  7. BSTR共享内存问题
  8. PHP的curl常用的5种写法
  9. css hr 设置
  10. Webform中Repeater控件--绑定嵌入C#代码四种方式
  11. [置顶] IOS培训资料
  12. Ubuntu设置程序开机自启或者开机禁止加载
  13. Spring整合JMS(四)——事务管理
  14. 学号:201621123032 《Java程序设计》第9周学习总结(
  15. SQL Server 统计信息(Statistics)-概念,原理,应用,维护
  16. MAC & Xcode 快捷键的使用
  17. 强连通tarjan模版
  18. JSP中的一个树型结构
  19. 财务软件(gnucash)
  20. java 学习知识汇总

热门文章

  1. 进程调度函数schedule()分析
  2. HDU2609 How many —— 最小表示法
  3. FileReader、 FileWriter、readLine()和newLine()、LineNumberReader(二十一)
  4. java邮件发送(含附件)
  5. js 购物车中,多件商品数量加减效果修改,实现总价随数量加减改变
  6. linux--安装phpcurl扩展
  7. win7Setx修改环境变量
  8. vector学习
  9. 6-8 adaboost分类器2
  10. Vue-i18n实现语言切换