ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ahmed, Arshad" <aah...@cavtel.com>
Subject iBATIS: NullPointerException when returning value from a stored procedure in MSSQL
Date Fri, 22 Feb 2008 15:46:57 GMT
Hi,
I'm using iBATIS as a persistent mechanism to write data to MSSQL. there
is a stored procedure that i'm executing and it returns an integer
value, the procedure executes fine but when i try to collect the result
back, i get the following error:

com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in VendorOrder.xml.  
--- The error occurred while applying a parameter map.  
--- Check the VendorOrder.paramVendorOrder.  
--- Check the results (failed to retrieve results).  
--- Cause: java.lang.NullPointerException
Caused by: java.lang.NullPointerException
      at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQuery
WithCallback(GeneralStatement.java:188)
      at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQuery
ForObject(GeneralStatement.java:104)
      at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlM
apExecutorDelegate.java:561)
      at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlM
apExecutorDelegate.java:536)
      at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSes
sionImpl.java:93)
      at
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClie
ntImpl.java:70)
      at
com.talk.provisioning.ebtacomservice.server.persistence.ibatis.VendorOrd
erDAO.insert(VendorOrderDAO.java:91)
      at
com.talk.provisioning.ebtacomservice.server.EBondingHelper.insertVendorO
rder(EBondingHelper.java:451)
      at
com.talk.provisioning.ebtacomservice.server.EBondingHelper.persistCreate
TicketPreBinding(EBondingHelper.java:703)
      at
com.talk.provisioning.ebtacomservice.server.EBondingWebService.CreateTic
ket(EBondingWebService.java:158)
      at
com.talk.provisioning.ebtacomservice.server.Test.main(Test.java:15)
Caused by: java.lang.NullPointerException
      at
com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor
.java:355)
      at
com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQueryProcedure(Sql
Executor.java:291)
      at
com.ibatis.sqlmap.engine.mapping.statement.ProcedureStatement.sqlExecute
Query(ProcedureStatement.java:34)
      at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQuery
WithCallback(GeneralStatement.java:173)
      ... 10 more


the following is an extract from my SQLConfig map file


  <parameterMap id="paramVendorOrder" class="vendor_order_class">
    <parameter property="workQueueIDAsLong" jdbcType="INT"
javaType="java.lang.Long" mode="IN" />
    <parameter property="orderItemIDAsLong" jdbcType="INT"
javaType="java.lang.Long" mode="IN" />
    <parameter property="vendorIDAsLong" jdbcType="INT"
javaType="java.lang.Long" mode="IN" />
    <parameter property="vendorOrderTypeIDAsLong" jdbcType="INT"
javaType="java.lang.Long" mode="IN" />
    <parameter property="vendorStatusIDAsLong" jdbcType="INT"
javaType="java.lang.Long" mode="IN" />
    <parameter property="vendorTicket" jdbcType="VARCHAR"
javaType="java.lang.String" mode="IN" />
    <parameter property="createdBy" jdbcType="VARCHAR"
javaType="java.lang.String" mode="IN" />
    <parameter property="contactName" jdbcType="VARCHAR"
javaType="java.lang.String" nullValue="" mode="IN" />
    <parameter property="contactPhone" jdbcType="VARCHAR"
javaType="java.lang.String" nullValue="" mode="IN" />
    <parameter property="updatedBy" jdbcType="VARCHAR"
javaType="java.lang.String" mode="IN" />
    <parameter property="actionCode" jdbcType="VARCHAR"
javaType="java.lang.String" mode="IN" />
    <parameter property="incidentIDAsLong" jdbcType="INT"
javaType="java.lang.Long" mode="IN" />
    <parameter property="vendorMeet" jdbcType="VARCHAR"
javaType="java.lang.String" mode="IN" />
    <parameter property="callingSystemIDAsLong" jdbcType="INT"
javaType="java.lang.Long" mode="IN" />
    <parameter property="DBSystemIDAsLong" jdbcType="INT"
javaType="java.lang.Long" mode="IN" />
    <parameter property="commitTime" jdbcType="DATETIME"
javaType="java.util.Date" mode="IN" /> 
  </parameterMap>

  <procedure id="sp_insert_ebonding_vendororder_b"
resultClass="java.lang.Long" parameterMap="paramVendorOrder">
    {call
sp_insert_ebonding_vendororder_b(?,?,?,?,?,?,?,?,?,null,null,?,null,null
,?,?,?,?,?,?)}
  </procedure>

can someone please help me?

Thanks.


Mime
View raw message