Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 10334 invoked from network); 23 Sep 2005 15:56:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Sep 2005 15:56:03 -0000 Received: (qmail 16760 invoked by uid 500); 23 Sep 2005 15:56:01 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 16739 invoked by uid 500); 23 Sep 2005 15:56:01 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 16726 invoked by uid 99); 23 Sep 2005 15:56:01 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Sep 2005 08:56:01 -0700 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_30_40,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [206.190.49.64] (HELO web53114.mail.yahoo.com) (206.190.49.64) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 23 Sep 2005 08:56:08 -0700 Received: (qmail 89372 invoked by uid 60001); 23 Sep 2005 15:55:37 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=cscdaGIrIhF+AMRHy38kekc9CbRdtZWLsKNwGzdeqh6cQ/CziTDXDtV6hX84+ho3sqGiMYLAsFE0AJnhaAyDxpGmpHRlWbcRoTOq5Vx6NAVTPoY5ZSFjE0tvuDKerUJvZUCbJYXqhdEZz0uIYQNbiCUYpwFUP2jsNtrqtyhPRy4= ; Message-ID: <20050923155537.89370.qmail@web53114.mail.yahoo.com> Received: from [20.137.2.51] by web53114.mail.yahoo.com via HTTP; Fri, 23 Sep 2005 08:55:37 PDT Date: Fri, 23 Sep 2005 08:55:37 -0700 (PDT) From: Prashanth Sukumaran Subject: Re: ProbeException: Error getting ordinal list from JavaBean To: user-java@ibatis.apache.org In-Reply-To: <20050923153230.42934.qmail@web53112.mail.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1008406479-1127490937=:88411" Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --0-1008406479-1127490937=:88411 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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 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; } SLS_HDR.BILL_DOC_NUM = #invoiceNum[]# 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 --0-1008406479-1127490937=:88411 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit
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 <prashanthsukumaran@yahoo.com> 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 --0-1008406479-1127490937=:88411--