How to aquire the Stacktrace? [message #90531] |
Fri, 29 July 2005 14:43 |
Eclipse User |
|
|
|
Originally posted by: uw.geektech.de
Hello Group,
I have a (hopefully) rather simple question.
When running Java apps inside the Eclipse Environment, whenever the VM
would crash, the last Exception is written to System.err , if I cause a
NullPointerException, the App hangs and the "printStackTrace()" from the
raised Exception is written to Standard.err. This happens even (or
especially) if the Exception is NOT caught in a try / catch block.
Now I have the following question:
I have created a Shutdown-Hook Thread for my standalone Application. In
this Thread, I start a new Display and Shell and all I want to do is
simply output the reason why this Shutdown was triggered (if the shutdown
is due to an uncaught exception). How can I do this? Redirecting
System.err isn't the problem, the problem is, that when the App runs
outside of Eclipse, and the Exception is not caught, it's stacktrace is
not printed to System.err.
Is there ANY way to tell the VM to print the stacktrace to System.err,
like it is done in Eclipse?
I hope you all understand what I am trying to do, English, sadly, is not
my native language so it's not easy for me to explain exactly what I need.
Last try to put it in simple words: If I export my Application (developed
in Eclipse) into a standalone .jar-App, and run it in an outside VM, and
the Application crashed due to an uncaught exception, how can I get the
StackTrace of this Exception?
Any help is GREATLY appreciated!
best regards and thanks in advance
Ulrik
|
|
|
Powered by
FUDForum. Page generated in 0.08084 seconds