ibatis执行存储过程,java.lang.ArrayIndexOutOfBoundsException: 0
在项目开发中遇到一个问题,ibatis执行存储过程时报错
<procedure id="insertStatisticsResult_settle" parameterClass="String">
<![CDATA[
{call proc_stats_$statisticsType$()}
]]>
</procedure>
错误日志如下:
--- The error occurred in com/aspire/prm/dmplt/statistics/dao/ibatis/maps/StatisticsSQL.xml.
--- The error occurred while applying a parameter map.
--- Check the insertStatisticsResult_settle-InlineParameterMap.
--- Check the output parameters.
--- Cause: java.lang.ArrayIndexOutOfBoundsException: 0; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/aspire/prm/dmplt/statistics/dao/ibatis/maps/StatisticsSQL.xml.
--- The error occurred while applying a parameter map.
--- Check the insertStatisticsResult_settle-InlineParameterMap.
--- Check the output parameters.
--- Cause: java.lang.ArrayIndexOutOfBoundsException: 0
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/aspire/prm/dmplt/statistics/dao/ibatis/maps/StatisticsSQL.xml.
--- The error occurred while applying a parameter map.
--- Check the insertStatisticsResult_settle-InlineParameterMap.
--- Check the output parameters.
--- Cause: java.lang.ArrayIndexOutOfBoundsException: 0
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:94)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:447)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:82)
at org.springframework.orm.ibatis.SqlMapClientTemplate$9.doInSqlMapClient(SqlMapClientTemplate.java:370)
at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:194)
at org.springframework.orm.ibatis.SqlMapClientTemplate.insert(SqlMapClientTemplate.java:368)
at com.aspire.prm.dmplt.statistics.dao.ibatis.StatisticsDaoImpl.doStatistics(StatisticsDaoImpl.java:63)
at com.aspire.prm.dmplt.statistics.biz.impl.StatisticsBizImpl.doStatistics(StatisticsBizImpl.java:64)
at com.aspire.prm.app.statistics.manager.impl.StatisticsManagerImpl.doStatistics(StatisticsManagerImpl.java:62)
at com.aspire.prm.app.statistics.manager.impl.StatisticsManagerImpl.doStatistics(StatisticsManagerImpl.java:50)
at com.aspire.prm.app.statistics.manager.impl.StatisticsManagerImpl$$FastClassByCGLIB$$c1412355.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:696)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:631)
at com.aspire.prm.app.statistics.manager.impl.StatisticsManagerImpl$$EnhancerByCGLIB$$7f8146a6.doStatistics(<generated>)
at com.aspire.prm.app.statistics.job.StatisticsJob.execute(StatisticsJob.java:40)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at com.ibatis.sqlmap.engine.exchange.PrimitiveDataExchange.setData(PrimitiveDataExchange.java:51)
at com.ibatis.sqlmap.engine.mapping.parameter.BasicParameterMap.refreshParameterObjectValues(BasicParameterMap.java:140)
at com.ibatis.sqlmap.engine.mapping.statement.ProcedureStatement.postProcessParameterObject(ProcedureStatement.java:26)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:82)
... 22 more
在网上查了资料没有有效的解决方案,所以只能跟踪日志来。
--- The error occurred while applying a parameter map.
--- Check the insertStatisticsResult_settle-InlineParameterMap.
观察这个日志是由于传入参数错误,我看网上demo都是传入的map,而我的是string,
问题出在这,存储过程参数都以map的形式传入。
将传入参数改为hashmap就ok了
<procedure id="insertStatisticsResult_settle" parameterClass="java.util.HashMap">
<![CDATA[
{call proc_stats_$statisticsType$()}
]]>
</procedure>
ibatis执行存储过程,java.lang.ArrayIndexOutOfBoundsException: 0的更多相关文章
- Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at ExTestDrive.main ...
- java 中 java.lang.ArrayIndexOutOfBoundsException: 0 异常
package test; public class Test { public static void main(String[] args) { final int num2 = Integer. ...
- 解决Redisson出现Failed to instantiate [org.redisson.api.RedissonClient]: Factory method 'create' threw exception; nested exception is java.lang.ArrayIndexOutOfBoundsException: 0的问题
一.背景 最近项目中使用了redisson的哨兵模式来作为redis操作的客户端,然后一个意外出现了,启动报:Failed to instantiate [org.redisson.api.Redis ...
- java.lang.ArrayIndexOutOfBoundsException
1.错误描述 Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at com.you.m ...
- Jmeter报错之jmeter.gui.action.ActionRouter: Error processing gui.action.Start@1b7c473a java.lang.ArrayIndexOutOfBoundsException
一个使用了很久的Jmeter脚本,运行时Jmeter的UI界面上点击绿色按钮后,完全无反应,只有log报错,如下: 2017/06/28 14:29:23 ERROR - jmeter.gui.act ...
- ListView中使用type需要注意的东西 java.lang.ArrayIndexOutOfBoundsException: length=2; index=2 addScrapView
ListView中使用type需要注意的东西 在使用ListView时,如果使用了getItemViewType, 记得他的值一定要是从0开始计数的. 且要覆盖getViewTypeCount方法.并 ...
- Java - 错误: "java.lang.ArrayIndexOutOfBoundsException: length=1; index=1"
错误: "java.lang.ArrayIndexOutOfBoundsException: length=1; index=1" 本文地址: http://blog.csdn.n ...
- android listview Caused by: java.lang.ArrayIndexOutOfBoundsException: length=3; index=3
android listview 适配器在多种类型viewType报错: Caused by: java.lang.ArrayIndexOutOfBoundsException: length=3; ...
- Android BaseAdapter加载多个不同的Item布局时出现UncaughtException in Thread main java.lang.ArrayIndexOutOfBoundsException: length=15; index=15
java.lang.ArrayIndexOutOfBoundsException: length=15; index=15 异常出现的场景:在做聊天界面时,需要插入表情,图片,文字,名片,还有几种较为 ...
- 使用Thumbnailator处理gif图片时遇到java.lang.ArrayIndexOutOfBoundsException: 4096异常处理
环境 1.7.0_80 在使用Thumbnailator处理gif图片时,遇到问题: Exception in thread "main" java.lang.ArrayIndex ...
随机推荐
- C#/.NET这些实用的技巧和知识点你都知道吗?
前言 今天大姚给大家分享一些C#/.NET中的实用的技巧和知识点,它们可以帮助我们提升代码质量和编程效率,希望可以帮助到有需要的同学. .NET使用CsvHelper快速读取和写入CSV文件 本文主要 ...
- Centos7或Ubuntu 磁盘扩容
准备 切换到root用户(获取root权限) 安装: [root]# install lvm2 -y 查看当前信息: # 查看根分区大小 $ df -h Filesystem Size Used Av ...
- ubuntu 安装 arm-none-eabi-gcc 的几种方式
背景 这篇文章主要是为了解决 在 Linux 中 编译 能够在 裸机上 跑的 程序 目前许多嵌入式软件软件开发在Linux平台下进行,编译效率高很多,如今天所述的gcc-arm-none-eabi常适 ...
- C#开发单实例应用程序并响应后续进程启动参数
C#默认的WinForm模板是不支持设置单实例的,也没有隔壁大哥VB.NET那样有个"生成单个实例应用程序"的勾选选项(VB某些时候要比C#更方便),实现单实例可以有多种方法: 检 ...
- NEEPU Sec 2023 Misc 两题题记
GoingOn 题目描述 Keep going on channel 1 ;D 考察的是 midi lsb隐写 MIDI文件概述 CSV文件概述 midi转csv工具 midicsv 将 MIDI 文 ...
- Java 反射获取对象里的值
最近在负责邮件服务,里面会涉及到很多Email模板,这里我使用到了java的模板引擎:jetbrick-template,需要使用Map集合一个个往里面设置值,然后调用模板方法,进行替换.实体类一个个 ...
- 全网最适合入门的面向对象编程教程:08 类和对象的Python实现-@property装饰器:把方法包装成属性
全网最适合入门的面向对象编程教程:08 类和对象的 Python 实现-@property 装饰器:把方法包装成属性 摘要: 本文主要对@property 装饰器的基本定义.使用场景和使用方法进行了介 ...
- ProgressBar 进度控件
在 VB.NET 中,你可以使用 ProgressBar 控件或者自定义的进度提示方法来实现这个功能.以下是一个示例代码,展示如何使用 ProgressBar 控件来显示导入情况: ' 创建一个 Pr ...
- 变频器通过Modbus转Profinet网关接电机与PLC通讯在自动化的应用
巴图自动化Profinet转Modbus模块(BT-MDPN10)是一种用于不同通讯协议之间互连的设备,它可以将Profinet与Modbus这两种不同的通讯协议进行转换,从而实现设备之间的通讯和数据 ...
- Top monitor[2.1.11] 开源
说明 本项目将转为开源项目. \(\text{GitHub}\) 仓库下载链接 \(|\) 项目初始化下载 \(|\) 项目编辑文件下载. 项目说明 声明:此项目由 \(\text{So_noSlac ...