原因:
没有找到mapper文件的位置;
第一确定pom文件里是否讲xml文件处理:
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
第二种情况:
需要在配置文件application.properties 里加上如下配置,这样才能找到mapper文件的目录:
mybatis.mapper-locations=classpath:mybatis/com/jxtj/*Mapper.xml
我放置的位置是在:
=========================================================
mybatis其他配置: