users@glassfish.java.net

Re: How do you display the full Java Stacktrace?

From: Tom Mueller <tom.mueller_at_oracle.com>
Date: Thu, 20 Oct 2011 09:05:51 -0500

If I'm understanding the Throwable.printStackTrace code correctly, the
"... 52 more" message is not actually suppressing any information.
Rather, it is not printing information that has already been printed,
i.e., the frames in common with the enclosing trace.

So if you have, for example, the following call structure:

a1 calls a2 calls a3 calls a4 which calls b,
   which calls c,
   which calls d,
   which calls e,
   which throws exception1,
   and c catches exception 1 and throws exception 2 with exception 1 as
the cause
   and b catches exception 2 prints a stack trace.

The stack trace will be:

Exception 2 message
   b
   a4
   a3
   a2
   a1
root cause exception 1 message
   e
   d
   c
   ... 5 more

Here the "... 5 more" represents the b, a4, a3, a2, a1 that has already
been printed above.

For details of the Throwable code, see:
http://www.docjar.com/html/api/java/lang/Throwable.java.html
Look at the printEnclosedStackTrace method.

Tom