[ http://issues.apache.org/jira/browse/IBATIS-344?page=comments#action_12437588 ] sriram easwaran commented on IBATIS-344: ----------------------------------------
The problem was with how i was using CDATA tags around my query which contained xml characters (<, >). Initially my CDATA tag wrapped around the entire select statement which contained the iterate tag. Once my moved my CDATA tag to the region containing xml characters the query worked fine. The rest of my query had no other problems. The error i got from ibatis was misleading but the xml parser was probably feeding it bad data because of the CDATA tags. I have attached the stacktrace for referernce. There is probably already ibatis documentation on this, if not worth adding a few notes on CDATA usage when the query contains tags like iterate. Stacktrace: --- Cause: com.ibatis.common.beans.ProbeException: Error getting ordinal list from JavaBean. Cause java.lang.NumberFormatException: For input string: "" Caused by: java.lang.NumberFormatException: For input string: ""; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in com/sas/finserv/creditfraud/rules/sqlMaps/db2/RuleRepository.xml. --- The error occurred while preparing the mapped statement for execution. --- Check the getExampleQuery. --- Check the parameter map. --- Cause: com.ibatis.common.beans.ProbeException: Error getting ordinal list from JavaBean. Cause java.lang.NumberFormatException: For input string: "" Caused by: java.lang.NumberFormatException: For input string: "" at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:96) at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:257) at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:168) at org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:204) at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:243) at com.sas.finserv.creditfraud.common.persistence.IbatisBaseDAO.retrieveList(IbatisBaseDAO.java:63) > iterate tag does not work for list containing strings > ----------------------------------------------------- > > Key: IBATIS-344 > URL: http://issues.apache.org/jira/browse/IBATIS-344 > Project: iBatis for Java > Issue Type: Bug > Environment: windows, jre 1.4.2 > Reporter: sriram easwaran > > I have an iterate tag in my query that looks like the following: > <iterate property="workflows" open="(" close=")" conjunction="OR" > > state=#workflows[]# > </iterate> > The workflows attribute is an ArrayList containing strings. When i execute > this query i get the following exception: > Cause: com.ibatis.common.beans.ProbeException: Error getting ordinal list > from JavaBean. Cause java.lang.NumberFormatException: For input string: "" > Somehow ibatis seems to think that the list is numeric and i am not sure how > to make the iterate tag work with my list of strings. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira