1 Reply Latest reply on Jun 5, 2009 11:24 PM by jeanluc

    Supress Exceptions Logging

    israel.bgf

      I dont know if this is a Seam question, or an EJB question or even a JBoss-AS question but..


      How can i supress the exception messages in the server console (Jboss 4.2.3) from runtimeExceptions throw by an EJB. Example:


      -- Stateless EJB


      persist(user); // Error user with same ID in the database.


      -- View
      try{
      userBO.persist(user)
      } catch (Exception e){
      FacesMessage.instance().add(Same user);
      }


      What can i do? Should the right practice is to test it in the EJB? But wouldn't it be strange to validate something that i can get simple in a try-catch? (Why bother verifying something that the database will verify to me anyway?)


      Thks


      Israel

        • 1. Re: Supress Exceptions Logging
          jeanluc

          The real underlying issue is not the suppression of logging, but what exception handling strategy you choose to adopt. Do some reading on this topic (there are many discussions) as it's not really a Seam issue but a general design one.