ibatis转换的一个问题

2016-10-15 17:18:39,162 ERROR (com.test.framework.progress.utils.ProgressUtils:126) - poolTaskExecutor 线程池:SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0];

--- The error occurred in com/test/framework/dao/ibatis2/ibatis.xml.

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

--- Check the com.test.lol.code.sql.selectCodeInfoByCond-AutoResultMap.

--- The error happened while setting a property on the result object.

--- Cause: net.sf.cglib.beans.BulkBeanException: java.lang.String cannot be cast to java.lang.Long; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:

--- The error occurred in com/test/framework/dao/ibatis2/ibatis.xml.

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

--- Check the com.test.lol.code.sql.selectCodeInfoByCond-AutoResultMap.

--- The error happened while setting a property on the result object.

--- Cause: net.sf.cglib.beans.BulkBeanException: java.lang.String cannot be cast to java.lang.Long

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

--- The error occurred in com/test/framework/dao/ibatis2/ibatis.xml.

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

--- Check the com.test.lol.code.sql.selectCodeInfoByCond-AutoResultMap.

--- The error happened while setting a property on the result object.

--- Cause: net.sf.cglib.beans.BulkBeanException: java.lang.String cannot be cast to java.lang.Long; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:

--- The error occurred in com/test/framework/dao/ibatis2/ibatis.xml.

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

--- Check the com.test.lol.code.sql.selectCodeInfoByCond-AutoResultMap.

--- The error happened while setting a property on the result object.

--- Cause: net.sf.cglib.beans.BulkBeanException: java.lang.String cannot be cast to java.lang.Long
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.executeWithListResult(SqlMapClientTemplate.java:243)
at com.test.framework.dao.ibatis2.Ibatis2SqlMapClientTemplate.query4VCommList(Ibatis2SqlMapClientTemplate.java:129)
at com.test.framework.dao.ibatis2.Ibatis2SqlMapClientTemplate.queryForVCommList(Ibatis2SqlMapClientTemplate.java:225)
at com.test.lol.code.service.CodeServiceImpl.selectCodeInfoByCond(CodeServiceImpl.java:2508)
at com.test.lol.code.service.CodeServiceImpl$$FastClassByCGLIB$$740dee32.invoke()
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.aop.aspectj.AspectJAfterAdvice.invoke(AspectJAfterAdvice.java:42)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:55)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
at com.test.lol.code.service.CodeServiceImpl$$EnhancerByCGLIB$$ab958bb2.selectCodeInfoByCond()
at com.test.lol.code.action.CodeAction.selectCodeInfoByCond(CodeAction.java:243)
at com.test.lol.code.action.ExportallAction.category(ExportallAction.java:306)
at com.test.lol.code.action.ExportallAction.exportyAll(ExportallAction.java:274)
at com.test.lol.code.action.ExportallAction$1.execute(ExportallAction.java:221)
at com.test.framework.progress.utils.ProgressUtils$2.run(ProgressUtils.java:124)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:

--- The error occurred in com/test/framework/dao/ibatis2/ibatis.xml.

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

--- Check the com.test.lol.code.sql.selectCodeInfoByCond-AutoResultMap.

--- The error happened while setting a property on the result object.

--- Cause: net.sf.cglib.beans.BulkBeanException: java.lang.String cannot be cast to java.lang.Long
at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:204)
at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForList(MappedStatement.java:139)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:567)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:541)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118)
at com.test.framework.dao.ibatis2.Ibatis2SqlMapClientTemplate$1.doInSqlMapClient(Ibatis2SqlMapClientTemplate.java:131)
at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:200)
... 26 more
Caused by: net.sf.cglib.beans.BulkBeanException: java.lang.String cannot be cast to java.lang.Long
at com.test.lol.code.valueobject.CodeInfo$$BulkBeanByCGLIB$$80c55f8f.setPropertyValues()
at com.ibatis.sqlmap.engine.accessplan.EnhancedPropertyAccessPlan.setProperties(EnhancedPropertyAccessPlan.java:33)
at com.ibatis.sqlmap.engine.exchange.JavaBeanDataExchange.setData(JavaBeanDataExchange.java:112)
at com.ibatis.sqlmap.engine.mapping.result.ResultMap.setResultObjectValues(ResultMap.java:371)
at com.ibatis.sqlmap.engine.mapping.result.AutoResultMap.setResultObjectValues(AutoResultMap.java:54)
at com.ibatis.sqlmap.engine.mapping.statement.RowHandlerCallback.handleResultObject(RowHandlerCallback.java:64)
at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:385)
at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleMultipleResults(SqlExecutor.java:300)
at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:189)
at com.test.framework.dao.ibatis2.LimitSqlExecutor.executeQuery(LimitSqlExecutor.java:82)
at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteQuery(MappedStatement.java:221)
at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:189)
... 32 more
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Long
... 44 more

1个回答

研究很久了 也没研究出来,像是ibatis的BUG

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐