字写多了,异常还没帖出来,现在帖出来:
SQLErrorCodeSQLExceptionTranslator - Unable to translate SQLException with Error code '0', will now try the fallback translator
DataSourceUtils - Returning JDBC Connection to DataSource
DataSourceUtils - Returning JDBC Connection to DataSource
Exception in thread "main" org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0];   
--- The error occurred in com/mzh/xml/User.xml.  
--- The error occurred while applying a result map.  
--- Check the User.get-user-userinfo.  
--- Check the result mapping for the 'userInfo' property.  
--- Cause: net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in com/mzh/xml/User.xml.  
--- The error occurred while applying a result map.  
--- Check the User.get-user-userinfo.  
--- Check the result mapping for the 'userInfo' property.  
--- Cause: net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in com/mzh/xml/User.xml.  
--- The error occurred while applying a result map.  
--- Check the User.get-user-userinfo.  
--- Check the result mapping for the 'userInfo' property.  
--- Cause: net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:188)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject(GeneralStatement.java:104)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:566)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:541)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:106)
at org.springframework.orm.ibatis.SqlMapClientTemplate$1.doInSqlMapClient(SqlMapClientTemplate.java:243)
at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:193)
at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForObject(SqlMapClientTemplate.java:241)
at com.mzh.dao.UserDaoImpl.getUserAndUserInfo(UserDaoImpl.java:58)
at com.mzh.service.UserServiceImpl.getUserAndUserInfo(UserServiceImpl.java:98)
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 org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)
at $Proxy0.getUserAndUserInfo(Unknown Source)
at com.mzh.test.Test.main(Test.java:63)
Caused by: net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237)
at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:285)
at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:660)
at com.ibatis.sqlmap.engine.mapping.result.loader.EnhancedLazyResultLoader$EnhancedLazyResultLoaderImpl.loadResult(EnhancedLazyResultLoader.java:104)
at com.ibatis.sqlmap.engine.mapping.result.loader.EnhancedLazyResultLoader.loadResult(EnhancedLazyResultLoader.java:59)
at com.ibatis.sqlmap.engine.mapping.result.loader.ResultLoader.loadResult(ResultLoader.java:53)
at com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.getNestedSelectMappingValue(BasicResultMap.java:502)
at com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.getResults(BasicResultMap.java:340)
at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:381)
at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleMultipleResults(SqlExecutor.java:301)
at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:190)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery(GeneralStatement.java:205)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:173)
... 17 more
Caused by: java.lang.reflect.InvocationTargetException
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 net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219)
... 30 more
Caused by: java.lang.SecurityException: class "com.mzh.vo.UserInfo$$EnhancerByCGLIB$$47dca6b0"'s signer information does not match signer information of other classes in the same package
at java.lang.ClassLoader.checkCerts(ClassLoader.java:775)
at java.lang.ClassLoader.preDefineClass(ClassLoader.java:487)
at java.lang.ClassLoader.defineClass(ClassLoader.java:614)
... 36 more

解决方案 »

  1.   

    第1个查询写的有问题吧
    <select   id="getUserAndUserInfo"     parameterClass="user"   resultMap="get-user-userinfo"> 
    <![CDATA[ 
    SELECT 
    USERID,   
    UALIAS,   
    PASSWORD,   
    REALNAME,   
    EMAIL, 
    USERTYPEID   
    USERID     //这不需要把USERID加上么?
    FROM   T_USERS   
    WHERE   
    USERID=#userid#   
    ]]>
    </select> 
      

  2.   

    哦。谢谢你的回复,你说的这个问题是我帖代码的时候帖错了,现在是没有USERID了,错误还是依旧
      

  3.   

    ......感觉好像说叉了 我是说应该加上USERID 不是去掉 你以前的代码是没有USERID这句的......
      

  4.   

    你加上USERID问题还是一样么?
      

  5.   

    问题终于解决了,这次使用的延迟加载机制是才用cglib的,cglib延迟加载有一个jar包,cglib-nodep-2.1_3.jar。
    而ibatis-2.3.0.677的ibatis-2.3.0.677.jar里也提供了cglib延迟加载,原来我是加了ibatis的jar包,又加了cglib的jar包,所有在不设置延迟加载的时候没问题,设置的时候由于jar的问题,就有问题