Article:
  An Exception Handling Framework for J2EE Applications
Subject:   logging original stack trace
Date:   2007-02-07 12:35:23
From:   scranthdaddy
I have a rather newbie question but hopefully you can help advise.


If my existing web application logs the stack trace to the filesystem/database, how can I keep that functionality and fit that into your framework? Logging of the original exception stack trace is important to me for debugging the source problem and if I wrap everything into a BaseAppException sub class then I would not be able to see the stack trace.

Full Threads Oldest First

Showing messages 1 through 2 of 2.

  • logging original stack trace
    2007-02-07 20:55:33  Shrik [View]

    Wrapping the root exception with BaseAppException will not the stack-trace of original cause if you are working in JDK 1.4+ environment. However, for older JDK versions, there is a problem in keeping original stacktrace intact. <b/> In that case you need to modify BaseAppException for root-cause stacktrace implementation. You can take a look on NestedCheckedException implementation in Spring framework as a reference for the same.
    • logging original stack trace
      2007-02-07 20:53:14  Shrik [View]

      Oops. A typo mistake :-(. Here it reads better now :-)

      You will not lose the original stacktrace by wrapping the cause with BaseAppException in JDK 1.4+ environment.