SQLException: Internal error?

L

laredotornado

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)
 
J

John B. Matthews

laredotornado said:
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.]
 
L

Lew

John said:
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>.
 
J

John B. Matthews

Lew said:
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?
 
L

Lew

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>.
 
L

Lew

Apparently not, as the Javadocs tell us that the iterator

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top