Hey Prashanth,

Can we see the code for Shop.java?

Kris

Prashanth Sukumaran wrote:

Hi,

I am getting the following NestedSQLException.  I think the problem is due to 
some null values
stored in the database.  Why should there be a Null Pointer Exception while 
setting the data into
the bean that i have passed?

Has anybody got a similar error.  I am also pasting the sql definition here.

Thanks a lot

Prashanth

PS:  IBatis is awsome.  I love everything about the way it is done and way it 
helps me to write
clean code.  The XML representatioin of the SQL is the best.  I don't like to 
have SQL in my Java
Code. Even though you will be adding new enhancements to iBatis, please keep 
this XML
represenatation of SQL query as it is. Thanks a lot for all the hardwork you 
guys are putting and
make our lives easier.


<select id="getShopByShopId" resultMap="shopResult" parameterClass="int">
select SHOPID, SHOPNAME, SHOPSTREETADDRESS1, SHOPSTREETADDRESS2, SHOPCITY, STATEID, SHOPZIPCODE, REGIONID, DECODE(TBLSHOPS.TECHNICIAN,NULL,'', SALESMAN.SALESMAN_LAST_NM || ', ' ||
SALESMAN.SALESMAN_FIRST_NM) SALESMAN_NAME
from TBLSHOPS, SALESMAN WHERE TBLSHOPS.SHOPID = #value# AND TBLSHOPS.active = 'Y' AND
TBLSHOPS.TECHNICIAN = SALESMAN.SALESMAN_ID (+)


</select>


Nested Exception is...
com.ibatis.dao.client.DaoException: Failed to execute queryForObject - id [getShopByShopId],
parameterObject [1877]. Cause: com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in com/wirelessmob/solutions/dataaccess/persistence/sqlmapdao/sql/Shop.xml.


--- The error occurred while applying a result map. --- Check the Shop.shopResult. --- The error happened while setting a property on the result object. --- Cause: com.ibatis.common.exception.NestedRuntimeException: Error setting properties of
'[EMAIL PROTECTED]'. Cause: java.lang.NullPointerException
Caused by: java.lang.NullPointerException
Caused by: com.ibatis.common.exception.NestedRuntimeException: Error setting properties of
'[EMAIL PROTECTED]'. Cause: java.lang.NullPointerException
Caused by: java.lang.NullPointerException
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in com/wirelessmob/solutions/dataaccess/persistence/sqlmapdao/sql/Shop.xml.


--- The error occurred while applying a result map. --- Check the Shop.shopResult. --- The error happened while setting a property on the result object. --- Cause: com.ibatis.common.exception.NestedRuntimeException: Error setting properties of
'[EMAIL PROTECTED]'. Cause: java.lang.NullPointerException
Caused by: java.lang.NullPointerException
Caused by: com.ibatis.common.exception.NestedRuntimeException: Error setting properties of
'[EMAIL PROTECTED]'. Cause: java.lang.NullPointerException
Caused by: java.lang.NullPointerException
at com.ibatis.dao.client.template.SqlMapDaoTemplate.queryForObject(SqlMapDaoTemplate.java:164)




__________________________________ Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail







--
Kris Jenkins
Email:  [EMAIL PROTECTED]
Blog:   http://cafe.jenkster.com/
Wiki:   http://wiki.jenkster.com/



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.11 - Release Date: 12/01/2005



Reply via email to