zoukankan      html  css  js  c++  java
  • Mybatis报错org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)问题解决办法汇总

    今天遇到了这个错误:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found),结果查询出来的办法如下:

    1. mybatis的xml文件的命名空间写错,命名空间应该是xml对应的数据接口类。
      例如:类名是com.xxx.dao.MyMapper接口,那么xml就应该配置成
    2. mybatis的xml文件中没有数据接口类中接口对应的方法,或者方法参数有误。
      例如:接口类中定义了public List listMyBean(MyBean bean),那么xml中应该有<select id="listMyBean" parameterType="com.xxx.bean.MyBean" resultType="com.xxx.bean.MyBean"></select>的标签
    3. mybatis的xml和数据接口类所在的包一致,或者配置mybatis.mapper-locations参数。
      例如: 如果类名是com.xxx.dao.MyMapper接口,那么对应方式的xml有如下配置:
      a. xml放在resources目录下的com/xxx/dao/MyMapper的目录下;
      b. xml放在resources目录下的指定目录下(例如mapper目录),则在application.xml中指定mybatis.mapper-locations(例如:mybatis.mapper-locations= classpath:/mapper/*.xml)
      或者在application.yml中指定
      mybatis:
      mapper-locations: classpath:/mapper/*.xml
      这个样子。
  • 相关阅读:
    HTTP协议详情
    HTTP入门
    DNS vs CDN
    TCP/IP协议和互联网协议群
    常用docker镜像
    linq to sql 把数据库连接字段写入配置文件
    微信开发--one.微信平台验证
    项目--ajax上传文件(本次是图片)(.net)
    项目--Repeater嵌套横向显示
    项目--物流查询实现
  • 原文地址:https://www.cnblogs.com/Lenbrother/p/13041785.html
Copyright © 2011-2022 走看看