典型的找不到mapper映射文件的异常 Invalid bound statement 异常
2017-06-30 22:58
441 查看
淘淘商城项目找不到mapper映射文件的异常
如下提示
org.apache.ibatis.binding.BindingException:
Invalid bound statement (not found): com.taotao.mapper.TbItemMapper.selectByExample
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.$Proxy30.selectByExample(Unknown Source)
at com.taotao.service.impl.ItemServiceImpl.getItemById(ItemServiceImpl.java:39)
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.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
......
......
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
原因
pom.xml文件默认不拷贝到class路径下,
解决方法
修改taotao-manager-mapper的pom文件
在pom文件中添加如下内容:
如下提示
org.apache.ibatis.binding.BindingException:
Invalid bound statement (not found): com.taotao.mapper.TbItemMapper.selectByExample
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.$Proxy30.selectByExample(Unknown Source)
at com.taotao.service.impl.ItemServiceImpl.getItemById(ItemServiceImpl.java:39)
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.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
......
......
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
原因
pom.xml文件默认不拷贝到class路径下,
解决方法
修改taotao-manager-mapper的pom文件
在pom文件中添加如下内容:
<!-- 如果不添加此节点mybatis的mapper.xml文件都会被漏掉。 --> <build> <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> </includes> <filtering>false</filtering> </resource> </resources> </build> |
相关文章推荐
- 找不到mapper映射文件异常:Invalid bound statement (not found)
- 惨痛的教训总结:SSM整合中包Mpper映射文件不存在Invalid bound statement
- MYBATIS异常:INVALID BOUND STATEMENT
- 解决淘淘商城找不到mapper映射文件的错误
- springboot 集成mybatis Invalid bound statement (not found)异常
- Invalid bound statement (not found) 异常原因
- Invalid bound statement (not found): com.taotao.mapper.TbItemMapper.selectByExample: 错误
- 关于MAVEN工程中找不到mapper的映射文件的处理方案
- Invalid bound statement (not found): com.zc.product.dao.IFancyMapper.totalPage
- mybatis invalid bound statement (not found) 当心文件确实不存在
- 关于hibernate映射文件配置异常:InvalidMappingException: Could not parse mapping document
- 关于org.apache.ibatis.binding.BindingException: Invalid bound statement (not found),找不到mapper文件问题解决
- Invalid bound statement (not found):.....sysFunctionDao.getSysFunctionsById...<init>(MapperMethod.ja
- Invalid bound statement (not found): 异常
- springboot 集成mybatis Invalid bound statement (not found)异常
- invalid bound statement (not found),大概应该是报mapper.xml中的sql查询和mapper.java中的方法没有绑定成功!
- Mapper的XML映射文件---2.2: 设置(settings)
- 未能加载文件或程序集“XXXXX”或它的某一个依赖项。参数错误。 (异常来自 HRESULT:0x80070057 (E_INVALIDARG))
- 能加载文件或程序集 HRESULT:0x80070057 (E_INVALIDARG)的异常的解决方案
- Mapper的XML映射文件---2.1: 属性(properties)