You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Rick McGuire (JIRA)" <ji...@apache.org> on 2006/12/04 15:35:20 UTC

[jira] Created: (OPENEJB-395) ClassCastException in ServerSecurityInterceptor.

ClassCastException in ServerSecurityInterceptor.
------------------------------------------------

                 Key: OPENEJB-395
                 URL: http://issues.apache.org/jira/browse/OPENEJB-395
             Project: OpenEJB
          Issue Type: Bug
          Components: corba
    Affects Versions: 2.2, 2.3
            Reporter: Rick McGuire
         Assigned To: Rick McGuire
            Priority: Minor
             Fix For: 2.2, 2.3


I'm seeing a ClassCastException in ServerSecurityInterceptor on the following lines of code:

        } catch (SASException e) {
            log.error("SASException", e);
            SASReplyManager.setSASReply(ri.request_id(), generateContextError(e, contextId));
            throw (RuntimeException) e.getCause();
        } catch (Exception e) {
            log.error("Exception", e);
            throw (RuntimeException) e.getCause();
        } finally {
            Thread.currentThread().setContextClassLoader(savedCL);
        }


The first catch fails because SASException is a subclass of Exception, not RuntimeException, so this will cause a CastClassException if this exception ever occurs.  The second occurs because an Exception cannot be recast into a (RuntimeException) object.  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (OPENEJB-395) ClassCastException in ServerSecurityInterceptor.

Posted by "Rick McGuire (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/OPENEJB-395?page=comments#action_12455315 ] 
            
Rick McGuire commented on OPENEJB-395:
--------------------------------------

Sorry, the analysys was not quite correct.  This code is assuming that the exception object returned from getCause() is a subclass of RuntimeException, which might not be the case. 

> ClassCastException in ServerSecurityInterceptor.
> ------------------------------------------------
>
>                 Key: OPENEJB-395
>                 URL: http://issues.apache.org/jira/browse/OPENEJB-395
>             Project: OpenEJB
>          Issue Type: Bug
>          Components: corba
>    Affects Versions: 2.2, 2.3
>            Reporter: Rick McGuire
>         Assigned To: Rick McGuire
>            Priority: Minor
>             Fix For: 2.2, 2.3
>
>
> I'm seeing a ClassCastException in ServerSecurityInterceptor on the following lines of code:
>         } catch (SASException e) {
>             log.error("SASException", e);
>             SASReplyManager.setSASReply(ri.request_id(), generateContextError(e, contextId));
>             throw (RuntimeException) e.getCause();
>         } catch (Exception e) {
>             log.error("Exception", e);
>             throw (RuntimeException) e.getCause();
>         } finally {
>             Thread.currentThread().setContextClassLoader(savedCL);
>         }
> The first catch fails because SASException is a subclass of Exception, not RuntimeException, so this will cause a CastClassException if this exception ever occurs.  The second occurs because an Exception cannot be recast into a (RuntimeException) object.  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (OPENEJB-395) ClassCastException in ServerSecurityInterceptor.

Posted by "Rick McGuire (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/OPENEJB-395?page=all ]

Rick McGuire closed OPENEJB-395.
--------------------------------

    Resolution: Fixed

Committed revision 482203 -- 2.2 branch
Committed revision 482212. -- trunk branch

> ClassCastException in ServerSecurityInterceptor.
> ------------------------------------------------
>
>                 Key: OPENEJB-395
>                 URL: http://issues.apache.org/jira/browse/OPENEJB-395
>             Project: OpenEJB
>          Issue Type: Bug
>          Components: corba
>    Affects Versions: 2.2, 2.3
>            Reporter: Rick McGuire
>         Assigned To: Rick McGuire
>            Priority: Minor
>             Fix For: 2.2, 2.3
>
>
> I'm seeing a ClassCastException in ServerSecurityInterceptor on the following lines of code:
>         } catch (SASException e) {
>             log.error("SASException", e);
>             SASReplyManager.setSASReply(ri.request_id(), generateContextError(e, contextId));
>             throw (RuntimeException) e.getCause();
>         } catch (Exception e) {
>             log.error("Exception", e);
>             throw (RuntimeException) e.getCause();
>         } finally {
>             Thread.currentThread().setContextClassLoader(savedCL);
>         }
> The first catch fails because SASException is a subclass of Exception, not RuntimeException, so this will cause a CastClassException if this exception ever occurs.  The second occurs because an Exception cannot be recast into a (RuntimeException) object.  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira