源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

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

  • 时间:2021-04-25 14:05 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:MyBatis绑定错误提示BindingException:Invalid bound statement (not found)的解决方法
如果出现:   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)的解决方法,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对编程素材网网站的支持!
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部