Wow.  The reason i was surprised what that the kind of error IBatis threw did not give me any idea that this was the reason. 
 
It was throwing all kind of vague errors. 
1) Probe Exception Error getting ordinal list from JavaBean
2) I thought the map maybe a problem and put it in a Java Bean, now it started throwing there is not readable property "invoiceNumList[]".
 
Since we work in a team environment one of my developers added a <CDATA section not knowing what they were doing.  I just overlooked this thing. When i removed this <CDATA it was magic?
 
I thought may be iBatis, incase of CDATA, would further pass the XML to a parser and then parse it again.  Well then it beats the purpose of CDATA right  Now i understand what the problem was.
 
Prashanth
 


"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
Hi Prashanth,
 
any text within <![CDATA[......]]> is literal text. An XML parser won't parse any elements the CDATA section might contain.
 
-----Ursprüngliche Nachricht-----
Von: Prashanth Sukumaran [mailto:[EMAIL PROTECTED]
Gesendet: Freitag, 23. September 2005 17:56
An: user-java@ibatis.apache.org
Betreff: Re: ProbeException: Error getting ordinal list from JavaBean

Hi Team,
 
I had this problem as the Query i wrote was within CDATA.   When i removed the CDATA it works fine.
 
Why is this a problem?  What kind of logic is there in IBatis to convert a String to Integer when it is in CDATA?
 
Thanks
Prashanth.

Prashanth Sukumaran <[EMAIL PROTECTED]> wrote:
Hi,
I am getting a ProbeException when using an iterate tag in sql maps over a list of string objects.
 
Why does this throw an error when the data is a String.  Also why is IBatis trying to convert it to an Integer. 
 
I have another query working the same when the List of String is in a Bean.  The only difference i see is here the list is in a Map. 
 
Please note that i am just testing the functionality to work for the List.  Later i will pass a List of invoiceNum to this method.
 
 public InvoiceDetailBean getInvoiceDetail(String invoiceNum) throws SystemException {
  Map map = new HashMap();
  List invoiceNumList = new ArrayList();
  invoiceNumList.add(invoiceNum);
  map.put("invoiceNum", invoiceNumList);
  List list = null;
  try {
      list = queryForList("getInvoiceDetail", map);
  } catch (DaoException de) {
   //  throw the exception about transaction failed
   throw new SystemException(de,
     "Unable to retrieve Invoice Detail for "+invoiceNum);
  } 
  return list;
 }

<iterate open="(" close=")" conjunction="OR" property="invoiceNum">

SLS_HDR.BILL_DOC_NUM = #invoiceNum[]#

</iterate>

 

BILL_DOC_NUM in the bean is defined as String and in the SLS_HDR is a VARCHAR2

 
I am using IBatis version 2.1.5 build 582 against Oracle database.
 
Thanks
Prashanth.
 
 

2005-09-15 17:45:25,210   DEBUG   java.sql.Connection - {conn-100006} Connection
2005-09-15 17:45:25,240   ERROR   com.wirelessmob.onlineinvoice.action.InvoiceDetailAction - Search Failed
com.wirelessmob.onlineinvoice.businesslogic.services.InvoiceException: Unable to retrieve Invoice Detail for [0092404226]: Unabl
e to retrieve Invoice Detail for [0092404226]: Failed to queryForList - id [getInvoiceDetail], parameterObject [{invoice
NumList=[0092404226]}].  Cause: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/wirelessmob/onlineinvoice/dataaccess/persistence/sqlmapdao/sql/detailInvoice.xml.
--- The error occurred while preparing the mapped statement for execution.
--- Check the getInvoiceDetail.
--- Check the parameter map.
--- Cause: com.ibatis.common.beans.ProbeException: Error getting ordinal list from JavaBean. Cause java.lang.NumberForma
tException: Fo r input string: ""
Caused by: java.lang.NumberFormatException: For input string: ""
Caused by: com.ibatis.common.beans.ProbeException: Error getting ordinal list from JavaBean. Cause java.lang.NumberForma
tException: For input string: ""
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/wirelessmob/onlineinvoice/dataaccess/persistence/sqlmapdao/sql/detailInvoice.xml.
--- The error occurred while preparing the mapped statement for execution.
--- Check the getInvoiceDetail.
--- Check the parameter map.
--- Cause: com.ibatis.common.beans.ProbeException: Error getting ordinal list from JavaBean. Cause java.lang.NumberForma
tException: For input string: ""
Caused by: java.lang.NumberFormatException: For input string: ""
        at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:18
8)
        at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:123)
        at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:610)
        at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:584)
        at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:101)
        at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:78)
        at com.ibatis.dao.client.template.SqlMapDaoTemplate.queryForList(SqlMapDaoTemplate.java:203)
        ... 49 more
Caused by: com.ibatis.common.beans.ProbeException: Error getting ordinal list from JavaBean. Cause java.lang.NumberForma
tException: For input string: ""
Caused by: java.lang.NumberFormatException: For input string: ""
        at com.ibatis.common.beans.BaseProbe.getIndexedProperty(BaseProbe.java:80)
        at com.ibatis.common.beans.ComplexBeanProbe.getProperty(ComplexBeanProbe.java:297)
        at com.ibatis.common.beans.ComplexBeanProbe.getObject(ComplexBeanProbe.java:197)
        at com.ibatis.common.beans.GenericProbe.getObject(GenericProbe.java:57)
        at com.ibatis.sqlmap.engine.exchange.ComplexDataExchange.getData(ComplexDataExchange.java:65)
        at com.ibatis.sqlmap.engine.mapping.parameter.BasicParameterMap.getParameterObjectValues(BasicParameterMap.java:
132)
        at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:16
5)
        ... 55 more
Caused by: java.lang.NumberFormatException: For input string: ""
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
        at java.lang.Integer.parseInt(Integer.java:468)
        at java.lang.Integer.parseInt(Integer.java:497)
        at com.ibatis.common.beans.BaseProbe.getIndexedProperty(BaseProbe.java:51)
        ... 61 more
 


Yahoo! for Good
Click here to donate to the Hurricane Katrina relief effort.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


Yahoo! for Good
Click here to donate to the Hurricane Katrina relief effort.

Reply via email to