两个实现层,然后相互注入对方(AService、BService)
在AService 注入 BService
在BService 注入AService
出现循环依赖问题具体错误如下
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'advanceAmountController': Unsatisfied dependency expressed through method 'setAdvanceAmountService' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'advanceAmountService': Unsatisfied dependency expressed through method 'setAsyncService' parameter 0; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'asyncService': Bean with name 'asyncService' has been injected into other beans [orgService,resourceService] 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. T