做一个小项目,因为有 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.......

错误,

经过百度即测试,发现解决方法是:

在@Autowired 注解下面加上@Qualifier(“xxxxxMapper”)注解

相关文章:

  • 2022-12-23
  • 2021-06-13
  • 2022-12-23
  • 2021-12-18
  • 2021-08-04
  • 2021-04-09
  • 2021-11-14
  • 2021-09-09
猜你喜欢
  • 2022-02-06
  • 2022-12-23
  • 2022-12-23
  • 2021-08-08
  • 2021-09-04
  • 2021-08-06
  • 2022-12-23
相关资源
相似解决方案