JDK-6312315 : 500 JCK tests fail in Headless mode with java.lang.NoClassDefFoundError: Could not initialize class
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: windows_2003
  • CPU: generic
  • Submitted: 2005-08-17
  • Updated: 2012-03-23
  • Resolved: 2005-08-31
Related Reports
Relates :  
Relates :  
Relates :  
Description
~500 JCK tests fail if running in headless mode on windows 2003 with the message like:
------- 8< ----------------------------------------
java.lang.NoClassDefFoundError: Could not initialize class javax.swing.UIManager
    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 javasoft.sqe.tests.api.javax.swing.BorderFactory.createXXXBorderTests.BorderFactory2003(createXXXBorderTests.java:97)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at javasoft.sqe.javatest.lib.MultiTest.invokeTestCase(MultiTest.java:399)
    at javasoft.sqe.javatest.lib.MultiTest.run(MultiTest.java:195)
    at com.sun.jck.lib.ExecJCKTestSameJVMCmd$Version2Test.execute(ExecJCKTestSameJVMCmd.java:389)
    at com.sun.jck.lib.ExecJCKTestSameJVMCmd$StandardTest.run(ExecJCKTestSameJVMCmd.java:334)
    at com.sun.jck.lib.ExecJCKTestSameJVMCmd.execute(ExecJCKTestSameJVMCmd.java:211)
    at com.sun.jck.lib.ExecJCKTestSameJVMCmd.run(ExecJCKTestSameJVMCmd.java:140)
    at com.sun.javatest.agent.Agent$Task.executeCommand(Agent.java:818)
    at com.sun.javatest.agent.Agent$Task.execute(Agent.java:749)
    at com.sun.javatest.agent.Agent$Task.handleRequest(Agent.java:610)
    at com.sun.javatest.agent.Agent.handleRequestsUntilClosed(Agent.java:377)
    at com.sun.javatest.agent.Agent.access$000(Agent.java:41)
    at com.sun.javatest.agent.Agent$1.run(Agent.java:253)
    at java.lang.Thread.run(Thread.java:608) 
------- 8< ----------------------------------------

Configuration we use:
jck: JCK 6.0 b06 qac
jdk: jdk 6.0 b47
test configuration: JCK-runtime singleJVM headless 32bit server Xmixed mode
platform: Windows 2003 Server/WindowsXP 

Test execution result could be found at:
http://sqeel/java/jck/qa-results/jck/60/beta/b06/results/qac/r001api/windows-i586-050816135022/execdata/jtwork/report/filtered/newFailedTests.html

Some failing tests are listed below:
-----------------------------------
api/java_awt/BorderLayout/index.html#GetLayoutComponentByConstraints[getLayoutComponentByConstraints2001]
    api/java_awt/BorderLayout/index.html#GetLayoutComponentByConstraints[getLayoutComponentByConstraints2002]
    api/java_awt/Toolkit/index.html#Listener[Toolkit0010]
    api/java_beans/DefaultPersistenceDelegate/index.html#Methods[DefaultPersistenceDelegate2005]
    api/javax_accessibility/AccessibleRelation/index.html#Ctor[AccessibleRelation0002]
    api/javax_accessibility/AccessibleRelation/index.html#Ctor[AccessibleRelation0003]
    api/javax_accessibility/AccessibleRelation/index.html#target[AccessibleRelation0004]
    api/javax_accessibility/AccessibleRelation/index.html#target[AccessibleRelation0005]
    api/javax_management/foundation/Descriptor/index.html#GetFieldValuesTest02[doGetFieldValuesTest]
    api/javax_management/modelMBeans/ModelMBeans.html#ModelMBeanDescriptorTest0005[checkgetFieldValues]
    api/javax_swing/AbstractButton/AccessibleAbstractButton/index.html#AccessibleAction[AccessibleAbstractButton0012] 
    api/javax_swing/ComponentInputMap/index.html#ctor[ComponentInputMap0002]
    api/javax_swing/ComponentInputMap/index.html#other[ComponentInputMap0003] 
    api/javax_swing/JButton/index.html#updateUI[JButton2006]
    api/javax_swing/JCheckBoxMenuItem/AccessibleJCheckBoxMenuItem/index.html#AccessibleContext[AccessibleJCheckBoxMenuItem0001]
    api/javax_swing/JCheckBoxMenuItem/AccessibleJCheckBoxMenuItem/index.html#Ctor[AccessibleJCheckBoxMenuItem2001]
    api/javax_swing/JCheckBoxMenuItem/descriptions.html#Ctor[JCheckBoxMenuItem2001] 
    api/javax_swing/colorchooser/ColorChooserComponentFactory/index.html#get[ColorChooserComponentFactory2002]
    api/javax_swing/event/ChangeEvent/descriptions.html#Ctor[ChangeEvent3001]

Comments
EVALUATION There is one more exception in addition to the previous ones: in javax.swing.UIManager. A separate CR is filed about this issue: 6318663.
01-09-2005

EVALUATION I have run the tests with b24, b46-48 and b49. Results are: all passed with b24, failed with different exceptions (see below) with b46, b47 and b48, all passed again with b49. I have noticed at least two kind of exceptions that cause the tests to fail. First is ClassCastException, when an instance of HeadlessToolkit is casted to SunToolkit in Swing code. This is duplicate of 6189824 which has been fixed recently. Second is UnsatisfiedLinkError, which is duplicate of 6282388 and it has been fixed also. As I remember, both fixes are in b49, so it is the first build when all the tests pass.
31-08-2005

EVALUATION Took a JDK 6.0-b46 with JVM 6.0-b48, ran test on jctjck14.sfbay, PASSED.. NOT Hotspot/runtime issue. Took a JDK 6.0-b48 with a JVM 6.0-b46.. Test failed as described. Bug submitter states JDK 6.0-b46 is the last known build to pass this test. Re-assigning this bug to libraries team.
22-08-2005

EVALUATION Unable to reproduce this.. I've tried on winxp machine.. Issue never occured with JCK 6.0-b05 & JDK 6.0-b47 .. Will be closing or re-assigning to test team for further review.. Eval stated this could have been caused by a network issue...
22-08-2005

EVALUATION This appears to be a build or network problem. Please try grabbing the build again and re-testing. If it re-occurs, I recommend re-assigning this to runtime as it has nothing to do with Swing. The class that it's complaining about is a valid class and should be present in the build.
17-08-2005