在IDEA中将xxxMapper.xml文件创建在(src/main/java)目录中,运行报错:
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):com.gentlehu.diary.mapper.TestMapper.findById(id);

意思是没找到TestMapper的findById方法还有这个类的其他方法。

找了好久,发现在idea生成的classes中没有DiaryMapper.xml文件。

原来在IDEA中目录是普通属性,所以它的(src/main/java)目录中的只有.java文件会默认编译,.xml文件不会被编译。

而在MyEclipse中可以运行的,因为MyEclipse中建立的是目录(src/main/java)的属性是资源目录,所以MyEclipse识别了这个属性会自动把这个目录的所有内容编译生成在classes中。

所以需要在maven的pom.xml中配置一下节点

<project>
......
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</build>
</project>

然后IDEA才会编译.xml文件。

解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)...的更多相关文章

  1. IDEA异常解决: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

    有时候解决问题不仅仅是解决问题.-----jstarseven 最近因为开发需要,需要搭建一个ssm开发框架,采用了开发工具IDEA. 整合完了SSM开发框架之后,发布的时候出现org.apache. ...

  2. 完美解决: org.apache.ibatis.binding.BindingException Invalid bound statement (not found)

    异常描述: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 原因: springboot ...

  3. 解决 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 以及MyBatis批量加载xml映射文件的方式

    错误 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 的出现,意味着项目需要xml文件来 ...

  4. 解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.xyfer.dao.UserDao.findById

    在使用Spring整合MyBatis的时候遇到控制台报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (no ...

  5. 解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误

    我调这个bug调了一天多,在网上搜索的检查namespace,package等,都没有错.错误提示是没有找到xml文件,我就纳闷了,为什么找不到呢?后来才发现,原来是resource中奇怪的目录为题, ...

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

    原因: 此异常的原因是由于mapper接口编译后在同一个目录下没有找到mapper映射文件而出现的.由于maven工程在默认情况下src/main/java目录下的mapper文件是不发布到targe ...

  7. Java报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.sirifeng.babytun.dao.GoodsDAO.findById

    前言 最近学vue学得差不多了,想来搭个项目实战一下,结果刚开始搭建SSM框架的时候就来到了我们最喜欢的debug环节 org.apache.ibatis.binding.BindingExcepti ...

  8. 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 ...

  9. maven 项目报错org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)解决

    idea在使用maven构建的项目中使用mybatis时报错org.apache.ibatis.binding.BindingException: Invalid bound statement (n ...

随机推荐

  1. STM32H743 | FDCAN 波特率问题

    直奔主题,最近项目上接触了FDCAN,主控为STM32H743.在开发过程中存在了几点疑惑,特此记录. 波特率设置问题 CAN通讯的波特率计算方式为: BaudRate = Tq *(SYNC_SEG ...

  2. MySQL 面试题 24 问

    MySQL 是数据库中的主流中的主流,小中性公司基本都以它为主,而作为后端开发和数据库工程师来说,MySQL 是面试必须要过的一关.以下是小编整理网络的 MySQL 面试高频题,希望对大家有所帮助. ...

  3. 使用位运算、值交换等方式反转java字符串-共四种方法

    在本文中,我们将向您展示几种在Java中将String类型的字符串字母倒序的几种方法. StringBuilder(str).reverse() char[]循环与值交换 byte循环与值交换 apa ...

  4. DirectX11 With Windows SDK--34 位移贴图

    前言 在前面的章节中,我们学到了法线贴图和曲面细分.现在我们可以将这两者进行结合以改善效果,因为法线贴图仅仅只是改善了光照的细节,但它并没有从根本上改善几何体的细节.从某种意义上来说,法线贴图只是一个 ...

  5. 第四章:View的工作原理

    4.1 ViewRoot和DecorView ViewRoot对应于ViewRootImplement类,它是连接WindowManager和DecorView的纽带,View的三大流程均是通过Vie ...

  6. Python Ethical Hacking - VULNERABILITY SCANNER(9)

    Automatically Discovering Vulnerabilities Using the Vulnerability Scanner 1. Modify the run_scanner ...

  7. noi-vim配置

    colorscheme ron set t_Co=256 set mouse=a set ts=4 set sw=4 set nu set ru set ai set ci set cin set l ...

  8. PyQt5布局管理器

    布局分类 绝对定位:使用move方法将空间直接定死在某个坐标,不会随着窗口大小的改变而改变 可变布局:使用各种布局管理器,实现组件的位置和大小随着窗口的变化而变化 布局管理器 QHBoxLayout: ...

  9. DJANGO-天天生鲜项目从0到1-014-订单-订单评论

    本项目基于B站UP主‘神奇的老黄’的教学视频‘天天生鲜Django项目’,视频讲的非常好,推荐新手观看学习 https://www.bilibili.com/video/BV1vt41147K8?p= ...

  10. maven项目打包到本地库 两种方式

    方式一 1.项目根路径下 maven clean package 或者 maven package ,根据是否需要跳过代码中的测试代码 加上 -DskipTests 2.mvn install:ins ...