【Exception】org.apache.ibatis.binding.BindingException

nested exception is org.apache.ibatis.binding.BindingException 解决方式汇总 MyBatis Mapper出现了nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘levelName’ not found. Available parameters are [arg2, arg1, arg0, param3, param1, param2],说明是Mapper接口方法的参数在编译的时候没有按照代码写的参数来进行。需要解决这个问题,可以从以下方面入手。 阅读详情

案发现场:
在这里插入图片描述
解决方案:

  • 1、mapper.xml的命名空间(namespace)是否跟mapper接口的包名.类名是否一致

  • 2、mapper接口的方法名,与xml中的一条sql标签的id是否一致

  • 3、在application.properties中添加对mybatis的配置

      # 注意注意
      # 方式一:将maper.xml配置在 src/main/java 下
      mybatis.mapper-locations=classpath:top/peng/mapper/*.xml
      # 方式二:将maper.xml配置在 resources 目录下,需要创建mapper目录然后存放xml
      #mybatis.mapper-locations=classpath:mapper/*.xml     
      # 配置对应的实体类,可不做配置   
      mybatis.type-aliases-package=com.battcn.entity
      # 驼峰命名规范 如:数据库字段是  order_id 那么 实体字段就要写成 orderId
      mybatis.configuration.map-underscore-to-camel-case=true
    
  • 4、在main入口函数中,添加@MapperScan注解,告诉Spring ,去扫描mapper接口

      我的mapper接口是放在:top.peng.mapper包下的,所以我添加的注解是:
      @MapperScan("top.peng.mapper")
    
  • 5、如果你的项目是maven项目,并且你是使用上面方式一将mapper.xml文件映射在java package中的,
    请你在编译后,到所在目录看一看,很有可能是没有编译生成对应的xml文件
    因为 Spring Boot默认只打入java package 下的 *.java文件,所以我们需要在pom.xml文件的<build></build>里面,加这么一段:

      <build>
      	<resources>
      		<resource>
      			<!--编译resources下的文件-->
      			<directory>src/main/resources</directory>
      		</resource>
      		<resource>
      			<!--编译 src/main/java 下的xml文件-->
      			<directory>src/main/java</directory>
      			<includes>
      				<include>**/*.xml</include>
      			</includes>
      			<filtering>true</filtering>
      		</resource>
      	</resources>
      </build>
    
出现 nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘xx‘ not found 解决方法 内含 Mybatis从入门到精通(全) 阅读详情

相关推荐

nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

insert 库时报错

知识改变命运,ヾ(◍°∇°◍)ノ゙【求关注】 500

解决:nested exception is org.apache.ibatis.reflection.ReflectionException

解决方法先将问题翻译分析Mybatis其他解决办法 nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named ‘name’ in ‘class java.lang.String’ 先将问题翻译 嵌套异常是 org.apache.ibatis.reflection.ReflectionException:“class java.lang.Strin

码农成长记 9万+

寻迹Arduino智能小车

Arduino巡线寻迹智能小车

Rachael_Wang的博客 9976

mybatis异常:nested exception is org.apache.ibatis.binding.BindingException

mybatis异常:nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘userI’ not foun 在使用mybatis开发的时候,有时候需要传入多个参数进行查询,当传入多个参数时,不会处理会出现下面异常: nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘userId’ not found. Availab

niu1109的博客 4万+

ASF-YOLO:一种基于注意尺度序列融合的细胞实例分割YOLO模型

随着样本制备技术和显微成像技术的快速发展,细胞图像的定量处理和分析在医学、细胞生物学等领域发挥着重要作用。基于卷积神经网络(CNN),可以通过神经网络训练学习不同细胞图像的特征信息,具有很强的泛化性能。两阶段的R-CNN系列[1,2,3]及其一阶段变体[4,5]是实例分割任务的经典CNN基础框架。在最近的研究中,You Only Look Once(YOLO)系列[6,7,8,9]已经成为实时实例分割中速度最快、最准确的模型之一。

m0_47867638的博客 9790

变邻域搜索(VNS)原理梳理和应用细节-附求解VRPTW问题C++代码

文章目录1、简介-introduction2、VNS的基本机制2.1 变邻域下降方法-Variable Neighborhood Descent2.2基本变邻域搜索方法-Basic Variable Neighborhood Search2.3 终止准则3、VNS的拓展和混杂算法3.1 VNS的拓展3.2 变邻域分解搜索-Variable Neighborhood Decomposition Search3.3 偏变邻域搜索-Skewed VNS3.4 并行变邻域搜索-Parallel VNS4、VNS和其

dragon Fly的博客 6826

mybatis框架异常org.apache.ibatis.exceptions.PersistenceException :全面解析

在学习mybatis框架中遇到了org.apache.ibatis.exceptions.PersistenceException问题,由于比较常见于测试映射文件,一不小心犯个小错就出现了,于是给自己总结一下,当然也希望对你有所帮助!!! 分析 ...

宜春 10万+

【Isaac Sim】无头服务器远程桌面连接实战:Turbovnc配置与常见问题解决

本文详细介绍了在无头GPU服务器上通过Turbovnc远程桌面连接并运行NVIDIA Isaac Sim的实战教程。针对无图形界面服务器运行仿真软件的核心痛点,文章提供了从Turbovnc安装配置、SSH隧道建立,到以普通用户身份启动服务、解决GLXBadFBConfig等常见图形错误的完整方案,帮助开发者在云端高效部署机器人仿真环境。

weixin_29254673的博客 772

Exception in thread “main“ org.apache.ibatis.exceptions.PersistenceException:报错解决办法

mybatis报错解决办法

qq_46105682的博客 1万+

量子化学仿真软件:VASP_(9).磁性材料计算

在量子化学仿真软件 VASP 中,磁性材料的计算是一个复杂但重要的过程。通过正确设置磁性状态、分析磁性性质、优化计算参数以及研究磁性相变和磁动力学,可以更准确地描述和预测磁性材料的性能。希望本节的内容能够为研究磁性材料的科研人员提供有用的参考和指导。

kkchenjj的博客 1374

perl 安装DBI和DBD

还可以从cpan.perl.org站点下载tar压缩文件形式的源代码发行版本,解压缩后,切换到相应的文件目录 cd DBI-1.54 perl Makefile.PL make make test make install 安装DBD时候 需要export ORACLE_HOME 验证安装: perldoc DBD::Oracle perldoc DBI 在线文档; perldoc -m

zhaoyangjian724的专栏 1754

【已解决】org.apache.ibatis.exceptions.PersistenceException

本博文源于笔者自身学习的mybatis,在学习一对多的过程中,出现了一个错误。这个错误是org.apache.ibatis.exceptions.PersistenceException:

执念斩长河 1万+

Python爬虫selenium验证-中文识别点选+图片验证码案例

环境对模型进行训练,参考:https://github.com/sml2h3/dddd_trainer。能识别,但是发现默认识别率有点低,想要提升识别率,可以搭建。截图每个字符,并基于ddddocr识别。根据坐标,在验证码上进行点击。

dme.的博客 2165

nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘xxx‘ not found.

使用mybatis,入参为对象,绑定sql异常 报错信息: Caused by: org.apache.ibatis.binding.BindingException: Parameter 'createUser' not found. Available parameters are [page, param1, paramCondition, param2] at org.apache.ibatis.binding.MapperMethodTParamMap.get(MapperMethod.java

周不老的博客 2739

100天精通Python(进阶篇)——第43天:批量将PDF转Word文档(附上脚本代码)

100天精通Python(进阶篇)——第43天:批量将PDF转Word文档(附上脚本代码)

努力让自己发光,对的人才能迎着光而来 9万+

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

解决错误:nested exception is org.apache.ibatis.binding.BindingException

解决错误:nested exception is org.apache.ibatis.binding.BindingException 多个参数使用@Param注解标识 MyBatis 参数解析机制

ly甲烷的博客 4034

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

nested exception is org.apache.ibatis.binding.BindingException

idea的maven项目:Springboot+mybatis时,报错 org.apache.ibatis.binding.BindingException。 解决如下: 1.看target目录下,dao包下的dao.class文件是否生成对应的dao.xml文件,如过没有,在pom.xml文件中的中添加如下配置。 <resources> <resource> <directory>src/main/jav

weixin_45316851的博客 1381

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

解决——》MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException

版权声明:本文为博主原创文章,无需授权即可转载,甚至无需保留以上版权声明,转载时请务必注明作者。 https://blog.csdn.net/weixin_43453386/article/details/84587865 解决——》org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.bi...

小仙~ 1万+

解决mapper绑定异常:nested exception is org.apache.ibatis.binding.BindingException:

解决mapper绑定异常:nested exception is org.apache.ibatis.binding.BindingException:

jcoiwenwfkowe的博客 282

nested exception is org.apache.ibatis.binding.BindingException: Parameter 'XXX' not found报错

今天遇到mybatis的报错,搞了好久才搞懂,相信也能解决大部分人的报错。 报错信息如下: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'roleIds' not found. Available pa...

Wookpeck的博客 7万+

nested exception is org.apache.ibatis.binding.BindingException:

用mybatis的xml文件进行ORM模式,出现下面错误 nested exception is org.apache.ibatis.binding.BindingException: Parameter 'id' not foundAvailable parameters are {carer param} 原因: /** * 注册一个车主信息 * @p...

weixin_41334434的博客 2万+

nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘userid‘

【代码】nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘userid‘

阿天的博客 3389

nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘u

是*mapper.xml映射没有得到传入的参数,这个时候需要在mapper变化传参,对比一下错误的和正确的传参方式。在整合mybatis开发的时候,有时候需要传入多个参数进行查询,当传入多个参数时使用不当会出现以上异常。mapper层:原因就在此处,没有加入@Param("")注解。controller层,从前端传入多个参数进行新增。mapper加入注解就可以了。secviceImpl层。

weixin_60948956的博客 9913

使用了@Param,还是出现nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘XXX‘ 错误

使用了@Param,还是出现nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘XXX’ 错误 碰到问题的过程 开发的时候出现了以下错误: nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘XXX’ not found. 看到这个错误的时候第一反应就是Dao层没有加@Param注解出现错误。但是去看Dao层的

从零到1% 4164

nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘XXX‘ not found

使用mybatis中,报错”-nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘XXX’ not found“

heroicpoem的专栏 1628
上一篇: 【Mybatis】动态SQL之 foreach 标签解析Map对象
下一篇: 【开源DEMO】我也不知道这是个什么组件
tanpenggood
博客等级 码龄9年 129粉丝 197原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值