• 一、问题的出现:

调试代码的时候,把mapper.xml中的方法暂时的注释掉了,之后解除注释后,就出现了这个错误。具体报错如下:

  • 二、解决方法:

1 . mapper.xml中的namespace和实际的mapper文件不一致。

 如图中的 namespace,需要和实体类中的mapper一 一对应,否则就会报错。如下图一样,copy reference后放到namespace中就可以解决问题。

 

2 . mapper接口中的方法名和mapper.xml中的id标签不一致

如下图,select id=“xxxxx” ,xxxxx需要和mapper接口中的方法名一致。

 此两处的 findbyid 是需要保持一样的。

3 . target目录下的mapper.xml文件内容与当前的不一致,或者没有构建进target目录。

target目录路径如下图:

(1) target目录下的 mapper.xml 文件内容与当前的不一致

target 文件下的 mapper.xml:

当前的 mapper.xml:

 可以看到target中的被我当时注释掉的。把注释去掉就解决问题了。

(2)没有构建进target目录。

在IDEA终端执行下面的代码 :

mvn cleanmvn compile

Invalid bound statement (not found): com.exam.mapper.UserMapper.findbyid相关推荐

  1. 【Spring+Mybatis】 Invalid bound statement (not found): com.xxxx.mapper.UserMapper.selectUser

    org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.xxxx.mapper.Use ...

  2. spring boot Invalid bound statement (not found): com.su.mapper.UserMapper.getAllUsers

    今天说一下在springboot整合mybatis上遇到的坑,我是看视频学的,跟着视频里建的文件夹是这样的 然后运行程序报错,Invalid bound statement (not found): ...

  3. Invalid bound statement (not found): com.itheima.mapper.userMapper.SelectAll

    根本原因 mapper映射文件没有被加载 最低级原因 1.mapper接口中的方法名和mapper映射文件中的id名是否一致 2mapper映射文件的名称空间的值 是否是mapper接口的权限名(包类 ...

  4. springboot整合mybatis错误 Invalid bound statement (not found): com.yuan.mapper.UserMapper.getUserList

    出现的原因是 src文件下的mapper有mapper接口和映射文件,而target下的mapper文件却没有映射文件 =解决方案======== 1.把映射文件 放到resources 目录下 结构 ...

  5. mybatis-plus出错:Invalid bound statement (not found): com.kuang.mapper.UserMapper.selectList

    错误点: 原因:UserMapper继承BaseMapper,让我们看看BaseMapper 可以发现,BaseMapper使用的是范型.所以上边我们UserMapper继承的BaseMapper也要 ...

  6. mybatis(xml)报错:Invalid bound statement (not found): com.zjw.mapper.second.HospitalMapper.insert(已解决)

    今天开发中遇到一个问题: Invalid bound statement (not found):com.zjw.mapper.second.HospitalMapper.insertSelectiv ...

  7. 解决org.apache.ibatis.binding.BindingException Invalid bound statement (not found) com.fs.mapper.UserM

    首先我们来看看我的修改前的Mapper.xml文件 <mapper namespace="com.fs.mapper.UserMapper"><select id ...

  8. org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.dxm.mapper.User

    IDEA在使用mybatis出现上图报错信息,mybatis核心配置文件 配置如下接口和xml确实放在同一目录下,一直找不到原因,经过3小时的思索,有了发现,原因是在resources下建多层包结构, ...

  9. org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.jt.mapper.UserM

    原因:没有扫描到UserMapper.findAll 方法1:配置文件放在跟resources目录下时:要在application.yml文件中SpringBoot整合Mybatis配置(classp ...

最新文章

  1. 为ubuntu操作系统增加root用户
  2. [转]将Ubuntu默认的邮件客户端Evolution替换为Thunderbird
  3. Java导出Excel或word jsp页面直接转的方式
  4. 直播预告丨爆款独立站如何利用数据提升经营效率?
  5. 《计算机网络》谢希仁第五版考试重点整理
  6. java 调用htm中js函数_Lua中调用C函数(lua5.2.3)
  7. VS2008中对.Net 3.5 sp1程序打安装包的前提系统环境的配置
  8. linux内核3,升级linux内核到3.10
  9. 能在沙漠飞行的翱翔机
  10. 工具分享:VISIO 2010版windows_64正版软件32位(附下载链接)
  11. c3p0 服务启动获取连接超时_一次c3p0连接池连接异常错误的排查
  12. 【蓝桥省赛倒计时】B组Java冲刺打卡(三)
  13. 程序员是如何从小白做到年薪百万
  14. 爱因斯坦《社会和个人 》
  15. JavaScript弹性透明的图片放大代码
  16. Onload ‐ TCP
  17. 跟网络游戏,手机APP游戏告别
  18. 计算器(难度系数:3颗星)
  19. [spm操作] 什么是mask,如何做mask(未完)
  20. 学习笔记(17):零基础掌握 Python 入门到实战-重复利用,事半功倍

热门文章

  1. 类360极速浏览器官网html
  2. 线程池在美团的最佳实践
  3. 初识Kodu开发软件---Kodu少儿编程第三天
  4. django后台添加学生-jquery实现表单正则表达式验证,判断是否可以进行提交
  5. AcWing 1017. 怪盗基德的滑翔翼
  6. 深圳企业选择深圳SEO外包的理由
  7. 电脑无法升级windows11的解决办法
  8. win7 关闭计算机休眠,技术编辑教您win7下怎么关闭休眠
  9. UEFI怎么用 UEFI安全启动设置添加方法步骤图解
  10. 有个漂亮女朋友是种怎样的体验?爬取知乎2.2亿的阅读量的话题