springboot 项目使用 mybatis 时报错 No MyBatios mapper was found in '[xxx mapper]' package Pleas check you configureation
现象
在spring boot项目中,使用mybatis-plus 会出现如下提示。
1 | |
分析解决
出现该报错,主要检查以下4点:
项目中有无该
xxxMapper.java文件;
相关 Mapper.xml 文件的 namespace 等关联包信息是否匹配,namespace 对应于项目中文件位置;

配置文件的路径信息是否填错;

注:该文件路径需要在 resource 文件夹下,如果没有在 resource 文件夹下,需要在 pom 文件中配置。
检查注解,
@Mapper和@MapperScan不能同时存在项目中。截图保留了mapper.java文件中的@Mapper注解。

springboot 项目使用 mybatis 时报错 No MyBatios mapper was found in '[xxx mapper]' package Pleas check you configureation
https://flepeng.github.io/021-Java-71-问题-02-springboot-springboot-项目使用-mybatis-时报错-No-MyBatios-mapper-was-found-in-xxx-mapper-package-Pleas-check-you-configureation/