3 Replies Latest reply on Nov 13, 2013 8:36 AM by jharting

    Public method not intercepted and return value not "bean validated"

    juergen.zimmermann

      I'm having the following CDI-enabled bean. However, when createCustomer() invokes findCustomerByEmail, then the Log interceptor is not invoked and also the ConstraintViolationException is not thrown (when using an email so that null is returned by findCustomerByEmail). Any hint is appreciated!

       

      @Dependent

      @Log

      public class CustomerService implements Serializable {

         @NotNull

         public Customer findCustomerByEmail(String email) {

            if (...)

               return null;

            ...

            return ...;

         }


         public void createCustomer(Customer c) {

            Customer tmp = findCustomerByEmail(c.getEmail());  // ConstraintViolationException is not thrown,

                                                               // Log interceptor for findCustomerByEmail is not invoked

            ...

         }

      }