日期:2014-05-16  浏览次数:20599 次

Ibatis错误com.ibatis.common.jdbc.exception.NestedSQLException

今天遇到一个问题,Ibatis查询时,同样的配置,当返回的数据集为空的时候报错,有数据时就不报错。

org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0];   
--- The error occurred in com/tongcard/tcc/report/ibatis/memberReport_SqlMap.xml.  
--- The error occurred while applying a result map.  
--- Check the MemberAddReport_Map.totalMember.  
--- The error happened while setting a property on the result object.  
--- Cause: net.sf.cglib.beans.BulkBeanException; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in com/tongcard/tcc/report/ibatis/memberReport_SqlMap.xml.  
--- The error occurred while applying a result map.  
--- Check the MemberAddReport_Map.totalMember.  
--- The error happened while setting a property on the result object.  
--- Cause: net.sf.cglib.beans.BulkBeanException
	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:212)
	at org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:249)
	at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:296)
	at com.tongcard.tcc.report.manager.impl.MemberAddReportManagerImpl.queryTotalMemberAdd(MemberAddReportManagerImpl.java:32)
	at com.tongcard.tcc.report.manager.impl.MemberAddReportManagerImpl$$FastClassByCGLIB$$c8e1b67c.invoke(<generated>)
	at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
	at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700)
	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.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)
	at com.tongcard.tcc.report.manager.impl.MemberAddReportManagerImpl$$EnhancerByCGLIB$$2b581bd2.queryTotalMemberAdd(<generated>)
	at com.tongcard.tcc.report.MemberAddReportService.loadMemberAdd(MemberAddReportService.java:95)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:421)
	at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183)
	at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1503)
	at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:884)
	at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:121)
	at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
	at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44)
	at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
	at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:146)
	at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:278)
	at org.springframework.flex.servlet.MessageBrokerHandlerAdapte