org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)问题
我总结了在这个问题上解决思路。
解决办法:
1. 检查xml文件头部的nampspace的值是否和dao层对应的名字一样:
2.在dao层中InsertMapper接口的方法名与xml中id属性的值不一致:
3.dao层返回值是List<>,而在xml的select中没有正确配置返回参数resultMap,resultType
或者
4.查看报错对应的文件在target文件夹或out文件夹中是否有编译
如果没有,在pom文件加入以下配置
<!-- 如果不添加此节点mybatis的mapper.xml文件都会被漏掉。 -->
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</build>
5.查看xml中的inset、select、update 的主要属性是否配置正确,能简单就简单,(我遇到过多加了多余的其他属性配置报错的情况)
以上是我总结的经验。