Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement

原因: 此异常的原因是由于mapper接口编译后在同一个目录下没有找到mapper映射文件而出现的。由于maven工程在默认情况下src/main/java目录下的mapper文件是不发布到target目录下的。
解决方法:
在dao的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>
IDEA异常解决: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
有时候解决问题不仅仅是解决问题。-----jstarseven
最近因为开发需要,需要搭建一个ssm开发框架,采用了开发工具IDEA。
整合完了SSM开发框架之后,发布的时候出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found。。。
一开始以为是自己配置文件写的有问题找了半天也没有问题,之后才发现是自己对IDEA工具使用的不够熟悉。
先说该异常常见解决方案:
发布之后target目录中:

居然没有xml文件,突然意识到了异常的原因:
idea中我将mapper类型是source,而xml文件在发布时不会编译,同时也不会发布到target中,导致项目运行时找不到mapper.xml文件。
解决方案:我将*Mapper.xml文件提取到指定文件夹mapper中,设置mapper文件夹类型为resource,在application-dao.xml配置文件中添加图片中框选的代码对mapper文件进行扫描。问题解决。

总结:
(1)eclipse、myeclipse、idea针对项目的文件处理方式不一样。
eclipse和myeclipse中mapper.java和mapper.xml在同一目录下,直接配置扫描不会出现上述问题。
(2)注意xml文件的准确性。
Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement的更多相关文章
- HTTP Status 500 - Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
今天整合ssm框架 时 遇到的问题 困扰我好长时间 原因就是 mapper文件 没有被加载进来 但是 为什么没有被加载进来呢 因为中间的配置文件出了一些问题 网上大多数说法是 在pom ...
- Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid b
Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid b ...
- spring boot集成mybatis-plus插件进行自定义sql方法开发时报nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
spring boot集成mybatis-plus插件进行自定义sql方法开发时报nested exception is org.apache.ibatis.binding.BindingExcept ...
- HTTP Status 500 - Request processing failed; nested exception is org.apache.ibatis.binding.BindingException
在使用Maven工程管理工具整合SSM框架时,Mybatis使用逆向工程生成的pojo,mapper接口及映射文件,把mapper接口和映射文件放在DAO工程的同一级src/main/java目录下. ...
- Exception:Request processing failed; nested exception is org.apache.ibatis.binding.BindingException
异常 在测试Spring MVC+Mybatis整合时,运行 Maven build -> tomcat7:Run 遇到如下异常 从异常信息上看,是找不到mapper对应的xml文件,于是我到t ...
- [springMVC - 1A] - Request processing failed; nested exception is org.apache.ibatis.builder.IncompleteElementException
一月 14, 2016 1:30:07 下午 org.apache.catalina.core.StandardWrapperValve invoke严重: Servlet.service() for ...
- Exception:HTTP Status 500 - org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
主要错误信息如下: HTTP Status 500 - org.apache.ibatis.binding.BindingException: Invalid bound statement (not ...
- MyBatis笔记----报错Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.ij34.model.UserMapper.selectUser
信息: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@41cf53f9: startup ...
- MyBatis笔记----报错:Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)解决方法
报错 Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound st ...
随机推荐
- 配置环境是程序员的第一步 -- Xshell 6 免费版下载安装
Xshell 是一个强大的安全终端模拟软件,通常用来连接云主机,远程控制云主机. 很多人都不知道 Xshell 有专门为家庭和学校用户提供的免费版,只需要填个用户名和邮箱即可. 免费版链接:https ...
- Init & Deinit & ARC
[Init & Deinit] 1.switf中,init不返回值,只负责初始化成员变量.在init方法中可以初始化常量. 2.默认初始化. 3.Swift provides an autom ...
- JUNIT的用法简要总结
JUNIT是一个单元测试框架,可以用来测试我们程序中的某个模块是否工作正常.而不需要去写一个MAIN函数来测试,方便快捷. 经过对博客http://blog.csdn.net/andycpp/arti ...
- 【NOIP2008】传纸条
[描述] Description 小渊和小轩是好朋友也是同班同学,他们在一起总有谈不完的话题.一次素质拓展活动中,班上同学安排做成一个m行n列的矩阵,而小渊和小轩被安排在矩阵对角线的两端,因此,他们就 ...
- 把dataTable表批量的写入数据库
connectionStr:链接字符串:dataTableName数据库中的表:sourceDataTable dataTable的名称 public static void SqlBulkCopyB ...
- 733. Flood Fill 简单型染色问题
[抄题]: An image is represented by a 2-D array of integers, each integer representing the pixel value ...
- Linux extundelete命令
一.简介 extundelete的文件恢复工具,支持ext3/ext4双格式分区恢复. 二.安装 yum install -y e2fsprogs* e2fslibs* wget http://nch ...
- swift基本运算
swift运算有单目运算,双目运算和三元运算 1:赋值操作 iX = iY//iX is 8 元组赋值 let (iX, iY = (, ) // iX is 8, iY is 7 和c语言不同的是, ...
- CF 1091E New Year and the Factorisation Collaboration
昨晚Good Bye 2018D题没做出来,车翻大了…… 官方题解 传送门 初赛知识:一个无向图所有顶点度数之和为偶数.然而这东西还有一个高端的名字:Handshaking lemma 但是 ...
- Windows下用Nginx配置遇到的问题
Nginx是一款轻量级的web服务器/反向代理服务器,更详细的释义自己百度了.目前国内像新浪.网易等都在使用它.先说下我的服务器软件环境: 系统:Windows Server + IIS + ngin ...