[ http://issues.apache.org/jira/browse/IBATIS-149?page=all ] Clinton Begin closed IBATIS-149: --------------------------------
Fix Version: 2.1.5 Resolution: Fixed Assign To: Clinton Begin Fixed as described by Sven in IBATIS-152. > Stored procedure call with out parameters throws exception (worked in 2.0.9b) > ----------------------------------------------------------------------------- > > Key: IBATIS-149 > URL: http://issues.apache.org/jira/browse/IBATIS-149 > Project: iBatis for Java > Type: Bug > Components: SQL Maps > Versions: 2.1.0 > Environment: Oracle 9iR2, Spring 1.1.5, DBCP 1.2.1 > Reporter: Nilesh Kapadia > Assignee: Clinton Begin > Fix For: 2.1.5 > > I have a stored procedure that has out parameters: > <parameterMap id="displaceSplitPosParameterMap" > class="com.mycompany.ws.common.data.DisplaceSplitPosParam"> > <parameter property="returnValue" jdbcType="INTEGER" > javaType="java.lang.Integer" mode="OUT"/> > <parameter property="positionNo" jdbcType="VARCHAR" > javaType="java.lang.String" mode="IN"/> > <parameter property="positionPrefix" jdbcType="VARCHAR" > javaType="java.lang.String" mode="OUT"/> > <parameter property="positionNum" jdbcType="INTEGER" > javaType="java.lang.Integer" mode="OUT"/> > <parameter property="positionSuffix" jdbcType="VARCHAR" > javaType="java.lang.String" mode="OUT"/> > </parameterMap> > > <procedure id="callDisplaceSplitPos" > parameterMap="displaceSplitPosParameterMap"> > {?= call DISPLACE.SPLIT_POS(?, ?, ?, ? )} > </procedure> > When I call it (in this case, a JUnit test), it throws an exception with this > stack trace: > org.springframework.jdbc.UncategorizedSQLException: (SqlMapClient operation): > encountered SQLException [ > --- The error occurred in com/mycompany/ws/dao/ibatis/map/Displace.xml. > --- The error occurred while applying a parameter map. > --- Check the Displace.displaceSplitPosParameterMap. > --- Check the output parameters (retrieval of output parameters failed). > --- Cause: java.lang.NullPointerException]; nested exception is > com.ibatis.common.jdbc.exception.NestedSQLException: > --- The error occurred in com/mycompany/ws/dao/ibatis/map/Displace.xml. > --- The error occurred while applying a parameter map. > --- Check the Displace.displaceSplitPosParameterMap. > --- Check the output parameters (retrieval of output parameters failed). > --- Cause: java.lang.NullPointerException > com.ibatis.common.jdbc.exception.NestedSQLException: > --- The error occurred in com/mycompany/ws/dao/ibatis/map/Displace.xml. > --- The error occurred while applying a parameter map. > --- Check the Displace.displaceSplitPosParameterMap. > --- 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 > org.springframework.orm.ibatis.SqlMapClientTemplate$1.doInSqlMapClient(SqlMapClientTemplate.java:207) > at > org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:165) > at > org.springframework.orm.ibatis.SqlMapClientTemplate.queryForObject(SqlMapClientTemplate.java:205) > at com.mycompany. < I cut out part of the stack trace here > > Caused by: java.lang.NullPointerException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at > com.ibatis.common.jdbc.logging.ResultSetLogProxy.invoke(ResultSetLogProxy.java:47) > at $Proxy46.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) > ... 39 more > The Java code used to call: > public DisplaceSplitPosParam callDisplaceSplitPos(String positionNo) { > DisplaceSplitPosParam param = new DisplaceSplitPosParam(); > param.setPositionNo(positionNo); > queryForObject("callDisplaceSplitPos", param); > return param; > } > > This worked flawlessly in 2.0.9b, but when switching to 2.1.0 it fails. This > is for an Oracle 9iR2 database. I am using Spring 1.1.5's iBatis support. > DBCP 1.2.1 is being used in this test. -- 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