On 23 Apr 00, at 16:31, Ohad Parush wrote:

Hi Ohad,

Technically, you should not throw RemoteException from your
bean code, even indirectly.  This is deprecated in the 1.1 specs
(although support for it by the container is mandatory.)

If your code does throw a RemoteException or a subclass thereof,
it will be treated as a runtime exception by the container (even
though RemoteException is a checked exception).  This means
that a new RemoteException will be sent to the client, wrapping
your "non-application" exception.

This behavior is mandated in various places of chapter twelve of the
specification.  There is no way to throw an exception that derives
from RemoteException in your bean code, and have it reach the
client.

-Dan


> I have an EJB that in one of its remote methods, an Exception that is
> derived from RemoteException is thrown.
> This exception is not caught in the bean, so it is thrown outside of the EJB
> server boundries (to the client).
> However, when I try to catch this exception according to its type name, I am
> unsuccessul,
> and it is only caught in the "catch(RemoteException)" clause.
> The exception stack lists my derived exception as the "nested exception".
> Is there any way to actually throw an exception that derives from
> RemoteException from the EJB server, so that it will reach the client
> as that exception (and not as the base class RemoteException) ??
>
> Thx,
> Ohad.
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to