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

编程知识 更新时间:2023-05-02 05:25:47

报错信息如下:

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

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

更多推荐

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

本文发布于:2023-04-26 06:04:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/f938e70dce49df01406c235b51501f75.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   result   SpringBoot   matching   type

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 104404文章数
  • 26214阅读数
  • 0评论数