OracleCallableStatement ClassCastException Wrapped Classes - Weblogic

This is a discussion on OracleCallableStatement ClassCastException Wrapped Classes - Weblogic ; I am encountering an issue with a wrapped OracleCallableStatement within WLS. i execute the following code: OracleCallableStatement oraCallStmt = (OracleCallableStatement)cnn.prepareCall(CREATE_PC E); and receive an exception as follows: Caused by: java.lang.ClassCastException at com.dofasco.hamilton.common.dao.PceProcessResultDA O.calcNextLegacyOpCd(PceProcessResultDAO.java:84) at com.dofasco.hamilton.common.document.pceProcessRes ult.PceProcessResult.calcNextLegacyOpCd(PceProcess Result.java:117) at com.dofasco.hamilton.common.document.pceQual.PceQu al.addNextLegacyOpCd(PceQual.java:162) ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: OracleCallableStatement ClassCastException Wrapped Classes

  1. OracleCallableStatement ClassCastException Wrapped Classes

    I am encountering an issue with a wrapped OracleCallableStatement within WLS.


    i execute the following code:
    OracleCallableStatement oraCallStmt = (OracleCallableStatement)cnn.prepareCall(CREATE_PC E);

    and receive an exception as follows:

    Caused by: java.lang.ClassCastException
    at com.dofasco.hamilton.common.dao.PceProcessResultDA O.calcNextLegacyOpCd(PceProcessResultDAO.java:84)
    at com.dofasco.hamilton.common.document.pceProcessRes ult.PceProcessResult.calcNextLegacyOpCd(PceProcess Result.java:117)
    at com.dofasco.hamilton.common.document.pceQual.PceQu al.addNextLegacyOpCd(PceQual.java:162)
    at com.dofasco.hamilton.common.ejb.pceQual.PceQualSB. addNextLegacyOpCd(PceQualSB.java:111)
    at com.dofasco.hamilton.common.ejb.pceQual.PceQualSb_ qgua00_EOImpl.addNextLegacyOpCd(PceQualSb_qgua00_E OImpl.java:154)
    ... 55 more


    This only happens on the server and not on each developers instance. It seems that the wrapped class within the developer's instance is:
    weblogic.jdbc.wrapper.CallableStatement_oracle_jdb c_driver_T4CCallableStatement (this works fine)
    whereas the server has the following:
    weblogic.jdbc.wrapper.CallableStatement_weblogic_j dbcx_base_BaseCallableStatementWrapper (this fails with ClassCastException)
    I'm not sure why there is a difference between systems.
    If anyone can help it would be greatly appreciated.

    THanks

  2. Re: OracleCallableStatement ClassCastException Wrapped Classes



    Jeremy Overton wrote:

    > I am encountering an issue with a wrapped OracleCallableStatement within WLS.
    >
    >
    > i execute the following code:
    > OracleCallableStatement oraCallStmt = (OracleCallableStatement)cnn.prepareCall(CREATE_PC E);
    >
    > and receive an exception as follows:
    >
    > Caused by: java.lang.ClassCastException
    > at com.dofasco.hamilton.common.dao.PceProcessResultDA O.calcNextLegacyOpCd(PceProcessResultDAO.java:84)
    > at com.dofasco.hamilton.common.document.pceProcessRes ult.PceProcessResult.calcNextLegacyOpCd(PceProcess Result.java:117)
    > at com.dofasco.hamilton.common.document.pceQual.PceQu al.addNextLegacyOpCd(PceQual.java:162)
    > at com.dofasco.hamilton.common.ejb.pceQual.PceQualSB. addNextLegacyOpCd(PceQualSB.java:111)
    > at com.dofasco.hamilton.common.ejb.pceQual.PceQualSb_ qgua00_EOImpl.addNextLegacyOpCd(PceQualSb_qgua00_E OImpl.java:154)
    > ... 55 more
    >
    >
    > This only happens on the server and not on each developers instance. It seems that the wrapped class within the developer's instance is:
    > weblogic.jdbc.wrapper.CallableStatement_oracle_jdb c_driver_T4CCallableStatement (this works fine)
    > whereas the server has the following:
    > weblogic.jdbc.wrapper.CallableStatement_weblogic_j dbcx_base_BaseCallableStatementWrapper (this fails with ClassCastException)
    > I'm not sure why there is a difference between systems.
    > If anyone can help it would be greatly appreciated.


    Hi. It seems that the pool on the developer instance is defined with the oracle thin
    driver, but the server's weblogic instance has a pool made using BEA's oracle driver.
    Joe
    >
    > THanks



  3. Re: OracleCallableStatement ClassCastException Wrapped Classes

    I am also encountering an issue with the OracleCallableStatement in WLS 8.1.

    My java code is given below:

    ResultSet rset = null;
    StringBuffer query = new StringBuffer();
    query.append("{call get_covp_data(?,?,?,?,?,?)}");
    cs = dbGrps.getCallableStmt(query.toString());

    cs.setString(1, tn);
    cs.setString(2, region);
    cs.setInt(3, days);
    cs.registerOutParameter(4, OracleTypes.CURSOR);
    cs.registerOutParameter(5, java.sql.Types.VARCHAR);
    cs.registerOutParameter(6, java.sql.Types.VARCHAR);

    cs.execute();
    1: rset = ((OracleCallableStatement)cs).getCursor(4);
    while (rset.next())
    {
    System.out.println("in side the while block.");
    }


    The sentence #1 throws the ClassCastException.
    This exception is only raised when this code is deployed in Weblogic 8.1 server where as this code block works fine if executed in a standalone java application.

    Is there any issue with the Weblogic 8.1 server ?



    But, when I replaced the line # 1 (i.e. rset = ((OracleCallableStatement)cs).getCursor(4); ) with this following line, it also throws a different exception which is mentioned below.

    rset = (ResultSet)cs.getObject(4);

    Exception thrown is:

    java.sql.SQLException: Cursor is closed.
    at oracle.jdbc.driver.T4CResultSetAccessor.getCursor( T4CResultSetAccessor.java:323)
    at oracle.jdbc.driver.ResultSetAccessor.getObject(Res ultSetAccessor.java:85)
    at oracle.jdbc.driver.OracleCallableStatement.getObje ct(OracleCallableStatement.java:1527)
    at weblogic.jdbc.wrapper.CallableStatement_oracle_jdb c_driver_T4CCallableStatement.getObject(Unknown Source)
    at com.vericheck.dslwf.db.util.WsVchkUtil.getVchkOrde rDetails(WsVchkUtil.java:635)


    Is this also an issue with the Weblogic 8.1 server?

    Any help would be greatly appreciated.

    Thanks a lot in advance.

+ Reply to Thread