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

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了No MyBatis mapper was found in '[xx.mapper]' package. Please check your configuration相关的知识,希望对你有一定的参考价值。

参考技术A 为了解决 No MyBatis mapper was found in '[xx.mapper]' package. Please check your configuration 这个问题
尝试了很多种之后,发现此方法不显眼而且有效
添加一个MapBatis的配置类,同时含有扫描包功能
注意:使用的是tk.mybatis的MapperScan注解,对于常规的MapperScan可能没有这个问题

Spring Boot启动时出现WARN:No MyBatis mapper was found in

今天发现spring-boot继承mybatis启动时老是出现WARN:

org.mybatis.spring.mapper.ClassPathMapperScanner - No MyBatis mapper was found in ‘[com.aaa.bbb]‘ package. Please check your configuration.

使用的tk的开源项目进行mybatis集成

查了好多解决方案但是没生效,最后在一篇文章中看到:

doScan()会扫描启动类同级目录下的mapper接口,但是合理的目录结果绝对不允许所有的mapper都在启动类目录下

所以在启动类目录下添加了一个伪mapper

NoWarnMapper.java

技术图片

重新启动服务,warn信息消失

 

以上是关于No MyBatis mapper was found in '[xx.mapper]' package. Please check your configuration的主要内容,如果未能解决你的问题,请参考以下文章

A query was run and no Result Maps were found for...原来是mapper.xml文件出了问题,是使用MyBatis最常见的一种错误

A query was run and no Result Maps were found for the Mapped Statement

ExecutorException: A query was run and no Result Maps were found for the Mapped Statement ‘com.win.m

mybatis+spring boot, mapper 提示Could not autowire. No beans of … type found

myBatis连接MySQL报异常:No operations allowed after connection closed.Connection was implicitly closed(示例代

MyBatis小问题-Mapper中错误No constructor found...