ibatis resultMap报错的解决方法是什么

发布时间:2021-12-07 16:25:13 作者:柒染
来源:亿速云 阅读:301

这篇文章将为大家详细讲解有关ibatis resultMap报错的解决方法是什么,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。

ibatis resultMap报错信息:

SQLErrorCodesFactory - Database product name cached for DataSource [org.apache.commons.dbcp.BasicDataSource@19c5048]: name is 'MySQL'
SQLErrorCodesFactory - SQL error codes for 'MySQL' found
SQLErrorCodeSQLExceptionTranslator - Unable to translate SQLException with Error code '0', will now try the fallback translator
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 net/jbbs/dao/ibatis/map/user.xml.
--- The error occurred while applying a result map.
--- Check the user.userResult.
--- 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 net/jbbs/dao/ibatis/map/user.xml.
--- The error occurred while applying a result map.
--- Check the user.userResult.
--- The error happened while setting a property on the result object.
--- Cause: net.sf.cglib.beans.BulkBeanException
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:  
--- The error occurred in net/jbbs/dao/ibatis/map/user.xml.
--- The error occurred while applying a result map.
--- Check the user.userResult.
--- The error happened while setting a property on the result object.
--- Cause: net.sf.cglib.beans.BulkBeanException
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 net.jbbs.dao.ibatis.UserDAOImpl.findByEmail(UserDAOImpl.java:54)
at net.jbbs.test.UserTest.findByEmail(UserTest.java:42)
at net.jbbs.test.UserTest.main(UserTest.java:34)
Caused by: net.sf.cglib.beans.BulkBeanException
at net.jbbs.domain.User$$BulkBeanByCGLIB$$88b6b34d.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.BasicResultMap.setResultObjectValues(BasicResultMap.java:373)
at com.ibatis.sqlmap.engine.mapping.statement.RowHandlerCallback.handleResultObject(RowHandlerCallback.java:64)
at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:382)
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)
... 10 more

这个ibatis resultMap错误信息指出resultMap里有问题。说错误发生在设置某一个属性的时候,但是没有具体说明是一个怎么样的错误。由于对于ibatis了解还不是很深,所以一时不知如何事好。只有在ibatis resultMap里面作文章,把里面的注释掉一些,哈哈,程序居然正常跑起来了。看来我快要找到错误了,接着继续排除其它的,终于让我找到出错的一行了: 

<result property="deleted" column="deleted"/>

关于ibatis resultMap报错的解决方法是什么就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

推荐阅读:
  1. 将ibatis迁移到mybatis3时需要注意哪些事项
  2. iBATIS SQLMap如何配置

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

ibatis resultmap

上一篇:如何解决微软自带JDBC的resultset缺陷

下一篇:Windows 10的计算机上如何修复MBR问题

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》