文章目录

  • 1.问题现象
  • 2.解决方法
  • 3.说明

1.问题现象

先说一下自己的配置
1.mapper接口上有@mapper

2.启动类类上有@mapperSacn(“路径”)

3.yml配置文件里面指定xml文件位置

运行程序报错

No qualifying bean of type 'com.hhf.springbootshiro.mapper.UserMapper' available:
expected at least 1 bean which qualifies as autowire candidate. 
Dependency annotations:{@org.springframework.beans.factory.annotation.Autowired(required=true)}

No qualifying bean of type ‘com.hhf.springbootshiro.mapper.UserMapper’
一看就是UserMapper的bean没有注入。

2.解决方法

将启动类上面的@MapperScan注解删除,再次运行成功。

3.说明

使用mybatis-plus就不要使用@MapperScan(“”)注解了

更多推荐

mybatis-plus的mapper无法自动注入