mybatis报错:Invalid bound statement (not found)
错误原因:mapper文件不匹配
- 检查 mapper 文件有没有写错
- 检查 mapper 的导入配置,注意不能跨包导入 mapper
- 检查 target/classes 里有没有生成对应的 mapper 文件,如果没有,解决办法如下
在pom.xml中加入以下配置,并clean后重新编译
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.*</include>
</includes>
</resource>
</resources>
</build>