No MyBatis mapper was found in '[XXXX]' package. Please check your configuration.

SpringBoot+Mybatis整合,后执行,报错 ,No MyBatis mapper was found in '[XXXX]' package. Please check your configuration.

第一步,检查applications.yml配置文件,

mybatis:
  typeAliasesPackage: pojo路径
  mapperLocations: classpath:mapper/*.xml

第二步,检查mapper.xml文件中的路径是否正确

第三步,在Application文件中增加

@MapperScan("XXX.XXX.XXX.mapper")

第四步,在mapper.java中增加注解@Mapper

添加第三步和第四步内容后,启动成功!

你可能感兴趣的:(SpringBoot)