org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.analyst.mapp...

若是出现:java

  org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)apache

通常的缘由是Mapper interface和xml文件的定义对应不上,须要检查包名,namespace,函数名称等可否对应上。mybatis

按如下步骤一一执行:app

一、检查xml文件所在的package名称是否和interface对应的package名称一一对应函数

二、检查xml文件的namespace是否和xml文件的package名称一一对应spa

三、检查函数名称可否对应上code

四、去掉xml文件中的中文注释xml

五、随意在xml文件中加一个空格或者空行而后保存blog

注意:在使用IDEA开发时,若是打包时*Mapper.xml没有自动复制到class输出目录的mapper类包下,则须要在pom文件中添加mybatis加载配置文件的配置!开发

<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>


相关文章
相关标签/搜索