Asked By
deepa
110 points
N/A
Posted on - 04/20/2011
Hi, sometimes when I run my Java code, I get some exceptions but no stacktrace. I have encountered these even in debug mode. Does anyone know what I might be doing wrong?
Answered By
Ricky
0 points
N/A
#86136
Missing Stackrace in Exception on Java
Deepa,
If you are using log4j and printing the error as log.error(exception), this will not print the stack trace. Instead use log.error(“some message”, exception).
Answered By
deepa
110 points
N/A
#86137
Missing Stackrace in Exception on Java
Ricky,
Thanks for the response. I am using log.error (“some message”, exception) but I still don’t see the stacktrace. What do I do next?
Answered By
Ricky
0 points
N/A
#86138
Missing Stackrace in Exception on Java
Deepa, please use the following JVM option:
-XX:-OmitStackTraceInFastThrow
This should help.
Answered By
deepa
110 points
N/A
#86139
Missing Stackrace in Exception on Java
Thanks Ajay. This did the trick.