[GLASSFISH-7789] Unable to typecast to SQLException Created: 15/Apr/09  Updated: 07/Mar/12  Resolved: 07/Mar/12

Status: Closed
Project: glassfish
Component/s: cmp
Affects Version/s: v2.1.1
Fix Version/s: not determined

Type: Task Priority: Trivial
Reporter: ginix Assignee: Mitesh Meswani
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Windows XP
Platform: All


Issuezilla Id: 7,789

 Description   

Here is my code .

if (!(e instanceof EJBException))

{ return null; }

EJBException ejbException = (EJBException) e;
Exception causedByException = ejbException.getCausedByException();

if (null == causedByException) { return null; }

if (!(causedByException instanceof JDODataStoreException))

{ return null; }

JDODataStoreException jdoDataStoreException = (JDODataStoreException)
causedByException;
Throwable throwable = jdoDataStoreException.getNestedException();

if (null == throwable) { return null; }

if (!(throwable instanceof SQLException))

{ return null; }

SQLException sqlException = (SQLException) throwable;

When JDOexception happens I pass the exception through this method. The code
executes till "instanceof SQLException" but when i try to typecast the throwable
to SQLException it throws error in run time. The "throwable" and SQLException
are both of type java.sql.SQLException when i check through debugger. Please
suggest.



 Comments   
Comment by marina vatkina [ 16/Apr/09 ]

It's cmp code, but AFAIK it works correctly

Comment by Tom Mueller [ 06/Mar/12 ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.

Comment by Mitesh Meswani [ 07/Mar/12 ]

CMP code is not actively being worked on. Closing the P4 as "won't Fix"

Generated at Mon Aug 31 07:50:23 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.