Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > SQLException: Internal error?

Reply
Thread Tools

SQLException: Internal error?

 
 
laredotornado
Guest
Posts: n/a
 
      12-29-2008
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[i];
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.NPSFeatureManageme ntDAO::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:20
at
oracle.jdbc.oracore.OracleTypeCOLLECTION.initCollE lemTypeName
(OracleTypeCOLLECTION.java:1074)
at oracle.jdbc.oracore.OracleTypeCOLLECTION.getAttrib uteType
(OracleTypeCOLLECTION.java:1107)
at oracle.jdbc.oracore.OracleNamedType.getFullName
(OracleNamedType.java:81)
at oracle.jdbc.oracore.OracleNamedType.getFullName
(OracleNamedType.java:6
at oracle.sql.TypeDescriptor.initSQLName(TypeDescript or.java:
237)
at oracle.sql.TypeDescriptor.getName(TypeDescriptor.j ava:19
at oracle.sql.StructDescriptor.getClass(StructDescrip tor.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.unpickle8 1ImgBodyElements
(OracleTypeCOLLECTION.java:1011)
at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle8 1ImgBody
(OracleTypeCOLLECTION.java:952)
at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle8 1
(OracleTypeCOLLECTION.java:764)
at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlineari zeInternal
(OracleTypeCOLLECTION.java:243)
at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlineari ze
(OracleTypeCOLLECTION.java:217)
at oracle.sql.ArrayDescriptor.toJavaArray(ArrayDescri ptor.java:
891)
at oracle.sql.ARRAY.getArray(ARRAY.java:315)
at
com.myco.nps.config.feature.dao.NPSFeatureManageme ntDAO.getFeatures
(NPSFeatureManagementDAO.java:549)
at
com.myco.nps.config.common.delegate.NPSConfigDeleg ate.getFeatures
(NPSConfigDelegate.java:280)
at
com.myco.nps.config.ejb.service.NPSConfigServiceEJ B.getFeatures
(NPSConfigServiceEJB.java:495)
at
com.myco.nps.config.ejb.service.NPSConfigServiceEJ B_8huew0_EOImpl.getFeatures
(NPSConfigServiceEJB_8huew0_EOImpl.java:1437)
at
com.myco.nps.config.ejb.service.NPSConfigServiceEJ B_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.AuthenticatedSubjec t.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:5
at weblogic.rmi.internal.BasicServerRef$BasicExecuteR equest.run
(BasicServerRef.java:975)
at weblogic.work.ExecuteThread.execute(ExecuteThread. java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java :181)
 
Reply With Quote
 
 
 
 
John B. Matthews
Guest
Posts: n/a
 
      12-29-2008
In article
<(E-Mail Removed)>,
laredotornado <(E-Mail Removed)> 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/
 
Reply With Quote
 
 
 
 
Lew
Guest
Posts: n/a
 
      12-29-2008
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
 
Reply With Quote
 
John B. Matthews
Guest
Posts: n/a
 
      12-29-2008
In article
<(E-Mail Removed)>,
Lew <(E-Mail Removed)> 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/
 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      12-29-2008
Lew <(E-Mail Removed)> 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
 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      12-29-2008
Lew <(E-Mail Removed)> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
837. Unable to see internal web server from internal server. eric the brave Cisco 0 03-05-2006 01:52 PM
Cisco PIX 501 - Port forwarded to an internal host via Static NAT doesn't work from internal host JoelSeph Cisco 9 01-23-2006 03:52 PM
Internal Client Accessing Internal Server Via Public IP Address GeekMarine1972 Cisco 1 01-15-2005 02:49 AM
Redirect Internal IP to Different Internal IP on Same Subnet & Interface EG Cisco 5 12-30-2004 02:10 AM
internal to internal NAT? Mike Cisco 1 04-21-2004 12:15 PM



Advertisments