溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

ibatis resultMap報(bào)錯(cuò)的解決方法是什么

發(fā)布時(shí)間:2021-12-07 16:25:13 來(lái)源:億速云 閱讀:302 作者:柒染 欄目:編程語(yǔ)言

這篇文章將為大家詳細(xì)講解有關(guān)ibatis resultMap報(bào)錯(cuò)的解決方法是什么,文章內(nèi)容質(zhì)量較高,因此小編分享給大家做個(gè)參考,希望大家閱讀完這篇文章后對(duì)相關(guān)知識(shí)有一定的了解。

ibatis resultMap報(bào)錯(cuò)信息:

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

這個(gè)ibatis resultMap錯(cuò)誤信息指出resultMap里有問(wèn)題。說(shuō)錯(cuò)誤發(fā)生在設(shè)置某一個(gè)屬性的時(shí)候,但是沒(méi)有具體說(shuō)明是一個(gè)怎么樣的錯(cuò)誤。由于對(duì)于ibatis了解還不是很深,所以一時(shí)不知如何事好。只有在ibatis resultMap里面作文章,把里面的注釋掉一些,哈哈,程序居然正常跑起來(lái)了??磥?lái)我快要找到錯(cuò)誤了,接著繼續(xù)排除其它的,終于讓我找到出錯(cuò)的一行了: 

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

關(guān)于ibatis resultMap報(bào)錯(cuò)的解決方法是什么就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,可以學(xué)到更多知識(shí)。如果覺(jué)得文章不錯(cuò),可以把它分享出去讓更多的人看到。

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI