Maven工程中不识别mybatis的Mapper.xml文件问题——mybatis:Invalid bound statement (not found):
2018-01-14 21:54
507 查看
错误背景:
搭建Maven工程时,mybatis报错——Invalid bound statement (not found):
报错如下:
错误原因:
如果不设置的话,pom工程不会加载xml文件,缺少mapper.xml故而报错。
解决方法:
在工程的pom.xml 中添加以下代码
搭建Maven工程时,mybatis报错——Invalid bound statement (not found):
报错如下:
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.geTbItemById(ItemServiceImpl.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
错误原因:
如果不设置的话,pom工程不会加载xml文件,缺少mapper.xml故而报错。
解决方法:
在工程的pom.xml 中添加以下代码
<!-- 如果不添加此节点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>
相关文章推荐
- Maven工程中不识别mybatis的Mapper.xml文件问题
- 关于org.apache.ibatis.binding.BindingException: Invalid bound statement (not found),找不到mapper文件问题解决
- IntelliJ IDEA使用Maven创建Spring和Mybatis工程出现...BindingException: Invalid bound statement (not found)
- 记录Maven和Mybatis整合时打包漏掉mapper的xml文件及其它资源
- 关于mybatis Invalid bound statement (not found) 问题
- 解决idea创建ssm项目找不到mybatis的mapper的xml文件问题
- mybatis一个怪异的问题: Invalid bound statement (not found)
- 创建Spring-Mybatis web项目,解决IDEA下找不到XXXmapper.xml文件的问题
- mybatis一个怪异的问题: Invalid bound statement (not found)
- 使用intellj ide搭建spring+mybatis时无法识别mapper.xml文件
- 记录Maven和Mybatis整合时打包漏掉mapper的xml文件及其它资源
- mybatis的mapper.xml文件扫描注册问题
- Eclipse中Mybatis无法读取xml文件的问题(mybatis绑定错误-- Invalid bound statement (not found))
- mybatis--maven默认不会将java下xml文件打包至classpath导致的问题
- maven 工程 dubbo服务的xml配置文件报错的问题
- 创建Spring-Mybatis web项目,解决IDEA下找不到XXXmapper.xml文件的问题
- Mybatis中mapper.xml文件判断语句中的单双引号问题
- "Invalid bound statement (not found): com.sitech.admin.dao.TbOpenAbilityInfoDao.findAbilityReadyUp"mybatis配置文件bug
- IntelliJ IDEA开发工具springboot集成mybatis后打包的时候.无法打包mapper.xml,或者无法打包resources文件夹下文件问题
- mybatis-generator-maven-plug生成model、mapper、xml映射文件