users@glassfish.java.net

Why doesn’t Glassfish use chained exceptions?

From: <glassfish_at_javadesktop.org>
Date: Sat, 12 Jan 2008 22:45:30 PST

When a duplicate key exception occurs in my code a very useful stack trace is printed to the server log (detailing the important fact that there was a “duplicate key value”). However when I catch this exception in my code the stack trace is limited to saying “Transaction marked for rollback” and has no information as to why. Java supports chained exceptions through the getCause() method. I get the impression that exceptions with useful information are being thrown and then caught, logged to the server log and then that info is discarded and new exception is thrown (without adding the previous exception as the cause of the new exception). This is bad. Is this correct?

Also Glassfish should not log exceptions to the server log (or at the very least use some configurable logging program like log4j). If I want an exception printed out to the server log I’ll catch it and print it out myself. (Of course don’t stop logging them to the server log until all the information is added to the thrown exceptions.)
[Message sent by forum member 'dannycron' (dannycron)]

http://forums.java.net/jive/thread.jspa?messageID=253580