SQLException: Internal error?

Discussion in 'Java' started by laredotornado, Dec 29, 2008.

  1. Hi, I'm using WebLogic 9.2.2, running on Solaris 9 with Java 1.5. I
    am getting the below exception (SQLException: Internal error) on this
    line of code:

    Object[] billSetValues = (Object[]) billSetArrayFromOut.getArray
    (); // line 549

    and I'm not sure what it means or how to resolve it. I have included
    additional code around the above below too. Any ideas what my next
    troubleshooting steps should be?

    Thanks, - Dave

    =========Surrounding code=================
    NPSFeatureSQLData featSQL =
    (NPSFeatureSQLData) featSQLs;
    if (featSQL != null)
    {
    FeatureDef featureObj
    = new FeatureDef();
    featureObj.setAction
    (featSQL.action);
    featureObj.setApp_name
    (featSQL.app_name);

    featureObj.setFeature_name(featSQL.feature_name);

    featureObj.setFeature_desc(featSQL.feature_desc);

    featureObj.setUpdated_feature_name(featSQL.updated_feature_name);

    featureObj.setLast_updated_by(featSQL.last_updated_by);

    oracle.sql.ARRAY
    billSetArrayFromOut = featSQL.billSets;
    Object[] billSetValues
    = (Object[]) billSetArrayFromOut
    .getArray
    ();
    =======End Surrounding code ================


    ERROR 2008-12-29 15:51:14,071 -
    [com.myco.nps.config.feature.dao.NPSFeatureManagementDAO::getFeatures]
    - SQL Exception
    java.sql.SQLException: Internal Error
    at oracle.jdbc.driver.DatabaseError.throwSqlException
    (DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException
    (DatabaseError.java:146)
    at oracle.jdbc.driver.DatabaseError.throwSqlException
    (DatabaseError.java:208)
    at
    oracle.jdbc.oracore.OracleTypeCOLLECTION.initCollElemTypeName
    (OracleTypeCOLLECTION.java:1074)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.getAttributeType
    (OracleTypeCOLLECTION.java:1107)
    at oracle.jdbc.oracore.OracleNamedType.getFullName
    (OracleNamedType.java:81)
    at oracle.jdbc.oracore.OracleNamedType.getFullName
    (OracleNamedType.java:68)
    at oracle.sql.TypeDescriptor.initSQLName(TypeDescriptor.java:
    237)
    at oracle.sql.TypeDescriptor.getName(TypeDescriptor.java:198)
    at oracle.sql.StructDescriptor.getClass(StructDescriptor.java:
    1105)
    at oracle.sql.STRUCT.toJdbc(STRUCT.java:574)
    at oracle.jdbc.oracore.OracleTypeUPT.unpickle81UPT
    (OracleTypeUPT.java:502)
    at oracle.jdbc.oracore.OracleTypeUPT.unpickle81rec
    (OracleTypeUPT.java:456)
    at
    oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81ImgBodyElements
    (OracleTypeCOLLECTION.java:1011)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81ImgBody
    (OracleTypeCOLLECTION.java:952)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81
    (OracleTypeCOLLECTION.java:764)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlinearizeInternal
    (OracleTypeCOLLECTION.java:243)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlinearize
    (OracleTypeCOLLECTION.java:217)
    at oracle.sql.ArrayDescriptor.toJavaArray(ArrayDescriptor.java:
    891)
    at oracle.sql.ARRAY.getArray(ARRAY.java:315)
    at
    com.myco.nps.config.feature.dao.NPSFeatureManagementDAO.getFeatures
    (NPSFeatureManagementDAO.java:549)
    at
    com.myco.nps.config.common.delegate.NPSConfigDelegate.getFeatures
    (NPSConfigDelegate.java:280)
    at
    com.myco.nps.config.ejb.service.NPSConfigServiceEJB.getFeatures
    (NPSConfigServiceEJB.java:495)
    at
    com.myco.nps.config.ejb.service.NPSConfigServiceEJB_8huew0_EOImpl.getFeatures
    (NPSConfigServiceEJB_8huew0_EOImpl.java:1437)
    at
    com.myco.nps.config.ejb.service.NPSConfigServiceEJB_8huew0_EOImpl_WLSkel.invoke
    (Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke
    (BasicServerRef.java:550)
    at weblogic.rmi.cluster.ClusterableServerRef.invoke
    (ClusterableServerRef.java:224)
    at weblogic.rmi.internal.BasicServerRef$1.run
    (BasicServerRef.java:440)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs
    (AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs
    (SecurityManager.java:147)
    at weblogic.rmi.internal.BasicServerRef.handleRequest
    (BasicServerRef.java:436)
    at weblogic.rmi.internal.BasicServerRef.access$300
    (BasicServerRef.java:58)
    at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run
    (BasicServerRef.java:975)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    laredotornado, Dec 29, 2008
    #1
    1. Advertising

  2. In article
    <>,
    laredotornado <> wrote:

    > Hi, I'm using WebLogic 9.2.2, running on Solaris 9 with Java 1.5. I
    > am getting the below exception (SQLException: Internal error) on this
    > line of code:
    >
    > Object[] billSetValues = (Object[]) billSetArrayFromOut.getArray ();
    >
    > and I'm not sure what it means or how to resolve it. I have included
    > additional code around the above below too. Any ideas what my next
    > troubleshooting steps should be?


    Dave: If you're not already doing so, check getNextException():

    catch (SQLException e) {
    while (e != null) {
    System.out.println ("Message: " + e.getMessage() + "");
    System.out.println ("SQLState: " + e.getSQLState () + "");
    System.out.println ("ErrorCode: " + e.getErrorCode() + "");
    e = e.getNextException();
    System.out.println();
    }
    }

    <http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html>

    [Please watch line wraps.]
    --
    John B. Matthews
    trashgod at gmail dot com
    http://home.roadrunner.com/~jbmatthews/
    John B. Matthews, Dec 29, 2008
    #2
    1. Advertising

  3. laredotornado

    Lew Guest

    John B. Matthews wrote:
    > Dave: If you're not already doing so, check getNextException():
    >
    >   catch (SQLException e) {
    >     while (e != null) {
    >       System.out.println ("Message:   " + e.getMessage() + "");
    >       System.out.println ("SQLState:  " + e.getSQLState () + "");
    >       System.out.println ("ErrorCode: " + e.getErrorCode() + "");
    >       e = e.getNextException();
    >       System.out.println();
    >     }
    >   }
    >
    > <http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html>


    I was fascinated to discover (by reading the Javadocs, always useful
    to do) that SQLException sports a new convenience method for this:

    <http://java.sun.com/javase/6/docs/api/java/sql/
    SQLException.html#iterator()>

    and that SQLException implements Iterable<Throwable>.

    This allows a semi-idiomatic:

    catch ( SQLException exc )
    {
    for ( Throwable t : exc )
    {
    SQLException sqle = (SQLException) t;
    logger.error( "Message: " + sqle.getMessage() );
    logger.error( "SQLState: " + sqle.getSQLState() );
    logger.error( "ErrorCode: " + sqle.getErrorCode() );
    }
    }

    The docs are mute as to whether the first iterated Throwable is 'exc'
    itself or not.

    I find it useless to ask why SQLException didn't implement
    Iterable<SQLException>.

    --
    Lew
    Lew, Dec 29, 2008
    #3
  4. In article
    <>,
    Lew <> wrote:

    > John B. Matthews wrote:
    > > Dave: If you're not already doing so, check getNextException():
    > >
    > >   catch (SQLException e) {
    > >     while (e != null) {
    > >       System.out.println ("Message:   " + e.getMessage() + "");
    > >       System.out.println ("SQLState:  " + e.getSQLState () + "");
    > >       System.out.println ("ErrorCode: " + e.getErrorCode() + "");
    > >       e = e.getNextException();
    > >       System.out.println();
    > >     }
    > >   }
    > >
    > > <http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html>

    >
    > I was fascinated to discover (by reading the Javadocs, always useful
    > to do) that SQLException sports a new convenience method for this:
    >
    > <http://java.sun.com/javase/6/docs/api/java/sql/
    > SQLException.html#iterator()>
    >
    > and that SQLException implements Iterable<Throwable>.


    Excellent! I had overlooked this.

    > This allows a semi-idiomatic:
    >
    > catch ( SQLException exc )
    > {
    > for ( Throwable t : exc )
    > {
    > SQLException sqle = (SQLException) t;
    > logger.error( "Message: " + sqle.getMessage() );
    > logger.error( "SQLState: " + sqle.getSQLState() );
    > logger.error( "ErrorCode: " + sqle.getErrorCode() );
    > }
    > }


    Very appealing. I should have at least said, 'System.err.println()'; a
    logger is the better choice. I see NetBeans now generates logging code
    by default, when asked to fill in an exception handler.

    > The docs are mute as to whether the first iterated Throwable is 'exc'
    > itself or not.
    >
    > I find it useless to ask why SQLException didn't implement
    > Iterable<SQLException>.


    Might I impose on you to elaborate? Does Iterable<Throwable> allow a
    broader range of exceptions to be included?

    --
    John B. Matthews
    trashgod at gmail dot com
    http://home.roadrunner.com/~jbmatthews/
    John B. Matthews, Dec 29, 2008
    #4
  5. laredotornado

    Lew Guest

    Lew <> wrote:
    >> The docs are mute as to whether the first iterated Throwable is 'exc'
    >> itself or not.

    >
    >> I find it useless to ask why SQLException didn't implement
    >> Iterable<SQLException>.


    John B. Matthews wrote:
    > Might I impose on you to elaborate? Does Iterable<Throwable> allow a
    > broader range of exceptions to be included?


    Apparently not, as the Javadocs tell us that the iterator
    > Returns: the next SQLException object in the chain; null if there are none


    So while it's declared to return a Throwable, the docs tell us that it
    always returns a SQLException. I feel that this is a mistake, but I
    see no point in asking why they did it this way instead of
    implementing Iterable<SQLException>.

    --
    Lew
    Lew, Dec 29, 2008
    #5
  6. laredotornado

    Lew Guest

    Lew <> wrote:
    >>> The docs are mute as to whether the first iterated Throwable is 'exc'
    >>> itself or not.

    >
    >>> I find it useless to ask why SQLException didn't implement
    >>> Iterable<SQLException>.


    John B. Matthews wrote:
    >> Might I impose on you to elaborate? Does Iterable<Throwable> allow a
    >> broader range of exceptions to be included?


    Lew wrote:
    > Apparently not, as the Javadocs tell us that the iterator
    >
    >> Returns:  the next SQLException object in the chain; null if there are none


    I quoted the wrong method, 'getNextException()'. The right
    description for 'iterator()' is:
    > Returns: an iterator over the chained SQLExceptions and causes in the proper order


    The key phrase might be "and causes". The question is whether the
    iterator recapitulates the functionality of 'getNextException()' or a
    combination of that method and 'getCause()'. If the latter, that
    explains why the iterator is over 'Throwable'. This leaves open the
    question of what 'the proper order' is, a point on which the docs are
    mute.

    An SSCCE will reveal all.

    --
    Lew
    Lew, Dec 29, 2008
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sven Schimmel
    Replies:
    1
    Views:
    497
  2. =?Utf-8?B?S2FseWFu?=
    Replies:
    2
    Views:
    1,407
    =?Utf-8?B?S2FseWFu?=
    Jun 18, 2004
  3. Kal
    Replies:
    1
    Views:
    9,519
    Kevin Spencer
    Jun 21, 2004
  4. HK
    Replies:
    1
    Views:
    2,274
    Lucas Tam
    Apr 25, 2005
  5. mahesh
    Replies:
    3
    Views:
    4,686
    cb_1987
    Apr 6, 2010
Loading...

Share This Page