org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.misaki.mapper.UserMapper'

报错:找不到对应Mapper

原因:当时使用Springboot+MybatisPlus代码生成器,直接就启动了,算是一个小失误

解决:在Springboot启动项上添加@MapperScan注解,或者在每个Mapper上添加@Mapper注解

@MapperScan(basePackages = "com.misaki.mapper")
@SpringBootApplication
public class TestApplication {
    public static void main(String[] args) {
        SpringApplication.run(TestApplication.class, args);
    }
}

 

org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.misaki.mapper.UserMapper'

上一篇:手机端h5页面 图片根据手势放大缩小


下一篇:android 下载工具类,贼好用