admin管理员组

文章数量:1794759

SpringBoot启动报循环依赖错误This is often the result of over

SpringBoot启动报循环依赖错误This is often the result of over

报错信如下:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'areaCheckController': Unsatisfied dependency expressed through field 'areaCheckService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'areaCheckServiceImpl': Unsatisfied dependency expressed through field 'projectFileService'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'projectFileServiceImpl': Bean with name 'projectFileServiceImpl' has been injected into other beans [asyncServiceImpl] 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, for example.

从报错信中可以看到是ProjectFileServiceImpl 、AsyncServiceImpl 这两个中循环注入导致的 检查了下代码雀食是这样。 在AsyncServiceImpl 中注入ProjectFileService 在ProjectFileServiceImpl 中注入AsyncService 造成了循环注入 这里是将AsyncServiceImpl中的ProjectFileService 改为注入ProjectFileMapper问题解决可以启动成功。 根据自己的业务需要进行修改避免业务层的循环引用

本文标签: 错误SpringBootresult