You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Emiliano Armellin <ea...@ateikon.com> on 2005/01/03 10:49:54 UTC

Re: Exception using complex properties

Clinton Begin ha scritto:

>Could you send a stack trace?
>
this is the stack trace:

|2004-12-28 12:28:49,890 WARN 
[org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator] - 
<Unable to translate SQLException with errorCode '0', will now try the 
fallback translator>
2004-12-28 12:28:49,900 INFO 
[org.springframework.jdbc.support.SQLStateSQLExceptionTranslator] - 
<Translating SQLException with SQLState 'null' and errorCode '0' and 
message [ 
--- The error occurred in 
com/ateikon/internet/bepsstore/dao/ibatis/maps/Product.xml. 
--- The error occurred while applying a result map. 
--- Check the Product.searchProductResult. 
--- The error happened while setting a property on the result object. 
--- Cause: com.ibatis.common.exception.NestedRuntimeException: Error 
setting properties of 'Sinto cd MP3 NO memory stick'.  Cause: 
java.lang.NullPointerException
Caused by: java.lang.NullPointerException]; SQL was [] for task 
[SqlMapClient operation]>
2004-12-28 12:28:49,920 DEBUG 
[org.springframework.transaction.support.TransactionSynchronizationManager] 
- <Retrieved value 
[org.springframework.jdbc.datasource.ConnectionHolder@1262f7c] for key 
[org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy@158aac4] 
bound to thread [http-8080-Processor25]>
2004-12-28 12:28:49,930 DEBUG 
[org.springframework.transaction.interceptor.RuleBasedTransactionAttribute] 
- <Applying rules to determine whether transaction should rollback on 
org.springframework.jdbc.UncategorizedSQLException: (SqlMapClient 
operation): encountered SQLException [ 
--- The error occurred in 
com/ateikon/internet/bepsstore/dao/ibatis/maps/Product.xml. 
--- The error occurred while applying a result map. 
--- Check the Product.searchProductResult. 
--- The error happened while setting a property on the result object. 
--- Cause: com.ibatis.common.exception.NestedRuntimeException: Error 
setting properties of 'Sinto cd MP3 NO memory stick'.  Cause: 
java.lang.NullPointerException
Caused by: java.lang.NullPointerException]; nested exception is 
com.ibatis.common.jdbc.exception.NestedSQLException:  
--- The error occurred in 
com/ateikon/internet/bepsstore/dao/ibatis/maps/Product.xml. 
--- The error occurred while applying a result map. 
--- Check the Product.searchProductResult. 
--- The error happened while setting a property on the result object. 
--- Cause: com.ibatis.common.exception.NestedRuntimeException: Error 
setting properties of 'Sinto cd MP3 NO memory stick'.  Cause: 
java.lang.NullPointerException
Caused by: java.lang.NullPointerException>
2004-12-28 12:28:49,950 DEBUG 
[org.springframework.transaction.interceptor.RuleBasedTransactionAttribute] 
- <Winning rollback rule is: null>
2004-12-28 12:28:49,960 DEBUG 
[org.springframework.transaction.interceptor.RuleBasedTransactionAttribute] 
- <No relevant rollback rule found: applying superclass default>
2004-12-28 12:28:49,960 DEBUG 
[org.springframework.transaction.interceptor.TransactionInterceptor] - 
<Invoking rollback for transaction on method 'searchProductList' in 
class [com.ateikon.internet.bepsstore.domain.logic.BepsStoreFacade] due 
to throwable [org.springframework.jdbc.UncategorizedSQLException: 
(SqlMapClient operation): encountered SQLException [ 
|
in Product.xml I've got a resultMap with this:

|<result property="cdrifart" column="cdrifart"/>|
|<result property="countKitCompRif" column="cdrifart" 
select="checkKitCompRif" nullValue="0"/>

|where *cdrifart* is a String and the column field value is sometimes 
*null* and gives the exception (I don't know why it writes |Error 
setting properties of 'Sinto cd MP3 NO memory stick'| it seems a wrong 
message||, there are no exceptions writing this properties without 
|property="countKitCompRif"| mapping)

|checkKitCompRif |is simply a select count and |countKitCompRif |an int 
value

DB: Oracle 8.1.7

hope it helps


-- 
Emiliano Armellin

    *
      W_
      www.ateikon.com <http://www.ateikon.com>
    *
      @_
      earmellin@ateikon.com <ma...@ateikon.com>
    *
      T_
      *+39 0422 452101*

Get Firefox! <http://www.spreadfirefox.com/?q=affiliates&id=15653&t=86>
Get Thunderbird <http://www.mozilla.org/products/thunderbird/>

Re: Exception using complex properties

Posted by Clinton Begin <cl...@gmail.com>.
I hate to say this, but the root of this exception does not seem to be
coming from iBATIS.  The root cause seems to be coming from inside the
bean setter, or perhaps an interceptor (poxy/enhancer) between the
ibatis call and the real bean setter.

Could I suggest that you trace through using the iBATIS source and the
Spring source?

I'll write a unit test to verify that this works on my end.

Cheers,
Clinton


On Mon, 03 Jan 2005 10:49:54 +0100, Emiliano Armellin
<ea...@ateikon.com> wrote:
>  Clinton Begin ha scritto: 
>  Could you send a stack trace? this is the stack trace:
>  
>  2004-12-28 12:28:49,890 WARN
> [org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator] -
> <Unable to translate SQLException with errorCode '0', will now try the
> fallback translator>
>  2004-12-28 12:28:49,900 INFO
> [org.springframework.jdbc.support.SQLStateSQLExceptionTranslator] -
> <Translating SQLException with SQLState 'null' and errorCode '0' and message
> [  
>  --- The error occurred in
> com/ateikon/internet/bepsstore/dao/ibatis/maps/Product.xml.  
>  --- The error occurred while applying a result map.  
>  --- Check the Product.searchProductResult.  
>  --- The error happened while setting a property on the result object.  
>  --- Cause: com.ibatis.common.exception.NestedRuntimeException: Error
> setting properties of 'Sinto cd MP3 NO memory stick'.  Cause:
> java.lang.NullPointerException
>  Caused by: java.lang.NullPointerException]; SQL was [] for task
> [SqlMapClient operation]>
>  2004-12-28 12:28:49,920 DEBUG
> [org.springframework.transaction.support.TransactionSynchronizationManager]
> - <Retrieved value
> [org.springframework.jdbc.datasource.ConnectionHolder@1262f7c] for key
> [org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy@158aac4]
> bound to thread [http-8080-Processor25]>
>  2004-12-28 12:28:49,930 DEBUG
> [org.springframework.transaction.interceptor.RuleBasedTransactionAttribute]
> - <Applying rules to determine whether transaction should rollback on
> org.springframework.jdbc.UncategorizedSQLException: (SqlMapClient
> operation): encountered SQLException [  
>  --- The error occurred in
> com/ateikon/internet/bepsstore/dao/ibatis/maps/Product.xml.  
>  --- The error occurred while applying a result map.  
>  --- Check the Product.searchProductResult.  
>  --- The error happened while setting a property on the result object.  
>  --- Cause: com.ibatis.common.exception.NestedRuntimeException: Error
> setting properties of 'Sinto cd MP3 NO memory stick'.  Cause:
> java.lang.NullPointerException
>  Caused by: java.lang.NullPointerException]; nested exception is
> com.ibatis.common.jdbc.exception.NestedSQLException:   
>  --- The error occurred in
> com/ateikon/internet/bepsstore/dao/ibatis/maps/Product.xml.  
>  --- The error occurred while applying a result map.  
>  --- Check the Product.searchProductResult.  
>  --- The error happened while setting a property on the result object.  
>  --- Cause: com.ibatis.common.exception.NestedRuntimeException: Error
> setting properties of 'Sinto cd MP3 NO memory stick'.  Cause:
> java.lang.NullPointerException
>  Caused by: java.lang.NullPointerException>
>  2004-12-28 12:28:49,950 DEBUG
> [org.springframework.transaction.interceptor.RuleBasedTransactionAttribute]
> - <Winning rollback rule is: null>
>  2004-12-28 12:28:49,960 DEBUG
> [org.springframework.transaction.interceptor.RuleBasedTransactionAttribute]
> - <No relevant rollback rule found: applying superclass default>
>  2004-12-28 12:28:49,960 DEBUG
> [org.springframework.transaction.interceptor.TransactionInterceptor] -
> <Invoking rollback for transaction on method 'searchProductList' in class
> [com.ateikon.internet.bepsstore.domain.logic.BepsStoreFacade] due to
> throwable [org.springframework.jdbc.UncategorizedSQLException: (SqlMapClient
> operation): encountered SQLException [  
>  
>  in Product.xml I've got a resultMap with this:
>  
>  <result property="cdrifart" column="cdrifart"/>
>  <result property="countKitCompRif" column="cdrifart"
> select="checkKitCompRif" nullValue="0"/>
>  
>  where cdrifart is a String and the column field value is sometimes null and
> gives the exception (I don't know why it writes Error setting properties of
> 'Sinto cd MP3 NO memory stick' it seems a wrong message, there are no
> exceptions writing this properties without property="countKitCompRif"
> mapping)
>  
>  checkKitCompRif is simply a select count and countKitCompRif an int value
>  
>  DB: Oracle 8.1.7
>  
>  hope it helps
> 
>  
>  
>  
> -- 
>  
> Emiliano Armellin 
>  
> W_ www.ateikon.com 
>  
> @_ earmellin@ateikon.com 
>  
> T_ 
> +39 0422 452101 
>  
>