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 ...
随机推荐
- 本博文将一步步带领你实现抽屉官网的各种功能:包括登陆、注册、发送邮箱验证码、登陆验证码、页面登陆验证、发布文章、上传图片、form验证、点赞、评论、文章分页处理以及基于tronado的后端和ajax的前端数据处理。
本博文将一步步带领你实现抽屉官网的各种功能:包括登陆.注册.发送邮箱验证码.登陆验证码.页面登陆验证.发布文章.上传图片.form验证.点赞.评论.文章分页处理以及基于tronado的后端和ajax的 ...
- ZOJ 3956 Course Selection System
题意 有n节课可供选择,每节课都有两个值Hi和Ci,如果学生选择了m节课(x1,x2,....,xm),则它的舒适值被定义为: //这里没有公式((lll¬ω¬)),因为那个图片我保存不下来≧ ﹏ ≦ ...
- 13-爬取百度贴吧中的图片(python+xpath)
通过xpath分析页面,爬取页面中的图片: #_*_ coding: utf-8 _*_ ''' Created on 2018年7月15日 @author: sss function: 使用xpat ...
- 解决在Python中使用Win32api报错的问题,No module named win32api
一.系统环境 操作系统: Win7 64位 Python:3.7.0 二.在使用import win32api时,报错:No module named win32api 网上查到有下面解决办法: 方法 ...
- Fedora 16下安装ruby on rails
Fedora 16下安装ruby on rails 最近在windows下写了些rails小程序,问题一个接一个,到最后终于坚信了那句话“windows不适合用于ruby on rails开发”.于是 ...
- IFM设备 Linux方面资料
Github: https://github.com/lovepark/ifm3d
- integer encoding vs 1-hot (py)
https://github.com/szilard/benchm-ml/issues/1 glouppe commented on 7 May 2015 Thanks for the benchma ...
- 解决IE与FF 中 input focus 光标移动在最后的方案
只要把input元素的id传进来即可 function moveCursor(id) { var id = document.getElementById(id); id.focus(); var ...
- 关于pycharm字体大小的调整
我们平常编写pyhton 可以用sublime eclipse 但是eclipse在后期需要安装很多插件,这很是麻烦,为了避免这种麻烦,我们采用pycharm来编写,但是刚装上的该软件 不建议同学们进 ...
- web端测试点汇总
前言 前面一篇文章讲解了app测试一些功能点.那么相应的也梳理一下web测试相关的功能的测试点吧,此篇文章只是给你们一个思路,如果要涉及web端每个测试点,基本不可能实现的,所以只是提供一个设计的思路 ...