ibatis执行存储过程,java.lang.ArrayIndexOutOfBoundsException: 0
来源:互联网 发布:游族网络定增 编辑:程序博客网 时间:2024/05/22 15:16
在项目开发中遇到一个问题,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: 0Caused 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: 0at 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: 0at 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>
0 0
- ibatis执行存储过程,java.lang.ArrayIndexOutOfBoundsException: 0
- java.lang.ArrayIndexOutOfBoundsException: 0错误
- IBatis系列-执行存储过程
- java.lang.ArrayIndexOutOfBoundsException 翻译
- java.lang.ArrayIndexOutOfBoundsException
- java.lang.ArrayIndexOutOfBoundsException
- java.lang.ArrayIndexOutOfBoundsException: 3184
- java.lang.ArrayIndexOutOfBoundsException ireport
- java.lang.ArrayIndexOutOfBoundsException
- java.lang.ArrayIndexOutOfBoundsException
- java.lang.ArrayIndexOutOfBoundsException: 2
- [java.lang.arrayindexoutofboundsexception]错误!
- java.lang.ArrayIndexOutOfBoundsException: 160
- java.lang.ArrayIndexOutOfBoundsException
- java.lang.ArrayIndexOutOfBoundsException: 24444
- java.lang.ArrayIndexOutOfBoundsException
- java.lang.ArrayIndexOutOfBoundsException
- java java.lang.ArrayIndexOutOfBoundsException: 1
- R语言编程艺术 第七八章
- oracle数据库数据量增大的优化措施。
- R语言编程艺术 第九、十章
- 12c资源隔离-实例囚笼
- R语言编程艺术 第十一、十二章
- ibatis执行存储过程,java.lang.ArrayIndexOutOfBoundsException: 0
- 分享一个上传图片,图片压缩Unsupported Image Type解决方案
- R语言编程艺术完结版和读后感
- Python入门教程(1)
- spring手动事务控制
- 正则表达式全部符号解释及55分钟学…
- zlib库使用简单讲解
- 数据挖掘:R语言实战(抽样)
- Maven经验分享(二)配置多资源目录、多classpath