How can I see the full JAVA exception log?

When I run some java program using the java ExceptionTest command, the exceptions are sometimes dropped and look like

Exception in thread "main" java.lang.NoClassDefFoundError: aa/bb/DD at SOMEWHERE(unknown source) Caused by: java.lang.ClassNotFoundException: aaa.bbb.CC at SOMEWHER(unknown source) ... 13 more 

In this case, I would like to see 13 more exceptions. Is it possible to see all the exception logs?

+7
source share
2 answers

You already see them, this is just the ridiculous way in which Java (and Logback by defaul) prints exceptions by default. This stack trace:

 Exception in thread "main" java.lang.NoClassDefFoundError: aa/bb/DD at SOMEWHERE(unknown source) Caused by: java.lang.ClassNotFoundException: aaa.bbb.CC at SOMEWHER(unknown source) ... 13 more 

actually means the following program stream (bottom to top):

 Caused by: java.lang.ClassNotFoundException: aaa.bbb.CC at SOMEWHER(unknown source) Exception in thread "main" java.lang.NoClassDefFoundError: aa/bb/DD at SOMEWHERE(unknown source) 

... 13 more ( N common frames omitted in Logback) means that these exceptions have already been printed before. In Logback, you can restructure the stack track to avoid duplication and always print stack lines, see my blog .

+14
source

there are no 13 more exceptions. There are 13 more lines in the call stack that are identical to the previous call tables, as described here: http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Throwable.html#printStackTrace ()

+3
source

All Articles