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 ...
随机推荐
- linux中cp复制时处理软链接的两种方式
linux中cp复制时处理软链接的两种方式 cp -r -L 复制原始文件 cp -r -P 复制软链接本身
- 【路径规划】OSQP曲线平滑 公式及代码
参考与前言 apollo 代码:https://github.com/ApolloAuto/apollo/tree/master/modules/planning/math/smoothing_spl ...
- EC热键问题
EC热键问题 ec 问题描述 ACPI事件监控 按键监控 UDEV事件监控 kprobe探测 初步总结热键功能流程 调试记录 PS2 问题描述 系统无触摸板打开和关闭的提示 已知热键功能 快捷键 功能 ...
- 国产RK3568J基于FSPI的ARM+FPGA通信方案分享
近年来,随着中国新基建.中国制造 2025 规划的持续推进,单 ARM 处理器越来越难胜任工业现场的功能要求,特别是如今能源电力.工业控制.智慧医疗等行业,往往更需要 ARM + FPGA 架构的处理 ...
- 制作visual studio 离线安装包
应用场景:脱机.内网环境安装vs开发环境. 概述:在互联网环境下载安装工具,下载根据需求并缓存布局(类似功能模块),压缩缓存内容拷贝至离线环境进行安装. 1.官网下载指定版本的vs安装客户端 创建基于 ...
- windows下rust环境的安装(现在是2023年5月份)
在自己家电脑上安装一下rust,还是遇到一些问题,这里记录一下,免得后面再踩坑. 官方网站 获取主要信息还得靠官网,比如安装软件:) 地址是 https://www.rust-lang.org/zh- ...
- mac idea快捷键整理
抽取局部变量 option+commamd+v 生成方法内变量 option+commamd+f 生成类的静态变量 找方法 2次shift 优化import Ctrl + Alt + O 格式化代码 ...
- oeasy 教您玩转 linux 之 010302 火狐浏览器 firefox
我们来回顾一下 上一部分我们都讲了什么? oneko xeyes 这次看看这个火狐 火狐 看看当前版本 看看是否可以更新 如果需要更新就更新 firefox -v apt search f ...
- oeasy教您玩转vim - 62 - # 缓冲buffer
编辑过程 回忆上次 我们这次了解了编辑过程 默认有一个替换文件swap 修改的内容会保存到一个swap文件 如果swp已经存在 会有个swo文件 以此类推 替换文件可以进行对源文件的修复 没保存到 ...
- C# 常用类和命名空间
Array类 用括号声明数组是C#中使用Array类的记号.在后台使用C#语法,会创建一个派生于抽象基类Array的新类.这样,就可以使用Array类为每个C#数组定义的方法和属性了. Array类实 ...