iBatis for Java [READ ONLY]
  1. iBatis for Java [READ ONLY]
  2. IBATIS-152

NullPointer Exception thrown in GeneralStatement.executeQueryWithCallback when using Log4j

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.1.5
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Windows XP, Java 1.3

      Description

      Hi,

      I am trying to follow the supplied test for IBATIS-53 (Oracle ref cursors).

      I have found that running the supplied test (number 6) with log4j-1.2.9.jar on
      the classpath causes a NullPointerException.

      The stack trace and output is:

      DEBUG [main] - Created connection 3235124.
      DEBUG [main] -

      {conn-100000}

      Connection
      DEBUG [main] -

      {pstm-100001} PreparedStatement: { ? = call mis_extract.mgr_case_temp.FindCases }
      DEBUG [main] - {pstm-100001}

      Parameters: []
      DEBUG [main] -

      {pstm-100001}

      Types: []
      DEBUG [main] -

      {rset-100002}

      ResultSet
      DEBUG [main] - Returned connection 3235124 to pool.
      com.ibatis.common.jdbc.exception.NestedSQLException:
      — The error occurred in com/kinnect/mis/datamodel/sql/CaseToExtract.xml.
      — The error occurred while applying a parameter map.
      — Check the output.
      — Check the output parameters (retrieval of output parameters failed).
      — Cause: java.lang.NullPointerException
      Caused by: java.lang.NullPointerException
      at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:184)
      at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject(GeneralStatement.java:100)
      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:97)
      at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:69)
      at com.kinnect.mis.MISExtract.readCasesToExtract(MISExtract.java:233)
      at com.kinnect.mis.MISExtract.main(MISExtract.java:64)

      Caused by:
      java.lang.NullPointerException
      at java.lang.reflect.Method.invoke(Native Method)
      at com.ibatis.common.jdbc.logging.ResultSetLogProxy.invoke(ResultSetLogProxy.java:47)
      at $Proxy2.close(Unknown Source)
      at com.ibatis.sqlmap.engine.execution.SqlExecutor.closeResultSet(SqlExecutor.java:392)
      at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQueryProcedure(SqlExecutor.java:298)
      at com.ibatis.sqlmap.engine.mapping.statement.ProcedureStatement.sqlExecuteQuery(ProcedureStatement.java:34)
      at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:169)
      at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject(GeneralStatement.java:100)
      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:97)
      at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:69)
      at com.kinnect.mis.MISExtract.readCasesToExtract(MISExtract.java:233)
      at com.kinnect.mis.MISExtract.main(MISExtract.java:64)

      Is there a known problem with log4j with IBatis ?
      Is this a problem for RefCursors only ?

      1. StatementLogProxy_final.java
        3 kB
        Sven Boden
      2. RefCursor.zip
        11 kB
        David Winterbottom
      3. PreparedStatementLogProxy_final.java
        3 kB
        Sven Boden

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Clinton Begin
            Reporter:
            David Winterbottom
          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development