org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
来源:互联网 发布:福禄克官网434数据 编辑:程序博客网 时间:2024/05/18 02:38
使用mybatis出现下面问题
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.dao.mapper.UserInfoMapper.countByExample at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:196) at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:44) at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:59) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52) at com.sun.proxy.$Proxy93.countByExample(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java
报错原因是Mapper.xml文件中没有id为countByExample的语句
如果出现:
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
可能原因1
一般的原因是Mapper interface和xml文件的定义对应不上,需要检查包名,namespace,函数名称等能否对应上,需要比较细致的对比,
我经常就是写错了一两个字母搞的很长时间找不到错误
按以下步骤一一执行:
1:检查xml文件所在的package名称是否和interface对应的package名称一一对应
2:检查xml文件的namespace是否和xml文件的package名称一一对应
3:检查函数名称能否对应上
4:去掉xml文件中的中文注释
5:随意在xml文件中加一个空格或者空行然后保存
可能原因2
点击project->clean
在xml中,sql语句写错,表名写错,逗号写成中文的
阅读全文
0 0
- 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)
- 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)
- NAT技术与代理服务器
- java学习一定要掌握静态方法和属性
- 【poj1004】Financial Management 题解&代码(c++)
- iOS开发 UITest的使用
- linux怎么修改ftp密码
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- 软件工程(C编码实践篇)学习总结
- Bloom Filter概念和原理
- Spring Boot 整合 Redis 实现缓存操作
- 深入探讨操作系统的内存管理——虚拟内存与物理内存
- linux压缩和解压命令
- JS中continue在while循环、do-while循环以及for循环中的用法
- Linux基于单链表&环形队列的多线程生产者消费者模型
- 【spark你妈喊你回家吃饭-05】RDD编程之旅基础篇-01