orcale ArrayIndexOutOfBoundsException 解决办法

记录一些遇见的bug——项目启动报错org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.e 报错截图: 错误代码: 二、问题原因 虽然看起来是一个空指针异常,但真正的原因在第二张报错截图上:也就是如下内容: 因为数据库表中有个字段名叫desc,如图所示: desc是MySQL语法中的关键字,mybatis plus自动生成的sql中因为这个关键字的影响,就造成了语法错误。方案1:更换字段名为非MySQL关键字即可。 例如此处我把字段名改成describer,同时更改Java中的实体类属性名。 clean之后再次运行,项目顺利启动不再报错。 方案2:不使用mybatis plus ,更换成 阅读详情
org.mybatis.spring.MyBatisSystemException: nested exception IS org.apache.ibatis.executor.ExecutorException: Error preparing statement.  Cause: java.lang.ArrayIndexOutOfBoundsException: 12
AT org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:79)
AT org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:447)
AT com.sun.proxy.$Proxy12.insert(UNKNOWN Source)
AT org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:279)
AT com.zh.dao.ThirdOrderToNoticeMapper.addWM_MIS_TALCNTC(ThirdOrderToNoticeMapper.java:25)
AT com.zh.service.impl.ThirdOrderToNoticeServiceImpl.addWM_MIS_TALCNTC(ThirdOrderToNoticeServiceImpl.java:72)
AT com.zh.util.DBTest.addWM_MIS_TALCNTC(DBTest.java:151)
AT sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
AT sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
AT sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
AT java.lang.reflect.Method.invoke(Method.java:606)
AT org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
AT org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
AT org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
AT org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
AT org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
AT org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
AT org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
AT org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
AT org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
AT org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
AT org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
AT org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
AT org.junit.runners.ParentRunner.run(ParentRunner.java:363)
AT org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
AT org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
AT org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
AT org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
AT org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
AT org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused BY: org.apache.ibatis.executor.ExecutorException: Error preparing statement.  Cause: java.lang.ArrayIndexOutOfBoundsException: 12
AT org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:97)
AT org.apache.ibatis.executor.statement.RoutingStatementHandler.prepare(RoutingStatementHandler.java:59)
AT org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:85)
AT org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:49)
AT org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
AT org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
AT org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:198)
AT org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:185)
AT sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
AT sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
AT sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
AT java.lang.reflect.Method.invoke(Method.java:606)
AT org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:434)
... 28 more
Caused BY: java.lang.ArrayIndexOutOfBoundsException: 12
AT oracle.jdbc.driver.OracleSql.computeBasicInfo(OracleSql.java:950)
AT oracle.jdbc.driver.OracleSql.getSqlKind(OracleSql.java:623)
AT oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedStatement.java:1212)
AT oracle.jdbc.driver.T4CPreparedStatement.<init>(T4CPreparedStatement.java:28)
AT oracle.jdbc.driver.T4CDriverExtension.allocatePreparedStatement(T4CDriverExtension.java:68)
AT oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:3140)
AT oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:3042)
AT oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:5890)
AT com.alibaba.druid.filter.FilterChainImpl.connection_prepareStatement(FilterChainImpl.java:462)
AT com.alibaba.druid.filter.FilterAdapter.connection_prepareStatement(FilterAdapter.java:934)
AT com.alibaba.druid.filter.FilterEventAdapter.connection_prepareStatement(FilterEventAdapter.java:132)
AT com.alibaba.druid.filter.FilterChainImpl.connection_prepareStatement(FilterChainImpl.java:459)
AT com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.prepareStatement(ConnectionProxyImpl.java:350)
AT com.alibaba.druid.pool.DruidPooledConnection.prepareStatement(DruidPooledConnection.java:485)
AT org.apache.ibatis.executor.statement.PreparedStatementHandler.instantiateStatement(PreparedStatementHandler.java:80)
AT org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:88)

... 40 more




解决办法是:在mybatis xml标签后面加上useGeneratedKeys="false"


org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorEx 属性,这个属性会返回自动生成的ID设置到参数中,如果参数中没有。方案二:如果需要返回ID值,在传的参数中加上。的参数封装成实体,包含这几个字段。方案一:如果不需要返回ID值,就把。插入数据时mybatis报错。插入数据传的参数中没有。 阅读详情

相关推荐

【异常】记一次因SpringMVC @GetMapping注解错误使用,导致SQLParsingException: You have an error in your SQL syntax

记一次因SpringMVC @GetMapping注解错误使用,导致SQLParsingException: You have an error in your SQL syntax

奶爸的编程之路,也就一周冷个三天 986

MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: Error preparing statement. Cause: com.google.common.util.concurrent.UncheckedExecutionException: org.apache.shardingsphere.sql.parser.exception.SQ

qq_36779138的博客 7754

麒麟V10 ARM环境离线部署MySQL:从依赖缺失到服务自启的完整避坑指南

本文详细介绍了在麒麟V10 ARM环境下离线部署MySQL的完整流程,包括依赖缺失解决方案、目录配置、服务自启设置及性能调优。特别针对国产操作系统和ARM架构的兼容性问题,提供了实用的避坑指南和优化建议,帮助用户高效完成MySQL部署与维护。

weixin_28741413的博客 414

踩坑记录4-org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.Exec

Mybatis语法错误

qq_43006237的博客 1975

道岔故障监测系统设计(源码+开题)

通过实时监控道岔的工作状态,系统能够及时发现异常情况,预防潜在的安全隐患,从而减少事故发生的概率。此外,监测系统还能够为维护人员提供详细的数据支持,帮助他们更准确地判断道岔的磨损程度和故障类型,优化维修计划,延长道岔的使用寿命。随着智能化、自动化技术的发展,道岔故障监测系统的设计与应用也将推动铁路行业的技术进步,为实现智能铁路和未来交通系统的构建奠定基础。因此,开展道岔故障监测系统的设计研究,不仅具有重要的工程实践价值,也有助于推动铁路运输行业向更高水平的发展。

灵军程序设计 783

STM32移植u8g2库(HAL库)(硬件SPI)(sh1106_128x64)

STM32移植u8g2库(HAL库)(硬件SPI)(sh1106_128x64) MCU型号为STM32F103RCT6,OLED屏为中景园电子1.3寸屏,驱动芯片为sh1106,分辨率为128x64,MDK版本为V5.34。

Master_0_的博客 6279

java.lang.ArrayIndex_orcale java.lang.ArrayIndexOutOfBoundsException: 8

插入语句如下INSERT INTO SYS_USERS ( ID, NAME, PHONE, EMAIL, SEX, AGE, PASSWD, ROLE_ID ) values ( ?, ?, ?, ?, ?, ?, ?, ? )错误信息如下org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibati...

weixin_40001025的博客 477

学Simulink--基于Simulink的无迹卡尔曼滤波(UKF)目标跟踪仿真建模示例

本文详细介绍了基于Simulink的无迹卡尔曼滤波(UKF)目标跟踪仿真建模方法。首先分析了UKF相比EKF在强非线性场景下的优势,包括无线性化误差、计算效率高和鲁棒性强等特点。接着阐述了UKF的核心原理,重点讲解了无迹变换(UT)的三个关键步骤:Sigma点生成、非线性传播和加权统计重构。文章还详细说明了二维机动目标的状态向量定义、非线性状态转移模型和雷达观测模型。 在Simulink实现部分,提供了完整的建模步骤和核心代码,包括目标运动模型、雷达传感器模型和UKF算法模块的实现。通过蛇形机动场景的仿真实

xiaoheshang_123的博客 97

ArrayIndexOutOfBoundsException: 数组下标越界异常

ArrayIndexOutOfBoundsException: 数组下标越界异常。 举例: public static void main(String[] args) { int arr[] = {1,2}; // 此处报数组下标越界异常 System.out.println(arr[2]); } 控制台输出的异常信息为: Exception in thread "m...

建设美丽祖国 1万+

AI智算-K8s如何利用IB RDMA网络加速大模型分布式训练

在AI人工智能领域,大模型的微调是提升性能不可或缺的一环。通过结合InfiniBand RDMA网络的高速互联、Kubernetes的云原生容器化部署,以及智能算力调度平台,可以打造一个高效、灵活且可扩展的分布式训练环境。

Kason_iWiki 836

【WRF-Chem工具】anthro_emiss 详解:生成人为排放数据

anthro_emiss 详解:生成人为排放数据

WW、forever的博客 2063

Oracle executeBatch异常:ArrayIndexOutOfBoundsException

原文地址:http://yanwushu.sinaapp.com/oracle_executebatch_arrayindexoutofboundsexception/ 使用jdbc接口PreparedStatement.executeBatch()向oracle中批量执行sql时候,出现异常ArrayIndexOutOfBoundsException,具体信息如下:

Funny Min的专栏 1518

LLaMA-Factory微调教程5:多模态VLM模型对话

视觉-语言模型(VLM)概述与应用 视觉-语言模型(VLM)是一类结合视觉和语言信息的人工智能模型,旨在实现跨模态的理解与交互。其核心目标包括跨模态理解和生成能力,关键技术涉及模态表示与映射、多模态预训练以及跨模态交互机制。 典型VLM模型包括: CLIP:通过对比学习实现图像和文本的向量空间对齐 BLIP:结合自监督和弱监督学习提升语义对齐 ALBEF:基于BERT结构扩展跨模态注意力 DALL-E系列:基于文本生成图像的生成式模型 CLIP4Clip:扩展CLIP到视频领域 VLM在图像/视频检索、视觉

Cachel Wood的博客 1125

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.Executor

错误是:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement 'com.example.manage.mapper.DeptMapper.queryAllDept'. It's likely that n.

燃烧的梦想是信仰 2299

AI Agent在智能腰带中的姿势矫正与提醒

随着人们生活方式的改变,长时间不正确的坐姿、站姿等不良姿势问题日益普遍,这不仅会导致身体疲劳,还可能引发颈椎病、腰椎病等多种健康问题。智能腰带作为一种可穿戴设备,具有实时监测人体姿势的潜力。本研究的目的是将AI Agent引入智能腰带,实现对人体姿势的准确识别、矫正与提醒功能。本研究的范围涵盖了从AI Agent的核心算法原理到智能腰带的实际开发与应用。包括传感器数据的采集与处理、机器学习算法的选择与训练、智能腰带的硬件设计与软件开发,以及在不同场景下的实际应用测试。本文共分为十个部分。

AI 原生应用开发的博客 353

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

日常问题:解决nested exception is org.apache.ibatis.executor.ExecutorException: No constructor found问题

这个关键字,想到可能是和自定义类型中定义了有参构造。当从数据库拿到某行数据时,由于缺少无参构造,导致异常出现。在这里能够理解成使用Mybatis查询一个实例时,这个抽象实体类必须有一个无参构造方法。这时候疑惑了一下,自定义类中的字段和类型和数据结构一模一样啊,然后发现异常提示中出现。添加一个无参构造函数(能够不添加三个参数的构造函数)。

Hugo的博客 3148

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

mybatis数组越界异常 Error preparing statement

mybatis数组越界异常 今天在做数据库迁移时遇到这个问题:Error preparing statement. Cause: java.lang.ArrayIndexOutOfBoundsException: 8 异常 ,数据库是从mysql迁移到oracle,更改了表字段类型及函数外,在测试中发现了这样一个问题,由于系统每次登陆登出时会记录登入者信息,结果在插入日志表中出现了这个问题,报错mybatis数据越界,仔细检查后发现mapper.xml中sql没有问题,但是原来是mysql开启了主键自增,

weixin_44658712的博客 7142

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

nested exception is org.apache.ibatis.executor.ExecutorException: No constructor found in com.chengg

报错: 2018-09-11 16:33:51.280 [http-nio-15601-exec-6] DEBUG org.springframework.web.servlet.DispatcherServlet -Could not complete request feign.FeignException: status 500 reading IOrderProvider#getRene...

monica1_1的博客 1万+

nested exception is org.apache.ibatis.executor.ExecutorException: No constructor found in *** 错误分析

mybatis报错 错误:大爷的,少写了无参构造。 总结:既然使用有参构造,则无参构造一定存在。

gyp0307的博客 8585

数据库迁移PG遇到的java.lang.ClassCastException异常

java 类型转换异常:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: Error preparing statement. Cause: java.lang.ClassCastException: org.apache.shardingsphere.sql.parser.sql.segment.dml.column.ColumnSegm

a843013383的博客 2365

mybatis偶现数组越界:Error preparing statement. Cause: java.lang.ArrayIndexOutOfBoundsExceptio

*问题原因:**通过本地复现debug源码,是因为代码中 Mono.zip(查询A,查询B), 且A和B查询用了同一个事务对象,而事务对象里面有个成员变量(queryStack)线程不安全,对这个成员变量做 【变量++】, 【变量–】 操作后,导致这个变量为负数。2、在使用MyBatis嵌套查询的语法时才有用,当使用该语法,需要用queryStack 来记录嵌套的层数,根据这个变量来做缓存控制和延迟加载处理。,生产环境没有该异常,测试换将偶尔来那么一回,真真让人费解,抓脑仁。

希望 1757

MyBatis异常处理org.apache.ibatis.executor.ExecutorException

由于测试缘故,数据库被加入了很多测试数据。再次执行原来的查询出现了异常org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: Statement returned more than one row, where no more than

Revivedsun的专栏 2万+

异常:nested exception is org.apache.ibatis.exceptions.PersistenceException,error SQL

运行异常:nested exception is org.apache.ibatis.exceptions.PersistenceException;接口测试error nestexception ibatis error SQL Exception

qq_44973310的博客 3万+

懒加载报错提示空指针异常ExecutorException:Error creating lazy proxy. Cause: java.lang.NullPointerException(解决方案)

数据如果没有使用懒加载数据可以显示,使用懒加载后报错 运行时异常:nested exception is org.apache.ibatis.executor.ExecutorException: Error creating lazy proxy. Cause: java.lang.NullPointerException 这应该就是mybatis版本的问题 我们需要把mybatis的包换成My...

千百渡 2275

nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML lo

nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML lo

qq_40834643的博客 6373
上一篇: 个人记录
下一篇: 记录 orcale 在mybatis中批量添加
一直到老到直一
博客等级 码龄11年 386粉丝 119原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值
⌂ 换网址