1 Reply Latest reply on May 31, 2003 6:37 AM by Harald Gliebe

    User defined exception being hidden by rmi.ServerException

    eddlsda Newbie

      Within a Session bean I have a remote method which throws a user defined exception which is derived from EJBException. Instead of the user exception being returned to a calling client the java.rmi.ServerException is being returned. Is this the anticipated behavior to expect in JBoss? BTW, this User Exception represents a "SystemException" and inherits from EJBException so that a txn will be automatically rollbacked.

        • 1. Re: User defined exception being hidden by rmi.ServerExcepti
          Harald Gliebe Novice

          The EJB-Spec requires that a RuntimeExceptions thrown in an EJB results in a RemoteException on the client side. Since the ServerException is a subclass of RemoteException this behaviour is correct. If you make your user defined a checked application exception you'll get the original exception in the client, but must call setRollbackOnly yourself to rollback you transactions.