最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

SpringBoot启动报循环依赖错误This is often the result of over-eager type matching - consider using

运维笔记admin4浏览0评论

报错信息如下:

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问题解决可以启动成功。

根据自己的业务需要进行修改避免业务层的循环引用

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论