Select without where clause after table name causes Exception
-------------------------------------------------------------

         Key: IBATIS-312
         URL: http://issues.apache.org/jira/browse/IBATIS-312
     Project: iBatis for Java
        Type: Bug

  Components: SQL Maps  
    Versions: 2.1.7    
 Environment: Oracle 8.1.7
jdk 1.3.1
    Reporter: Florent Carpentier


I have the following query:

        <select id="getCardList" resultClass="Card">
                select crt_idt_raci as racine, crt_typ as type, crt_nbr as num 
from crt_cartes
        </select>

that causes this:
    com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in Card.xml.  
--- The error occurred while applying a result map.  
--- Check the getCardList-AutoResultMap.  
--- The error happened while setting a property on the result object.  
--- 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.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 Main.run(Main.java:39)
        at Main.main(Main.java:25)

Caused by: 
java.lang.NullPointerException
        at oracle.jdbc.ttc7.MAREngine.buffer2Value(MAREngine.java(Compiled 
Code))
        at oracle.jdbc.ttc7.MAREngine.unmarshalUB4(MAREngine.java:864)
        at oracle.jdbc.ttc7.TTIoer.unmarshal(TTIoer.java:138)
        at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:541)
        at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1478)
        at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:969)
        at 
oracle.jdbc.driver.OracleResultSetImpl.next(OracleResultSetImpl.java:267)
        at 
com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:393)
        at 
com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:185)
        at 
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery(GeneralStatement.java:205)
        at 
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:173)
        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 Main.run(Main.java:39)
        at Main.main(Main.java:25)
Exception in thread "main" 

If I write it like this:

        <select id="getCardList" resultClass="Card">select crt_idt_raci as 
racine, crt_typ as type, crt_nbr as num from crt_cartes</select>
or just add something after the table name (where clause or just a space), it 
works.




-- 
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

Reply via email to