Mybatis报错:org.apache.ibatis.exceptions.PersistenceException:

【硬件】LT3763中文手册 1)精确控制输入和输出电流;2) 3000:1真彩色PWM™调光;3) ±1.5%电压调节精度;4) ±6%电流调节精度;5)6V至60 V输入电压范围;6)宽输出范围最高可达55V;7)<2µA关断电流;8)用于负载电流热控制的控制引脚;9)输入和输出电流监控和限制;10)开路、短路和C/10故障检测;11)适用于LED应用的PWM驱动器输出;12)热增强型28引脚FE封装。 阅读详情

mybatis框架,在进行测试类测试时候一直报错,如下:
org.apache.ibatis.exceptions.PersistenceException:

Error querying database. Cause: org.apache.ibatis.reflection.ReflectionException: Could not set property 'roleCode ’ of ‘class cn.smbms.entity.Role’ with value ‘SMBMS_EMPLOYEE’ Cause: org.apache.ibatis.reflection.ReflectionException: There is no setter for property named 'roleCode ’ in ‘class cn.smbms.entity.Role’

The error may exist in cn/smbms/dao/user/UserMapper.xml

The error may involve cn.smbms.dao.user.UserMapper.getUserListByRoleId-Inline

The error occurred while setting parameters

SQL: select u.*,r.id as r_id,r.roleCode,r.roleName from smbms_user u ,smbms_role r where u.userRole=? and u.userRole=r.id

Cause: org.apache.ibatis.reflection.ReflectionException: Could not set property 'roleCode ’ of ‘class cn.smbms.entity.Role’ with value ‘SMBMS_EMPLOYEE’ Cause: org.apache.ibatis.reflection.ReflectionException: There is no setter for property named 'roleCode ’ in ‘class cn.smbms.entity.Role’

at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
前前后后找了好几表代码也没错呀,报的是UserMapper.xml中可能错了,说roleCode没找到,无法赋值,在里面找了好几遍,也没发信错误呀。
这是UserMapper.xml里面的错误的sql
 <resultMap type="user" id="userRoleResult">
      <id property="id" column="id"/>
      <result property="userCode" column="userCode"/>
      <result property="userName" column="userName"/>
      <result property="userRole" column="userRole"/>
  <association property="role" javaType="Role">
     <id property="id" column="r_id"/>
      <result property="roleCode " column="roleCode"/> 
     <result property="roleName" column="roleName"/>
   </association>
 </resultMap>
 
 
 <select id="getUserListByRoleId" resultMap="userRoleResult" parameterType="Integer">
 select u.*,r.id as r_id,r.roleCode,r.roleName
   from smbms_user u ,smbms_role r 
 where u.userRole=#{userRole} and u.userRole=r.id
 </select>
 仔仔细细看了好几遍才发现原来是property="roleCode " 中多了个空格,把空格去掉,property="roleCode",就没问题了,就是一个空格,不小心还真不容易发现,写代码一定认真,马虎不得呀。
【大模型学习】第二十四章 生成式人工智能(GAI)简介 ‌的AI技术,其核心目标是通过学习数据中的规律,生成与训练数据类似但全新的文本、图像、音频、视频甚至代码。生成式人工智能(GAI)是一类能够‌。 阅读详情

相关推荐

Visionpro 使用CogPMAlignTool工具提取匹配轮廓点

【代码】Visionpro 使用CogPMAlignTool工具提取匹配轮廓点。

weixin_43947315的博客 2091

【MyBatis】常见错误记录

错误类型一: 错误提示:org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'values' i

Awsmsniper的博客 3万+

别再死记硬背了!用LTspice和Simulink仿真,5分钟搞懂巴特沃斯、切比雪夫、贝塞尔滤波器的区别

本文通过LTspice和Simulink仿真工具,直观对比了巴特沃斯、切比雪夫和贝塞尔滤波器的特性差异。从通带波纹、过渡带陡峭度到相位线性度,详细解析了三种经典滤波器的设计哲学与应用场景,帮助工程师和学生快速掌握滤波器选型技巧,提升电路设计效率。

weixin_33910191的博客 523

使用MyBatis时报错

出现这个报错通常是xml文件的问题,建议仔细检查映射文件路径以及select标签中是resultMap还是resultType,希望能对你有所帮助。resultMap标签的type错误,修改后成功运行。找了很久终于发现了错误。

weixin_61823116的博客 1248

莆田市C++专项选拔第一轮题4

现在小明同学想要从两堆硬币中各选择一枚硬币,使得两枚硬币的面值之和 不超过 k。不同的硬币组合,就算面值相同,也视为不同的方案。现在他把这些硬币分成了两堆,已知两堆硬币分别有 n 和 m 枚硬币。可选方案有: (1,2), (1,1), (1,1), (5,2), (5,1), (5,1),共 6 种。第一行三个整数 n, m, k,分别表示第一堆硬币的数量,第二堆硬币的数量,以及面值之和的上限。对于30%的数据,1 ≤ n , m ≤ 1000 , 1 ≤ b , c ≤ 1000。

lpstudio的博客 924

ArcGIS | 全球新冠肺炎地图数据下载和处理

ArcGIS

thinkpang的博客 2900

org.apache.ibatis.exceptions.PersistenceException:

org.apache.ibatis.exceptions.PersistenceException:

Liu_wen_wen的博客 3万+

读懂 ABAP CDS 注解的直接、继承与派生

本文系统梳理了ABAP CDS注解的评估逻辑,重点解析直接注解(Direct)、继承注解(Inherited)和派生注解(Derived)的差异及其在CL_DD_DDL_ANNOTATION_SERVICE中的处理方式。通过视图注解@Metadata.ignorePropagatedAnnotations可调控注解传播行为,避免下游语义影响上层视图。文章还提供了基于标准表的完整示例(包含底层视图、消费视图和ABAP报告程序),帮助开发者在实际系统中验证三层注解的叠加效果与阻断机制。关键点包括:派生注解的数据

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 244

mybatis 找不到配置文件和空指针错误

环境:IDEA + Maven 1、mybatis 报错:找不到配制文件。 Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource com/zhh/mapper/StudentMapper.xml Exception in thread "main" org.ap...

abc_xian的博客 1483

AI辅助需求分析与提示词生成

文章标题 《AI辅助需求分析与提示词生成》 关键词 人工智能 需求分析 提示词生成 深度学习 机器学习 强化学习 数学模型 系统架构

AI天才研究院 1212

4、文化遗产数字记录的伦理框架构建

本文探讨了在数字技术快速发展的背景下,如何构建一个伦理框架以指导文化遗产的数字记录工作。文章分析了遗产保护的重要性以及当前面临的挑战,包括气候变化、全球化和技术变革等。同时,结合国际古迹遗址理事会(ICOMOS)的伦理原则和加拿大遗产专业人员协会(CAHP)的行为准则,提出了六个核心伦理类别,并讨论了其在实践中的应用。文章强调,伦理框架不仅有助于提高数字记录的质量和可持续性,还能促进专家合作、保护社区利益并确保数字遗产的长期可访问性。未来需要持续完善这一框架,以应对不断变化的技术和社会环境带来的新挑战。

7h6j5k4l3的博客 96

### Error building SqlSession.

java.lang.ExceptionInInitializerError at com.kuang.dao.IUserDaoTest.testGetUserList(IUserDaoTest.java:16) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at

qq_46285250的博客 615

C#使用OpenCvSharp+微信模型识别多个二维码

本文介绍了一个基于OpenCvSharp和微信开源二维码检测器的多二维码识别项目。该项目通过C# WinForm实现,主要功能包括:加载图片、识别图片中的多个二维码并显示识别结果。核心代码使用了OpenCvSharp.WeChatQRCode类,通过预训练的caffe模型(detect.prototxt/detect.caffemodel和sr.prototxt/sr.caffemodel)进行二维码检测和解码。识别结果包括每个二维码的编号、内容及位置信息。项目适用于批量二维码识别场景,部署简单,识别效果良

遇见--专栏 123

Mybatis update报错(org.apache.ibatis.exceptions.PersistenceException)

你检查检查你的每个字段后面是不是忘记加,号了!!! 这是我遇到之后修改正确的代码: <!-- 7 modify --> <update id="modify" parameterType="user"> update smbms_user <set> <if test="userCode != null">userCode = #{userCode},</if> <if test="userNa

Sage的博客 370

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

Mybatis报错org.apache.ibatis.exceptions.PersistenceException:

Mybatis报错org.apache.ibatis.exceptions.PersistenceException:

m0_59244333的博客 634

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

Mybatis使用报错org.apache.ibatis.exceptions.PersistenceException:

使用Mybatis中使用Mapper动态代理方式测试报以下错误: org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.apache.ibatis.reflection.ReflectionException: Error instantiating class ...

3866

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

MyBatis报错:org.apache.ibatis.exceptions.PersistenceException 的解决方案

MyBatis报错控制台输出: org.apache.ibatis.exceptions.PersistenceException: ### Error updating database. Cause: org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{pr...

muzi木子 8693

mybatis报错:org.apache.ibatis.exceptions.PersistenceException

mybatis获取sqsession报错 org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession. ### Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Caus...

Gongyl的博客 787

学习Mybatis时报错:org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession.

学习Mybatis时报错:org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession. 报错详情为; Caused by: org.apache.ibatis.exceptions.PersistenceException: Error building SqlSession. Cause: org.apache.ibatis.builder.BuilderException: Error creatin

YHSOUNG的博客 1673

Mybatis报错: org.apache.ibatis.exceptions.PersistenceException

一、问题描述 写好配置文件用JUnit进行测试,一运行就报错: org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.apache.ibatis.reflection.ReflectionException: Error instantiating

fendo 1万+

mybatis学习中报错:org.apache.ibatis.exceptions.PersistenceException:

源文件如上,因为是批量加载,扫描是包下所有文件,不必在写,删掉即可 org.apache.ibatis.exceptions.PersistenceException:  ### Error building SqlSession. ### The error may exist in mapper/stuMapper.java (best guess) ### Cause: org.

凉凉思语的博客 2189

JSP-MyBatis(一)入门以及org.apache.ibatis.exceptions.PersistenceException: 报错

前言: 一、MyBatis简介: 二、MyBatis的HelloWord 3.添加实体类User.java: 监控SQL语句: 三、常见错误排查: 前言: 一、MyBatis简介: MyBatis 是支持普通 SQL 查询,存储过程和高级映射的优秀持久层框架。MyBatis 消除 了几乎所有的 JDBC 代码和参数的手工设置以及结果集的检索。MyBatis 使用简单的 XML...

忆_恒心的博客 761

初学mybatis时遇到org.apache.ibatis.exceptions.PersistenceException报错的解决方法

解决方法: 修改mybatis-config.xml配置文件如下(将useSSL的true改为false) useSSL=false <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> &lt.

weixin_46822367的博客 699

mybatis报错:Caused by: org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSessio

问题描述: mybatis报错: Caused by: org.apache.ibatis.exceptions.PersistenceException: Error building SqlSession. The error may exist in com/lu/dao/UserMapper.xml Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org

weixin_44736853的博客 948

关于mybatis测试时报错: Caused by: org.apache.ibatis.exceptions.PersistenceException:

关于mybatis测试时报错: Caused by: org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession. ### Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. C...

TesterAllen的博客 3079

运行mybatis报错Exception in thread “main“ org.apache.ibatis.exceptions.PersistenceException

运行时报错Exception in thread “main” org.apache.ibatis.exceptions.PersistenceException: 解决方案: file>Project Structure>project 打开settings>java compiler 在修改pom.xml文件mysql驱动版本为5.1.46 然后我的问题就解决了。 我不修改mysql驱动版本时依旧有报错,最开始是5.1.25版本的,这尼玛离谱,淦! so why???

alpha0808的博客 2113
上一篇: 通过过滤器设置中文编码,并且设置session时,通过过滤器阻拦空值session
下一篇: Spring MVC框架在进行表单提交,自动封装成对象提交,在以对象的形式入参
javaChengXuY
博客等级 码龄8年 15粉丝 38原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值