-
Bug
-
Resolution: Fixed
-
P2
-
6
This is reproducible on Windows platform from mustang b47. All swing components throw ClassCastException in their constructor in headless mode.
The exception stack trace:
Exception in thread "main" java.lang.ExceptionInInitializerError
at javax.swing.JButton.updateUI(JButton.java:113)
at javax.swing.AbstractButton.init(AbstractButton.java:2017)
at javax.swing.JButton.<init>(JButton.java:103)
at javax.swing.JButton.<init>(JButton.java:76)
at HeadlessTest.main(HeadlessTest.java:7)
Caused by: java.lang.ClassCastException: sun.awt.HeadlessToolkit cannot be cast to sun.awt.SunToolkit
at sun.awt.SunToolkit.getDesktopFontHints(SunToolkit.java:1452)
at sun.awt.windows.WDesktopProperties.setDesktopAAHints(WDesktopProperties.java:283)
at sun.awt.windows.WToolkit.initializeDesktopProperties(WToolkit.java:904)
at java.awt.Toolkit.getDesktopProperty(Toolkit.java:1657)
at java.awt.Toolkit.getDesktopProperty(Toolkit.java:1652)
at javax.swing.UIManager.<clinit>(UIManager.java:313)
The exception stack trace:
Exception in thread "main" java.lang.ExceptionInInitializerError
at javax.swing.JButton.updateUI(JButton.java:113)
at javax.swing.AbstractButton.init(AbstractButton.java:2017)
at javax.swing.JButton.<init>(JButton.java:103)
at javax.swing.JButton.<init>(JButton.java:76)
at HeadlessTest.main(HeadlessTest.java:7)
Caused by: java.lang.ClassCastException: sun.awt.HeadlessToolkit cannot be cast to sun.awt.SunToolkit
at sun.awt.SunToolkit.getDesktopFontHints(SunToolkit.java:1452)
at sun.awt.windows.WDesktopProperties.setDesktopAAHints(WDesktopProperties.java:283)
at sun.awt.windows.WToolkit.initializeDesktopProperties(WToolkit.java:904)
at java.awt.Toolkit.getDesktopProperty(Toolkit.java:1657)
at java.awt.Toolkit.getDesktopProperty(Toolkit.java:1652)
at javax.swing.UIManager.<clinit>(UIManager.java:313)
- relates to
-
JDK-6312315 500 JCK tests fail in Headless mode with java.lang.NoClassDefFoundError: Could not initialize class
-
- Closed
-