binding.BindingException: Invalid bound statement(not found)
来源:互联网 发布:网站安全狗apache版 编辑:程序博客网 时间:2024/06/15 23:52
binding.BindingException: Invalid bound statement(not found)
数据库无法操作的问题,查看classes文件夹是不是mapping文件夹并没有打包进去。
我的解决办法是把mapping文件夹直接生成到resource文件夹下。由于我的文件都是generator自动生成的所以不存在写错的情况。
具体异常信息:
- 2016-07-04 09:57:28.262 [DEBUG] org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver-->Resolving exception from handler [public org.jiankunking.test2016.system.member.entity.ResultEntity org.jiankunking.test2016.Controller.EcWarehouseController.getJoinList(java.lang.String,java.lang.String,java.lang.String,int) throws java.lang.Exception]: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): org.jiankunking.test2016.system.member.dao.EcWarehouseMapper.getJoinList
- 2016-07-04 09:57:28.263 [DEBUG] org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver-->Resolving exception from handler [public org.jiankunking.test2016.system.member.entity.ResultEntity org.jiankunking.test2016.Controller.EcWarehouseController.getJoinList(java.lang.String,java.lang.String,java.lang.String,int) throws java.lang.Exception]: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): org.jiankunking.test2016.system.member.dao.EcWarehouseMapper.getJoinList
- 2016-07-04 09:57:28.264 [DEBUG] org.jiankunking.test2016.component.exception.MyExceptionResolver-->Resolving exception from handler [public org.jiankunking.test2016.system.member.entity.ResultEntity org.jiankunking.test2016.Controller.EcWarehouseController.getJoinList(java.lang.String,java.lang.String,java.lang.String,int) throws java.lang.Exception]: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): org.jiankunking.test2016.system.member.dao.EcWarehouseMapper.getJoinList
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): org.jiankunking.test2016.system.member.dao.EcWarehouseMapper.getJoinList
- at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:189)
- at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:43)
- at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58)
- at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51)
- at com.sun.proxy.$Proxy37.getJoinList(Unknown Source)
- at org.jiankunking.test2016.system.member.service.Impl.EcWareHouseServiceIpml.getJoinList(EcWareHouseServiceIpml.java:35)
- at org.jiankunking.test2016.Controller.EcWarehouseController.getJoinList(EcWarehouseController.java:48)
- at org.jiankunking.test2016.Controller.EcWarehouseController188cfe05.invoke(<generated>)
FastClassBySpringCGLIB - at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
- at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:649)
- at org.jiankunking.test2016.Controller.EcWarehouseControlleref7eaafb.getJoinList(<generated>)
EnhancerBySpringCGLIB - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
- at java.lang.reflect.Method.invoke(Method.java:606)
- at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
- at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
- at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
- at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776)
- at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705)
- at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
- at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
本来跑的好好的代码,今天再一跑发现报出上面所示的问题。
然后百度,基本上都是下面的建议:
1、命名空间与类名是否正确
2、注意对比xml文件及接口中方法名、参数类型、返回值类型是否一致
首先,之前可以跑,而代码又没有修改说明,说明应该不是上面截图所示的问题,但我还是对比了一下,发现木有问题。
那会不会是target生成的jar中缺少mapper接口文件呢?
与mybatis相关的mapper接口文件、mapper.xml文件、实体类文件一个都不少。
然后,询问项目组同事他们那边是不是也出现了这种异常,发现最近从服务器获取过代码的,都出现了这个问题,这就排除了我代码的问题了
那会是哪里的问题呢?是不是谁修改mybatis的配置文件了呢?问了下负责这块的同事,同事说没有。
那会是哪里的问题呢?然后对比项目的中pom.xml发现:
获取代码后的pom.xml中多了一个依赖项,然后屏蔽掉该依赖项发现异常消失。
为什么多一个依赖项,就会出现这个异常?而且出现异常的时候jiankunking-product中访问数据库的函数是没有问题的?
通过咨询发现是:一个*引发血案![惊恐](http://static.blog.csdn.net/xheditor/xheditor_emot/default/panic.gif)
![惊恐](http://static.blog.csdn.net/xheditor/xheditor_emot/default/panic.gif)
那么这个星号是用来做什么的呢?
classpath*:的出现是为了从多个jar文件中加载相同的文件.classpath:只能加载找到的第一个文件.
问题解决。
那如果都不是这些原因呢?
请查看ide生成的jar文件中有没有将你需要的xml文件打包进去!
打包不进去有可能是ide出问题,ide里面的插件出问题了,重启一下ide,重启一下系统试试,谁让用的是盗版呢?![大哭](http://static.blog.csdn.net/xheditor/xheditor_emot/default/wail.gif)
![大哭](http://static.blog.csdn.net/xheditor/xheditor_emot/default/wail.gif)
-----------------------------------------------------------------------------------------------------------------------------------------------------
2016.08.24 续(修改 Project Structure 中丢失xml文件对应文件夹的类型试试,具体操作如下图)
-----------------------------------------------------------------------------------------------------------------------
作者:jiankunking 出处:http://blog.csdn.net/jiankunking
- 顶
- 0
- 踩
- 0
- 上一篇Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already
- 下一篇Spring学习笔记一: Bean工厂(BeanFactory )与应用上下文(ApplicationContext)BeanFactory
相关文章推荐
- • 关于mybatis的org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- • Invalid bound statement (not found)错误的可能原因
- • mybatis 异常处理:Invalid bound statement (not found)
- • springboot 集成mybatis Invalid bound statement (not found)异常
- • org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)新的异常解决方案
- • mybatis中定义mapper 出现bound statement (not found)
- • IDEA中Spring Boot项目MyBaits提示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):
- • Invalid bound statement (not found)
阅读全文
0 0
- binding.BindingException: Invalid bound statement(not found)
- 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)
- JsonUtils
- 索引优化
- [YTU]_2434 ( C++习题 商品销售)
- Spring-MVC理解之一:应用上下文webApplicationContext
- oc中少见的不继承于NSObject 的类NSProxy?
- binding.BindingException: Invalid bound statement(not found)
- 廖雪峰的Python-filter
- 仿新闻类实现滑动选择标签(二)
- 剑指offer_和为S 的两个数字
- maven打包成第三方jar包且把pom依赖包打入进来
- Linux基础命令(最基础的,不能再少了)
- STL中的二元函数binary_function
- ps进程命令
- sql