软件编程
位置:首页>> 软件编程>> java编程>> MyBatis绑定错误提示BindingException:Invalid bound statement (not found)的解决方法

MyBatis绑定错误提示BindingException:Invalid bound statement (not found)的解决方法

作者:luo奔的蜗牛  发布时间:2021-10-22 03:58:44 

标签:mybatis,绑定错误,not,bound

如果出现:

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

一般的原因是Mapper interface和xml文件的定义对应不上,需要检查包名,namespace,函数名称等能否对应上。

按以下步骤一一执行:

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

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

3、检查函数名称能否对应上

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

5、随意在xml文件中加一个空格或者空行然后保存

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

如下:


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

以上所述是小编给大家介绍的MyBatis绑定错误提示BindingException:Invalid bound statement (not found)的解决方法网站的支持!

来源:http://www.cnblogs.com/Cayenne/archive/2017/01/24/6346895.html

0
投稿

猜你喜欢

手机版 软件编程 asp之家 www.aspxhome.com