zoukankan      html  css  js  c++  java
  • org.apache.ibatis.binding.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>
  • 相关阅读:
    powershell和cmd区别
    装饰器笔记
    url参数和字典的相互转化
    Python装饰器详解
    python字符串格式化f-string
    Python函数(function)与方法(method)区别
    jenkins钉钉插件报错keywords not in content
    jenkins配置邮件
    vim常用操作
    Vue之axios请求
  • 原文地址:https://www.cnblogs.com/JpfBlog66/p/14242427.html
Copyright © 2011-2022 走看看