3 Replies Latest reply on Oct 13, 2016 7:34 AM by icemaker

    [Jboss AS 7.1.1 Final] ApplicationException inherited=true does not work

    icemaker

      Hello,

       

      In my ejb-jar.xml I have defined this:

       

               <!-- This tells that a rollback should always be done when an ejb method throws an Exception -->
              <application-exception>
                  <exception-class>java.lang.Exception</exception-class>
                  <rollback>true</rollback>
                  <inherited>true</inherited>
              </application-exception>
      

       

      A rollback is correctly done when an ejb method throws a java.lang.Exception.

       

      But if I define a new Exception that inherits from java.lang.Exception it does not work.

       

      @WebFault(name = "AuthenticationFailed")
      public class AuthenticationException extends Exception {
      
          private static final long serialVersionUID = 1L;
          
          public AuthenticationException() {
              super();
          }
          
          public AuthenticationException(String username, String password) {
              super("The account defined by [User : '" + username + "' / Password : '" + StringUtils.leftPad("", "AOFXDM".length(), '*') + "'] seems to not be valid !");
          }
      
      }
      

       

      Indeed if one of my EJB method throws an AuthenticationException, no rollback is done.

       

      Any idea? Is is a bug ?