For some reason, Eclipse for Java stopped showing the stacktrace on exceptions nor is Eclipse stopping on exceptions while in debug. I installed (not upgrade) the latest Eclipse 2023-03 (4.27.0) and referenced the workspace and projects in the hopes that would solve the issue, but Eclipse is still blissfully moving past exceptions.
I have a breakpoint set for Throwable (caught and uncaught), and I also have the debug option set to suspend execution on uncaught exceptions. Regardless, the exception is caught with my catch statement without suspending execution, and the printStackTrace command does nothing that I can see. There is no output to the console. The showMessageDialog statement does work and displays my failure during initialization message.
If I comment out the try/catch so that the exception is uncaught, then the program appears to terminate immediately without any messages from either me or the system.
Any thoughts on what is happening here?
Below is my tray/catch, and the exception is somewhere in the initializeEX() statement:
try {
initializeEX(); // the error is somewhere in here...
} catch(Exception e) {
e.printStackTrace();
msg = "Failure during console initialization.";
JOptionPane.showMessageDialog(frame, msg, "Cannot load AssetAllocation", JOptionPane.ERROR_MESSAGE);
}
Thanks for any input.
Since you managed to get the exception description in the dialog, you can also get the stash trace there.
Create a
ByteArrayOutputStream, then aPrintWriterfrom it. Then give that to theprintException()method.As for why the stask trace isn't printed as is, I assume the standard error stream is changed along the execution (
System.setError(someStream)).