Cause: java.lang.ArrayIndexOutOfBoundsException: 1; nested exception is com.ibat

碰到Cause: java.lang.ArrayIndexOutOfBoundsException: 1; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException 这个问题

 

原来是数据库中存在dbtrade,但是customInfo不存在,直接update导致的.

 

//A.存在付款时间,则表示已经统计过

if(dbtrade!=null && dbtrade.getPay_time()!=null){

//更新用户基本信息

fillCustomBaseInfo(trade,dbcustomInfo);

topApplicationDao.update("top.trade.updateCustom", dbcustomInfo);

return dbcustomInfo;

}

 

<update id="updateCustom">

update custom_info set 

   name=#name#,

state=#state#,

city=#city#

where xxx_nick=#xxx_nick# and nick=#nick#

</update>

 

这段代码的问题.

因为dbcustomInfo 为null 转化的时候报错导致

 

代码修改成问题解决

if(dbtrade!=null && dbtrade.getPay_time()!=null){

if(dbcustomInfo==null){

dbcustomInfo = createCustomByTrade(trade, dbcustomInfo, comUid, sid, comCacheTools);

return dbcustomInfo;

}

//更新用户基本信息

fillCustomBaseInfo(trade,dbcustomInfo);

topApplicationDao.update("top.trade.updateCustom", dbcustomInfo);

return dbcustomInfo;

}

 

 

 

=====================详细错误=====================

[ERROR] 2013-06-21 21:30:19.161 com.hupun.crmbatch.service.trade.TOPTradeImporter 更新用户信息统计失败!

org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0];   

--- The error occurred while applying a parameter map.  

--- Check the top.trade.updateCustom-InlineParameterMap.  

--- Check the parameter mapping for the 'name' property.  

--- Cause: java.lang.ArrayIndexOutOfBoundsException: 1; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:   

--- The error occurred while applying a parameter map.  

--- Check the top.trade.updateCustom-InlineParameterMap.  

--- Check the parameter mapping for the 'name' property.  

--- Cause: java.lang.ArrayIndexOutOfBoundsException: 1

at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)

at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)

at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)

at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:203)

at org.springframework.orm.ibatis.SqlMapClientTemplate.update(SqlMapClientTemplate.java:378)

at com.hupun.crmbatch.dao.AbstractIbatisDaoSupport.update(AbstractIbatisDaoSupport.java:120)

at com.hupun.crmbatch.service.trade.TOPTradeImporter.updateCustomSummary(TOPTradeImporter.java:330)

at com.hupun.crmbatch.service.trade.TOPTradeImporter.store(TOPTradeImporter.java:133)

at com.hupun.crm.test.top.trade.TopTradeDownloadTest.testNotExistCustom(TopTradeDownloadTest.java:209)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:601)

at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)

at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)

at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)

at com.taobao.itest.core.statements.RunBeforeTestMethod.evaluate(RunBeforeTestMethod.java:54)

at com.taobao.itest.core.statements.RunAfterTestMethod.evaluate(RunAfterTestMethod.java:60)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值