`
huibin
  • 浏览: 756911 次
  • 性别: Icon_minigender_1
  • 来自: 郑州
社区版块
存档分类
最新评论

Ibasis Caused by: java.lang.RuntimeException: JavaBeansDataExchange could not in

阅读更多

Ibasis Caused by: java.lang.RuntimeException: JavaBeansDataExchange could not instantiate result class. Cause: java.lang.InstantiationException:解决办法

 

现象:

Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in ibatis-maps/OsobyAdresy.xml.
--- The error occurred while applying a result map.
--- Check the getOsobaById-AutoResultMap.
--- The error occured while instantiating the result object
--- Cause: java.lang.RuntimeException: JavaBeansDataExchange could not instantiate result class.  Cause: java.lang.InstantiationException: cz.dynawest.isir.beans.Osoba
 at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:204)
 at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForObject(MappedStatement.java:120)
 at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:518)
 at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:493)
 at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:106)
 at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:82)
 ... 9 more
Caused by: java.lang.RuntimeException: JavaBeansDataExchange could not instantiate result class.  Cause: java.lang.InstantiationException: cz.dynawest.isir.beans.Osoba
 at com.ibatis.sqlmap.engine.exchange.JavaBeanDataExchange.setData(JavaBeanDataExchange.java:108)
 at com.ibatis.sqlmap.engine.mapping.result.ResultMap.setResultObjectValues(ResultMap.java:371)
 at com.ibatis.sqlmap.engine.mapping.result.AutoResultMap.setResultObjectValues(AutoResultMap.java:57)
 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.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteQuery(MappedStatement.java:221)
 at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:189)
 ... 16 more
Caused by: java.lang.InstantiationException: cz.dynawest.isir.beans.Osoba
 at java.lang.Class.newInstance0(Unknown Source)
 at java.lang.Class.newInstance(Unknown Source)
 at com.ibatis.common.resources.Resources.instantiate(Resources.java:302)
 at com.ibatis.sqlmap.engine.mapping.result.ResultObjectFactoryUtil.createObjectInternally(ResultObjectFactoryUtil.java:123)
 at com.ibatis.sqlmap.engine.mapping.result.ResultObjectFactoryUtil.createObjectThroughFactory(ResultObjectFactoryUtil.java:91)
 at com.ibatis.sqlmap.engine.exchange.JavaBeanDataExchange.setData(JavaBeanDataExchange.java:106)
 ... 24 more

解决办法:增加default constructor

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics