在项目开发中遇到一个问题,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. Markdown常用语法详解

    背景知识 什么是html html是一种网页标记语言.我们平常见到的那么好看的网页就是通过html语言来编写的. html语言举例: <h1>hello world</h1> ...

  2. 在win10上安装MTK驱动(附驱动下载链接)

    参考:https://www.cnblogs.com/keepgoing707/p/4926171.html 背景 在调试MTK平台MT67XX的时候,发现安装preloader驱动装不上. 第三方i ...

  3. RK3588J + 麒麟系统,“软硬件”全国产——让您的产品更具竞争力!

    银河麒麟嵌入式操作系统简介 银河麒麟嵌入式操作系统V10是面向物联网及工业互联网场景的安全实时嵌入式操作系统,具备信息安全.多域隔离.云边端协同.多样性算力支持等特点,可满足嵌入式场景对操作系统小型化 ...

  4. 小组合作实现的基于 jsp,servlet,mysql 编写的学校管理系统

    基本完成的页面--源代码在<文件>中可下载 文件地址:https://i.cnblogs.com/Files.aspx 学生管理模块各功能已实现 百度网盘下载地址: 链接:https:// ...

  5. HIVE从入门到精通------(1)hive的基本操作

    1.开启hive 1.首先在master的/usr/local/soft/下启动hadoop: master : start-all.sh start-all.sh 2.在另一个master(2)上监 ...

  6. TOPSIS模型原理以及代码实现

    TOPSIS 法是一种常用的组内综合评价方法,能充分利用原始数据的信息,其结果能精确地反映各评价方案之间的差距.下面我们来介绍具体步骤与代码实现 目录 问题提出 第一步:数据输入 1.如何从excel ...

  7. java springboot监听事件和处理事件

    在Spring Boot中,监听和处理事件是一种常用的模式,用于在应用程序的不同部分之间传递信息.Spring 的事件发布/订阅模型允许我们创建自定义事件,并在这些事件发生时由注册的监听器进行处理.这 ...

  8. MySQL 索引失效

    全列匹配 最佳左前缀法则 不在索引列上做任何操作(计算.函数.自动.手动类型转换),会导致索引失效 存储引擎不能使用索引中范围条件右边的列 尽量使用覆盖索引(只访问索引的查询(索引和查询列一致)),少 ...

  9. SQL注入漏洞攻击

    l-> 对于用户登录的实现,提供SQL语句 •-> select * from 表名 where uid=- and pwd=- •-> 使用字符串拼接 l-> 提供密码为:' ...

  10. iOS开发基础100 - MDM证书申请流程

    申请成为MDM Vendor 首先需要拥有一个 iOS Developer Enterprise Program 帐号; 申请成为MDM Vendor,iOS企业开发帐号默认不支持MDM功能,需要向苹 ...