0

I executing a java application and I see some exception but not call stack. Can I somehow see callstack as well? It would let me better understand what is the problem.

0

3 Answers 3

2

printStackTrace() or getStackTrace()?

1
  • can I do something similar without modifying code? It's not my jar file. Sep 4, 2011 at 17:30
1

You can call an Exception object's printStackTrace() method.

More information here.

0
try{
//code
}catch(Exception ex){
ex.printStackTrace();
}

You might consider using a logger instead

try{
//code
}catch(Exception ex){
LOG.warn("whatever went wrong", ex);
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.