在项目开发中遇到一个问题,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的更多相关文章

  1. Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0

    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at ExTestDrive.main ...

  2. java 中 java.lang.ArrayIndexOutOfBoundsException: 0 异常

    package test; public class Test { public static void main(String[] args) { final int num2 = Integer. ...

  3. 解决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 ...

  4. java.lang.ArrayIndexOutOfBoundsException

    1.错误描述 Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at com.you.m ...

  5. 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 ...

  6. ListView中使用type需要注意的东西 java.lang.ArrayIndexOutOfBoundsException: length=2; index=2 addScrapView

    ListView中使用type需要注意的东西 在使用ListView时,如果使用了getItemViewType, 记得他的值一定要是从0开始计数的. 且要覆盖getViewTypeCount方法.并 ...

  7. Java - 错误: &quot;java.lang.ArrayIndexOutOfBoundsException: length=1; index=1&quot;

    错误: "java.lang.ArrayIndexOutOfBoundsException: length=1; index=1" 本文地址: http://blog.csdn.n ...

  8. android listview Caused by: java.lang.ArrayIndexOutOfBoundsException: length=3; index=3

    android listview 适配器在多种类型viewType报错: Caused by: java.lang.ArrayIndexOutOfBoundsException: length=3; ...

  9. Android BaseAdapter加载多个不同的Item布局时出现UncaughtException in Thread main java.lang.ArrayIndexOutOfBoundsException: length=15; index=15

    java.lang.ArrayIndexOutOfBoundsException: length=15; index=15 异常出现的场景:在做聊天界面时,需要插入表情,图片,文字,名片,还有几种较为 ...

  10. 使用Thumbnailator处理gif图片时遇到java.lang.ArrayIndexOutOfBoundsException: 4096异常处理

    环境 1.7.0_80 在使用Thumbnailator处理gif图片时,遇到问题: Exception in thread "main" java.lang.ArrayIndex ...

随机推荐

  1. 详细讲解 Keil Pack Installer,以及通过 Keil 官网获取 Pack

    前言 大家好,我是梁国庆. 收到粉丝留言,说 Keil 安装 Pack 不太明白,可不可以详细演示一下? 当然可以有,直接视频+文章全部安排,我就是宠粉. PS:第一次录视频有些紧张,见谅哈. 微信视 ...

  2. 开发板测试手册——USB 4G 模块、GPS 定位功能操作步骤详解(3)

    目录 4 USB 4G 模块测试 41 4.1 网络功能测试 42 4.2 短信功能测试 43 4.3 GPS 定位功能测试 44 4.4 通话功能测试 45 4.5 测试程序编译 46 5 USB ...

  3. DownUnderCTF 2024 - Forensics

    DownUnderCTF 2024 - Forensics Baby's First Forensics 他们整个上午都在试图破坏我们的基础设施!他们正试图获得更多关于我们秘密袋鼠的信息!我们需要您的 ...

  4. vulnhub - hackme2

    vulnhub - hackme2 信息收集 还是跟1一样,目录扫描之类的没啥利用点,sql注入先打一遍 SQL注入 sqlmap -u 'http://192.168.157.163/welcome ...

  5. 【PHP】关于fastadmin框架中使用with进行连表查询时setEagerlyType字段的理解

    前言 FastAdmin是我第一个接触的后台管理系统框架.FastAdmin是一款开源且免费商用的后台开发框架,它基于ThinkPHP和Bootstrap两大主流技术构建的极速后台开发框架,它有着非常 ...

  6. c 语言学习第六天

    数组 语法: 类型 数组名[元素个数]; int a[6]; // 4*6 字节 char b[24]; // 1*24 字节 double c[2]; // 2*8 字节 访问数组中的元素 语法: ...

  7. vue中的插槽详解

    插槽(slot)插槽在vue中是一种很常见的写法,让父组件可以向子组件指定位置插入html结构,也是一种组件间通信的方式 一共有三种分类:默认插槽.具名插槽.作用域插槽,下面一一根据案例改造说明 1 ...

  8. Vue3 之 computed 计算属性的使用与源码分析详细注释

    目录 计算属性的基本用法 计算属性的源码 shared 工具方法抽离 计算属性的基本用法 computed 一般有两种常见的用法: 一:传入一个对象,内部有 set 和 get 方法,属于Comput ...

  9. 微信小程序热门选题

    一.大体实现思路 微信小程序,现在是非常热门的,基于微信生态开发的.现在很多计算机毕业的同学,都会选择微信小程序作为毕业设计 小程序端通常都是展示数据给用户去看的,大多数情况下,这些数据不是写死的,而 ...

  10. [rCore学习笔记 08]内核第一条指令

    了解QEMU 启动指令 qemu-system-riscv64 \ -machine virt \ -nographic \ -bios ../bootloader/rustsbi-qemu.bin ...