ssm报错之 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
来源:互联网 发布:刚出土的兵马俑知乎 编辑:程序博客网 时间:2024/06/07 06:54
这个问题纠结了一个下午:主要原因请看第一,楼主就是这个错误纠结的
报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
解释:就是说,你的Mapper接口,被Spring注入后,却无法正常的使用mapper.xml的sql;
这里的Spring注入后的意思是,你的接口已经成功的被扫描到,但是当Spring尝试注入一个代理(MyBatista实现)的实现类后,却无法正常使用。这里的可能发生的情况有如下几种;
- 接口已经被扫描到,但是代理对象没有找到,即使尝试注入,也是注入一个错误的对象(可能就是null)
- 接口已经被扫描到,代理对象找到了,也注入到接口上了,但是调用某个具体方法时,却无法使用(可能别的方法是正常的)
一:如果你的项目是maven项目,请你在编译后,到接口所在目录看一看,很有可能是没有生产对应的xml文件,因为maven默认是不编译的,因此,你需要在你的pom.xml的<build></build>里面,加这么一段:
<resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.xml</include> </includes> <filtering>true</filtering> </resource> </resources>另外:
- mapper接口和mapper.xml是否在同一个包(package)下?名字是否一样(仅后缀不同)?
- mapper.xml的命名空间(namespace)是否跟mapper接口的包名一致?
- 接口的方法名,与xml中的一条sql标签的id一致
- 如果接口中的返回值List集合(不知道其他集合也是),那么xml里面的配置,尽量用resultMap(保证resultMap配置正确),不要用resultType
参考:http://blog.csdn.net/ppppfly/article/details/46847299
阅读全文
1 0
- ssm报错之 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- 关于ssm框架整合报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- SSMF maven项目 mybatis报错org.apache.ibatis.binding.BindingException: Invalid bound statement (not found
- mybatis的 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): 报错。
- maven 项目,mybatis报错org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- spring mybatis集成报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- mybatis报错org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): 解决方法
- MyBatis报错org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- maven请求报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- spring+mybatis整合报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- jquery获取当前页面的URL信息
- 二叉树的前中后遍历推导
- 第九篇 蓝牙配对
- 与dalao学校的联shou考wan(11.2)(dp+乱搞+树形dp+期望)
- 打包的msi,在别人电脑找不到网络位置、MFC RC 4005: IDCANCEL:redefinition
- ssm报错之 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- es6从入门到放弃之let,const,块级作用域
- MySQL密码错误,忘记密码无法进入服务,修改密码
- 多行实现文本溢出效果(实用)
- WebService
- 从CSV文件导入Hive出现中文乱码问题解决
- KVM详解,太详细太深入了,经典
- 11.02-HTML的常规使用以及作业
- 嵌入式hi3516-hi3518海思平台移植nginx-1.12.2