spring注入时报错(:No qualifying bean of type 'xxx.xxMapper')

曾无好事来相访,赖尔高文一起予。这篇文章主要讲述spring注入时报错::No qualifying bean of type ' xxx.xxMapper' 相关的知识,希望能为你提供帮助。
 
做一个小项目,因为有 baseService,所以偷懒就没有写单独的每个xxService接口,直接写的xxServiceImpl,结果在service实现类中注入Mapper的时候,用的 @Autowired,
结果,junit一启动,就报错误:java.lang.illegalStateException:Failed to load ApplicationContext
具体是在 创建bean的时候报:No qualifying bean of type ‘xxx.xxMapper‘ abailable:expected at least 1 bean which qualifies as autowire candidate.......
错误,
经过百度即测试,发现解决方法是:
【spring注入时报错(:No qualifying bean of type ' xxx.xxMapper' )】在@Autowired 注解下面加上@Qualifier(“xxxxxMapper”)注解

    推荐阅读