【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.UserMapper.selectUser
报错原因:mapper接口和mapper.xml文件没有映射起来
解决方法
第一种:mapper.xml中的namespace和实际的mapper文件不一致
第二种:mapper接口中的方法名和mapper.xml中的id标签不一致
第三种:Mapper.xml没有构建进去
第四种:配置文件导不出来
报错原因:mapper接口和mapper.xml文件没有映射起来
解决方法
第一种:mapper.xml中的namespace和实际的mapper文件不一致
第二种:mapper接口中的方法名和mapper.xml中的id标签不一致
第三种:Mapper.xml没有构建进去
打开target看看对应的Mapper.xml文件在不在,如果不在,点击右边的maven,clean一下,再Run一下
第四种:配置文件导不出来
maven的配置文件默认放在resources目录下,但在这里需要把它放到java目录下,导致配置文件导不出来
解决方法: 需要手动配置资源过滤,让它把java目录下的properties和xml等配置文件的过滤开启,使它们能够被导出,在pom.xml中配置开启过滤
<!--在build中配置resources,来防止我们资源导出失败的问题-->
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</build>
自己碰到了参考链接:
Invalid bound statement (not found)解决方法_人间游客的博客-CSDN博客
第三种请款有可能clean一次不行,多试几次几时target下的xml导出来了就可以了。
【Spring+Mybatis】 Invalid bound statement (not found): com.xxxx.mapper.UserMapper.selectUser相关推荐
- springboot整合mybatis错误 Invalid bound statement (not found): com.yuan.mapper.UserMapper.getUserList
出现的原因是 src文件下的mapper有mapper接口和映射文件,而target下的mapper文件却没有映射文件 =解决方案======== 1.把映射文件 放到resources 目录下 结构 ...
- spring boot Invalid bound statement (not found): com.su.mapper.UserMapper.getAllUsers
今天说一下在springboot整合mybatis上遇到的坑,我是看视频学的,跟着视频里建的文件夹是这样的 然后运行程序报错,Invalid bound statement (not found): ...
- Invalid bound statement (not found): com.exam.mapper.UserMapper.findbyid
一.问题的出现: 调试代码的时候,把mapper.xml中的方法暂时的注释掉了,之后解除注释后,就出现了这个错误.具体报错如下: 二.解决方法: 1 . mapper.xml中的namespace和实 ...
- Invalid bound statement (not found): com.itheima.mapper.userMapper.SelectAll
根本原因 mapper映射文件没有被加载 最低级原因 1.mapper接口中的方法名和mapper映射文件中的id名是否一致 2mapper映射文件的名称空间的值 是否是mapper接口的权限名(包类 ...
- mybatis-plus出错:Invalid bound statement (not found): com.kuang.mapper.UserMapper.selectList
错误点: 原因:UserMapper继承BaseMapper,让我们看看BaseMapper 可以发现,BaseMapper使用的是范型.所以上边我们UserMapper继承的BaseMapper也要 ...
- mybatis(xml)报错:Invalid bound statement (not found): com.zjw.mapper.second.HospitalMapper.insert(已解决)
今天开发中遇到一个问题: Invalid bound statement (not found):com.zjw.mapper.second.HospitalMapper.insertSelectiv ...
- Invalid bound statement (not found): com.xxxx.dao.other.LoginDao.getUser
原来是能正常运行的,后想把登录相关的调整一下目录,对应登录的文件都调整到了other下边,启动服务,请求时报错: Invalid bound statement (not found): com.xx ...
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.xxxx.phb.mappe
前言 最近项目开发时,批量提交数据,报错 ❌信息如下 org.apache.ibatis.binding.BindingException: Invalid bound statement (not ...
- spring boot 集成Mybatis时 Invalid bound statement (not found)
spring boot 集成Mybatis时,运行提示 org.apache.ibatis.binding.BindingException: Invalid bound statement (not ...
最新文章
- binary search完整笔记
- [HAOI2006]均分数据
- spring boot原理_SpringBoot-02-原理初探之主启动类
- Postgre体系结构图
- 序列化(串行化)- 使用BinaryFormatter进行序列化
- IREC-GAN:在线推荐中基于模型的对抗训练强化学习
- JSLint说“缺少基数参数”
- Python的is和==区别
- 【时间序列分析】01.时间序列与平稳序列
- kettle 创建脚本文件
- Win10如何查看打印机端口号?
- 480位禅宗大德悟道因缘
- 如何添加网络打印机-查看IP地址就可以
- 防摸鱼小软件——鼠标键盘检测器
- 【B站弹幕数据分析】B站独家付费番剧鬼灭之刃的前12集的弹幕数据分析
- Java中的Switch用法
- 【进阶版】机器学习之决策树知识与易错点总结(06)
- 【论文阅读】针对快速和准确的超分辨率深度拉布拉斯金字塔网络
- LeetCode刷题Python实录
- cannot create temp file for here-document: No space left on device
热门文章
- Spring系列——@lazy注解
- antv g2字体阴影_antv g2 notes
- kafka问题之Listener method could not be invoked with the incoming message
- C. Good Subarrays
- zabbix 5.0所有依赖包_开源的Zabbix报表系统ZbxTable正式发布!
- AcWing 95. 费解的开关(推理)
- GeeM2传奇引擎进入游戏出现白屏的解决办法
- AudioToolbox使用方法总结
- [15元]人体行为检测和识别毕业论文讲述
- matlab梯形法数值积分,数值积分(梯形法)