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
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.