beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type

ゞ 浴缸里的玫瑰 2023-07-13 12:29 32阅读 0赞

场景:

  1. 多个Module相互依赖,其中的服务模块调用dao模块,出现下面报错。

报错信息如下:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘loanApplyController’: Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘loanApplyServiceImpl’: Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘ccx.coop.mapper.LoanApplyInfoMapper’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@javax.annotation.Resource(shareable=true, lookup=, name=, description=, authenticationType=CONTAINER, type=class java.lang.Object, mappedName=)}

提取关键词:beans.factory.BeanCreationException

出现改异常无非俩个原因

1、引入资源没有注入到bean工厂;

2、引入资源是否有重名嫌疑。

我的解决方法是:在服务模块启动类增加mapper的接口实现:

  1. @MapperScan("ccx.coop.mapper")

发表评论

表情:
评论列表 (有 0 条评论,32人围观)

还没有评论,来说两句吧...

相关阅读