在项目开发中遇到一个问题,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. C#如何创建一个可快速重复使用的项目模板

    写在前面 其实很多公司或者资深的开发都有自己快速创建项目的脚手架的,有的是魔改代码生成器实现,有的直接基于T4,RazorEngine等模板引擎打造:但无论如何,其最终目的其实就是搭建一个自定义项目模 ...

  2. Android 7.0 开机时间优化

    原文参考(有删改):https://www.jianshu.com/p/6dba42c022a9 问题描述 开机时间相对参考机过慢,大约慢15s左右.Android 系统7.0. 问题分析 开机问题涉 ...

  3. 攻防世界——CRYPTO新手练习区解题总结<1>(1-4题)

    第一题base64: 下载附件,得到一个txt文件,打开 得到一串乱码,由题目可知,是base64,解码得到flag 第二题Caesar: 下载附件得到乱码 oknqdbqmoq{kag_tmhq_x ...

  4. Advanced .Net Debugging 10:事后调试

    一.介绍 这是我的<Advanced .Net Debugging>这个系列的第十篇文章.这篇文章的内容是原书的第三部分的[高级主题]的第八章[事后调试].前面几篇文章,我们介绍了很多工具 ...

  5. Qt--共享内存监听工具

    共享内存概述 共享内存的特点: 1)共享内存是进程共享数据的一种最快的方法. 一个进程向共享内存区域写入了数据,共享这个内存区域的所有进程就可以立刻看到其中的内容. 2)使用共享内存要注意的是多个进程 ...

  6. Linux使用Tomcat常用命令

    切换到tomcat主目录下 cd usr/local/tomcat # 1.启动tomcat服务 # 方式一:直接启动 bin/startup.sh # 方式二:作为服务启动(推荐) nohup bi ...

  7. SpringMVC面试题及答案

    SpringMvc 的控制器是不是单例模式,如果是,有什么问题,怎么解决? 问题:单例模式,在多线程访问时有线程安全问题 解决方法:不要用同步,在控制器里面不能写字段 SpringMvc 中控制器的注 ...

  8. 【算法】在vue3的ts代码中分组group聚合源数据列表

    有一个IList<any>()对象列表, 示例数据为[{id:'1',fieldName:'field1',value:'1'},{id:'1',fieldName:'field2',va ...

  9. WSS SSL HTTPS之间的关系

    ssl: secure socket layer 安全套接层,简单来说是一种加密技术,通过它可以在通信的双方上建立一个安全的通信链路,因此数据交互的双方可以安全地通信,而不用担心数据被窃取:wss: ...

  10. [oeasy]python0133_变量名_标识符_identifier_id_locals

    变量名 回忆上次内容 上次讲了 什么是变量 变量变量 能变的量 就是变量   各种系统.游戏就是由变量所组成的 ​   添加图片注释,不超过 140 字(可选)   声明了变量 并且 定义了变量   ...