Hi Folks,

I'm having trouble with a query for a Product class that has an attribute named "pNoticeComanyNumber."

--------- Begin Error Message ----------
12:11:34:895 ERROR ibatis.IbatisProductMaintenance - SQL error:
--- The error occurred in productMap.xml.
--- The error occurred while applying a result map.
--- Check the Product.getProductResult.
--- The error happened while setting a property on the result object.
--- Cause: com.ibatis.common.beans.ProbeException: There is no WRITEABLE property named 'pNoticeCompanyNo' in class 'xyz.ProductEntityBean'
--------- End Error Message ------------

I've checked to verify the attribute exists and is indeed writable (a public setter exists). Of about 20 attributes, four of them have capitals in the second letter. And it's only these four attributes that give me grief. If I don't include these attributes in my result map, my query works fine.

I tried changing the name from "pNoticeCompanyNo" to "pnoticedCompanyNo" (along with the gettings/setters). My error message changes to:

--------- Begin Error Message ----------
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in productMap.xml.
--- The error occurred while applying a result map.
--- Check the Product.getProductResult.
--- 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
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:561)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:536)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:93)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:70)
--------- End Error Message ------------

Here is a snippet from my result map.

<result property="pnoticeCompanyNo" column="P_NOTICE_COMPANY_NO" javaType="long" jdbcType="INTEGER"/>

I get the error whether or not I include the javaType or jdbcTypes attribues. I wish the error message would indicate which property is giving trouble. It took a lot of trial and error to determine it was stumbling on the pNoticeCompanyNo attribute.

My environment is:

iBatis: Build Date: 2005/07/17 20:58
Build Number: 582
2.1.5 - July 17, 2005

DB: Oracle 9i
JVM: IBM 1.4.2
OS: WinXP

Paul

Reply via email to