intellij 报错信息如下图:
intellij中springboot+mybatis @Mapper注解提示Could not autowire

CityDao使用的@Mapper注解,由于此注解是mybatis的解释注解,并不属于spring,所以intellij中会有此报错,但是并不影响运行,经测试有以下两种方式可以去掉intellij中的报错:
1、CityDao中增加@Repository注解;
2、CityDao中@Mapper注解修改为@Component注解。
如下图所示:
intellij中springboot+mybatis @Mapper注解提示Could not autowire

相关文章:

  • 2021-06-04
  • 2021-08-02
  • 2021-06-23
  • 2022-12-23
  • 2021-09-25
  • 2021-08-11
  • 2021-05-07
猜你喜欢
  • 2021-09-20
  • 2021-09-26
  • 2021-05-06
  • 2021-11-29
  • 2022-12-23
相关资源
相似解决方案