原文:springboot启动报错Bean with name ‘xxxxService‘ has been injected into other beans

今天在本地测试启动项目的时候报错: Bean with name commonService has been injected into other beans in its raw version as part of a circular reference, but has eventually been wrapped. This means that said other beans ...

2022-01-10 13:16 0 1615 推荐指数:

查看详情

Bean with name 'xxxxxx' has been injected into other beans

首先说一下什么是依赖循环,比如:我现在有一个ServiceA需要调用ServiceB的方法,那么ServiceA就依赖于ServiceB,那在ServiceB中再调用ServiceA的方法,就形成了循环依赖。Spring在初始化bean的时候就不知道先初始化哪个bean就会报错 ...

Tue Jan 28 17:51:00 CST 2020 0 2025
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM