Any design pattern for Excpetion handling?


EJB design: Any design pattern for Excpetion handling?

  1. Any design pattern for Excpetion handling? (7 messages)

    Is there any design pattern which deals with exception handling issues in J2EE architecture?
    On a different note... Does anybody know when is the EJB design patterns book mentioned on this website is coming out and where can I buy it from?


  2. Please look at this discussion:

  3. The book "Effective Java" by Joshua Bloch has an entire chapter on exceptions. They are grouped into 9 "Items" which are sort of best practices around the use of exceptions. It's a great book that contains other useful information for Java programmers. I don't know of any specific issues or books relating to J2EE and exceptions.
  4. I think if you are using EJBs then you must consider using Nested Exception Handling Technique.

    The article which discusses Nested Exception Handling is here -->

    Let me know what do you think.

  5. I just use a generic AppException that extends the java Exception class. Typically, in my ejb methods, I throw this along with RemoteException. Appexception can nest other exceptions and is integrated with log4j. The constructor will log the error message through log4j.

    Having a class hierarchy of exceptions may not be worth it, because handling them becomes tedious.

  6. I've a sample code of this exception pattern available at
  7. Thank you.
    Excellent links and book(Effective Java). Really helpful!!!!

    Wish had documentation for

  8. could make a brief introduction about log4j?thanks in advance