Duplicate :
|
J2SE Version (please include all output from java -version flag): java version "1.6.0-ea" Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-ea-b46) Java HotSpot(TM) Client VM (build 1.6.0-ea-b46, mixed mode, sharing) Does this problem occur on J2SE 1.4.x or 5.0.x ? Yes / No (pick one) No Operating System Configuration Information (be specific): Microsoft Windows 2000 [Version 5.00.2195] Hardware Configuration Information (be specific): Desktop Bug Description: Regression: Uncaught Exception Handling is no longer working In 1.5 the code below would display: Unhandled Exception due to Thread[AWT-EventQueue-0,6,main] throwing java.lang.RuntimeException: Test Exception **************** start stack trace ***************** **************** end of stack trace **************** java.lang.ThreadGroup[name=main,maxpri=10] Thread[AWT-Shutdown,5,main] Thread[AWT-Windows,6,main] Thread[AWT-EventQueue-0,6,main] Thread[DestroyJavaVM,5,main] In 1.6 this is no longer working which makes it very difficult to track down Sun Bugs. Instead strange things just start going wrong everywhere. Steps to Reproduce (be specific): run the following code: import javax.swing.*; public class Test { public static void main(String[] args) { Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { public void uncaughtException(Thread t, Throwable e) { System.out.println("Unhandled Exception due to " + t + " throwing " + e); System.out.println("**************** start stack trace *****************"); e.printStackTrace(); System.out.println("**************** end of stack trace ****************"); t.getThreadGroup().list(); } }); SwingUtilities.invokeLater(new Runnable() { public void run() { throw new RuntimeException("Test Exception"); } }); } }