A ServerException is a just RemoteException, so anything can throw one.

This is just another reason to get rid of the lame Sun RMI 
implementation (JBoss 4.0).  In the meantime, I agree that we (you) will 
need to make patched to the unwrapping code.

-dain

David Jencks wrote:
> AFAIK the sun rmi code wraps all RemoteExceptions into ServerExceptions: it
> certainly does so for the TransactionRolledbackException.  Is there any
> chance that the jboss server code or an application would throw a
> ServerException?  If not I think this unwrapping should unwrap any
> RemoteException inside a ServerException.
> 
> This is part of the fix for bug 606942 so something needs to change in at
> least 3.2 as well as head.  If the more general fix is appropriate I'd like
> to use that.
> 
> thanks
> david jencks
> 
> On 2002.09.11 13:42:24 -0400 Dain Sundstrom wrote:
> 
>>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

Reply via email to