United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6857870 : Regression tests are failing with ExceptionInInitializerError

Details
Type:
Bug
Submit Date:
2009-07-07
Status:
Closed
Updated Date:
2012-03-22
Project Name:
JDK
Resolved Date:
2011-03-07
Component:
client-libs
OS:
windows_vista,generic,windows_xp,windows
Sub-Component:
javax.swing
CPU:
x86,generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:

Related Reports
Duplicate:
Duplicate:

Sub Tasks

Description
Bug Info
=========

The following regression tests are failing with ExceptionInInitializerError while running with jdk7-b64 pit.

closed/javax/swing/JFileChooser/6215611/bug6215611.java
closed/javax/swing/JFileChooser/6484091/bug6484091.java
closed/javax/swing/JFileChooser/5059770/bug5059770.java
javax/swing/JFileChooser/6688203/bug6688203.java
closed/javax/swing/JPopupMenu/4966112/bug4966112.java
closed/javax/swing/tree/DefaultTreeCellRenderer/6225504/bug6225504.java
javax/swing/border/Test4856008.java
closed/javax/swing/JEditorPane/5076514/bug5076514.java
closed/javax/swing/JFileChooser/4966171/bug4966171.java
closed/javax/swing/JFileChooser/5040999/bug5040999.java
closed/javax/swing/JFileChooser/4776197/bug4776197.java
closed/javax/swing/LookAndFeel/LAFExtending/LAFExtending.java
closed/javax/swing/JFileChooser/4163841/AcceptAllFileFilterTest.java
closed/javax/swing/JFileChooser/4213330/FileChooserSizeTest.java
closed/javax/swing/LookAndFeel/InstallProperty.java

All the above tests are failing in window platform and closed/javax/swing/JEditorPane/5076514/bug5076514.java test fails even on linux and solaris platforms with same exception.


JDK Info
=========
java version "1.7.0-internal"
Java(TM) SE Runtime Environment (build 1.7.0-internal-administrator_2009_07_01_0
0_43-b00)
Java HotSpot(TM) Client VM (build 16.0-b04, mixed mode)

Execption details
=================
java.lang.ExceptionInInitializerError
	at javax.swing.JComponent.repaint(JComponent.java:4780)
	at java.awt.Component.repaint(Component.java:3072)
	at javax.swing.text.JTextComponent.setEditable(JTextComponent.java:1810)
	at javax.swing.text.JTextComponent.<init>(JTextComponent.java:322)
	at javax.swing.JEditorPane.<init>(JEditorPane.java:197)
	at bug5076514.main(bug5076514.java:15)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:623)
	at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
	at java.lang.Thread.run(Thread.java:717)
Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.awt")
	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:345)
	at java.security.AccessController.checkPermission(AccessController.java:555)
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
	at java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1529)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:304)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:331)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:83)
	at javax.swing.RepaintManager.<clinit>(RepaintManager.java:201)

                                    

Comments
EVALUATION

The bug 6859935 is fixed in b66 - All Settings are in place in JCP/Advanced tab on windows.
                                     
2009-07-24
SUGGESTED FIX

http://sa.sfbay.sun.com/projects/awt_data/7/6859935/
                                     
2009-07-23
EVALUATION

The ShellFolder class contains the next code:
 String managerClassName = (String)Toolkit.getDefaultToolkit().getDesktopProperty("Shell.shellFolderManager");

At the same time WToolkit puts not a string:
 desktopProperties.put("Shell.shellFolderManager", Class.forName("sun.awt.shell.Win32ShellFolderManager2"));

As the result we catch ClassCastException in static initialization of the ShellFolder class. 

I described the reason of failure of the closed/javax/swing/JFileChooser/6215611/bug6215611.java test. I think other tests contain the same problem. I'm reassigning the bug to Dmitry because this problem was introduced by him.
                                     
2009-07-21
EVALUATION

It's a duplicate of 6859935.
                                     
2009-07-21
EVALUATION

It looks like the testing environment doesn't have permissions to access classes in sun.* packages
                                     
2009-07-08



Hardware and Software, Engineered to Work Together