If your business logic catches an exception which the client is not expecting, wrap it and rethrow it as an EJBException.
My question is that it depends on the client is remote or local, if it is local client, yes, rethrow it as an EJBException. But if it is a remote client, I think it should be wrapped and rethrown as an RemoteException. Correct me if I am wrong [ April 18, 2004: Message edited by: Alibabra Sanjie ]
Alibabra, Your bean methods should never throw a RemoteException, even though they may declare that RemoteExceptions can be thrown. It's the container's job to throw RemoteExceptions. If you throw an EJBException (like you should), the container will wrap it into a RemoteException for you if the client is remote. To illustrate this, consider the fact that you have no way of knowing whether the client is remote or local (unless of course you only expose one of those component interfaces and can make the assuption).