> My last mail seems not to show up in the list, so I'll try it again...
Strange, my answer didn't show up either, so I'll try again.. maybe you
couldn't solve the problem yet.
On Tue, 19 Dec 2000, Alexander Sparkowsky wrote:
> I've a little trouble using my own exceptions in beans.
>
> Let's say I have a businessmethod in MySomethingBean:
> public void doSomething() throws MyException {...}
>
> I also define the throws clause in the remoteinterface "MySomething".
>
> When I throw MyException in the businessmethod I won't get a "MyException"
> in the calling method. Insteat I get a RemoteException containing only the
> message of MyException. The detail-field of the RemoteException contains
> null.
Hi,
Make sure that MyException isn't a subclass of RemoteException or
RuntimeException, since these are used to signal system exceptions. (Note, that
EJBException is also a subclass of RuntimeException, so don't use it as a
superclass). There is also another issue: If you throw an application
exception (such as MyException), the operation won't rollback automatically,
so you have to handle this properly.
> Thanks,
> Alex
Bye.
Robert.