当mybatis整合spring后出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
2017-03-17 12:55
1016 查看
今天把项目所需的架包和配置配好后,运行项目, 却报出这个错误:
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说我找不到这个dao接口的方法,可是我明明在写的都对应着,为什么找不到呢?搜索了一下:对应的Dao和mapper.xml文件对应不上,所以就开始了更改的过程 首先是把dao接口和mapper里的配置文件名要一致:例如 UserDao.Java 和 UserDaoMapper.xml第二就是 看 mapper.xml 里的namespace里对应的dao接口 写对没, 然后再看 在dao接口中的这个方法名是否和mapper.xml 里的ID对应, 然后点击保存。 重启了后试下, 问题 解除.按照别人整合的解决方法是:按以下步骤一一执行:1:检查xml文件所在的package名称是否和interface对应的package名称一一对应2:检查xml文件的namespace是否和xml文件的package名称一一对应3:检查函数名称能否对应上4:去掉xml文件中的中文注释5:随意在xml文件中加一个空格或者空行然后保存一般来说到此就可以排除错误了希望大家不要出错哦,配置 真心感觉 是坑啊 一步错 就要花几个小时去找错。
相关文章推荐
- spring boot 整合mybatis org.apache.ibatis.binding.BindingException: Invalid bound statement(not found)
- spring+mybatis整合报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- mybatis+springmvc:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- 关于整合SSH,出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- mybatis maven打包出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误
- ssm整合出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误
- spring mybatis集成报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- mybatis整合springmvc时的错误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)
- 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)” 错误的问题。
- IDEA的maven项目出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误解决方法
- Maven 遇到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)”
- mybatis使用时org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):的错误
- mybatis绑定错误:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- mybatis使用bug:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):