2 Replies Latest reply on Dec 1, 2014 10:00 PM by n-agetsuma

    Throw java.rmi.RemoteException does not rollback EJB CMT

    n-agetsuma

      Hi,

       

      EJB 3.2 spec define System exception is RemoteException or RuntimeException.

       

      ----

      EJB 3.2 Spec 9.2.2 System Exceptions

      A system exception is an exception that is a java.rmi.RemoteException (or one of its sub-classes)or a RuntimeException that is not an application exception.

      ---

       

      But, On Wildfly8.1.0 java.rmi.RempteException throw in EJB CMT context, does not transaction rollback,

      and RemoteException does not throw from EJB method. (JBoss internal catch RemoteException, not rethrow)

       

      Attach reproduce code and I've made a patch.

       

      Please cooperate if this patch correct fix.

       

      thanks.

        • 1. Re: Throw java.rmi.RemoteException does not rollback EJB CMT
          wolfc

          EJB 3.2 FR 9.1.1:

          An application exception may be defined in the throws clause of a method of an enterprise bean’s

          business interface, no-interface view, home interface, component interface, or web service endpoint, or

          of a message listener method.

           

           

          An application exception class can either be a subclass (direct or indirect) of java.lang.Excep-

          tion (i.e., a “checked exception”), or a subclass of the java.lang.RuntimeException (an

          “unchecked exception”). An application exception may not be a subclass of the java.rmi.Remote-

          Exception. The java.rmi.RemoteException and its subclasses are reserved for system

          exceptions.

          Given that text I would say the reproducer is in violation of the spec and the server should throw a deployment exception.

           

          For the time being it might be better not to patch this as it would break apps depending on that violation.

          1 of 1 people found this helpful
          • 2. Re: Re: Throw java.rmi.RemoteException does not rollback EJB CMT
            n-agetsuma

            @Carlo de Wolf Thank you for your advice !

            Given that text I would say the reproducer is in violation of the spec and the server should throw a deployment exception.

             

            I tried create patch based on advice.

            When this patch is applied, and deploy ejb localview has "throws java.rmi.RemoteException",  server throw a deployment exception at the time of deploy.

             

            Please confirm patch of attachment is right.