You should never get a ServerException that wraps a RemoteException 
unless the application code did it.  My major rewrite to the exception 
code assures this.  Actually, we should not need any of this unwrapping, 
but it looks like the Sun RMI code is broken.  When we get rid of the 
Sun RMI code in 4.0 (moving to JBoss HTTP invoker) we should be able to 
remove this unwrapping code.

-dain

David Jencks wrote:
> While fixing a bug I had to unwrap another ServerException in
> JRMPInvokerProxy.  I'm not really an expert on the exception handling here,
> but shouldn't we be unwrapping a lot more exceptions, at least any
> ServerException that wraps a RemoteException?
> 
> Here's the code:
> 
>       try { 
>          return ((MarshalledObject) remoteInvoker.invoke(mi)).get();
>       }
>       catch (ServerException ex) {
>          // Suns RMI implementation wraps NoSuchObjectException in
>          // a ServerException. We cannot have that if we want
>          // to comply with the spec, so we unwrap here.
>          if (ex.detail instanceof NoSuchObjectException)
>          {
>             throw (NoSuchObjectException) ex.detail;
>          }
>          //likewise
>          if (ex.detail instanceof TransactionRolledbackException)
>          {
>             throw (TransactionRolledbackException) ex.detail;
>          }
>          /* Shouldn't we unwrap _all_ remote exceptions with this code? 
>          if (ex.detail instanceof RemoteException)
>          {
>             throw (RemoteException) ex.detail;
>          }
>          */
>          throw ex;
>       }  
> 
> 
> Thanks
> david jencks
> 
> 
> -------------------------------------------------------
> In remembrance
> www.osdn.com/911/
> _______________________________________________
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development


-- 
xxxxxxxxxxxxxxxxxxxxxxxx
Dain Sundstrom
Chief Architect JBossCMP
JBoss Group, LLC
xxxxxxxxxxxxxxxxxxxxxxxx



-------------------------------------------------------
In remembrance
www.osdn.com/911/
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to