United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6648381 FontConfiguration exception preventing applets from loading
6648381 : FontConfiguration exception preventing applets from loading

Details
Type:
Bug
Submit Date:
2008-01-08
Status:
Closed
Updated Date:
2010-09-17
Project Name:
JDK
Resolved Date:
2008-01-31
Component:
deploy
OS:
generic,windows_xp
Sub-Component:
plugin
CPU:
x86,generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
6,6u5,6u10
Fixed Versions:
6u10

Related Reports
Backport:
Backport:
Duplicate:

Sub Tasks

Description
A recent run of the applet compatibility test suite with the new Java Plug-In turned up the following exception for many of the applets:

java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at sun.plugin2.main.client.PluginMain.createEmbeddedFrame(Unknown Source)
        at sun.plugin2.main.client.PluginMain.access$100(Unknown Source)
        at sun.plugin2.main.client.PluginMain$1.run(Unknown Source)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.ClassFormatError: Incompatible magic value 1008813135 in class file default
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at sun.awt.FontConfiguration$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.awt.FontConfiguration.getFontCharsetEncoder(Unknown Source)
        at sun.awt.FontConfiguration.buildFontDescriptors(Unknown Source)
        at sun.awt.FontConfiguration.getFontDescriptors(Unknown Source)
        at sun.awt.FontConfiguration.getFontDescriptors(Unknown Source)
        at sun.awt.PlatformFont.<init>(Unknown Source)
        at sun.awt.windows.WFontPeer.<init>(Unknown Source)
        at sun.awt.windows.WToolkit.getFontPeer(Unknown Source)
        at java.awt.Font.getPeer_NoClientCode(Unknown Source)
        at java.awt.Font.getPeer(Unknown Source)
        at sun.awt.windows.WComponentPeer._setFont(Native Method)
        at sun.awt.windows.WComponentPeer.setFont(Unknown Source)
        at sun.awt.windows.WWindowPeer.initialize(Unknown Source)
        at sun.awt.windows.WFramePeer.initialize(Unknown Source)
        at sun.awt.windows.WComponentPeer.<init>(Unknown Source)
        at sun.awt.windows.WCanvasPeer.<init>(Unknown Source)
        at sun.awt.windows.WPanelPeer.<init>(Unknown Source)
        at sun.awt.windows.WWindowPeer.<init>(Unknown Source)
        at sun.awt.windows.WFramePeer.<init>(Unknown Source)
        at sun.awt.windows.WEmbeddedFramePeer.<init>(Unknown Source)
        at sun.awt.windows.WToolkit.createEmbeddedFrame(Unknown Source)
        at sun.awt.windows.WEmbeddedFrame.addNotify(Unknown Source)
        at sun.awt.windows.WEmbeddedFrame.<init>(Unknown Source)
        at sun.plugin2.main.client.WPluginEmbeddedFrame.<init>(Unknown Source)
        ... 15 more

It is clear that the reason for this is that the sun.awt.FontConfiguration class is attempting to load a class called "default" and expecting to receive a ClassNotFoundException rather than a ClassFormatError. We don't know exactly what regional settings are causing this failure so we can not reproduce it in house. However the change to the code to avoid this exception is very small and straightforward.

                                    

Comments
SUGGESTED FIX

http://sa.sfbay.sun.com/projects/deployment_data/6u10/6648381.0
                                     
2008-01-09
EVALUATION

The first run of the applet compatibility test suite against the new
Java Plug-In contained several failures caused by the AWT Font code
trying to fetch an invalid class ("default.class") from the codebase
on the web server. This is a general problem that has been seen before
in other contexts, but this one is more severe because it prevents the
applet from running altogether. It isn't yet fully understood what
locale settings (if that) on the machine need to be set to provoke the
failure, but the workaround is clear. We will attempt to get
information to produce a regression test for this bug after it is
integrated.
                                     
2008-01-09



Hardware and Software, Engineered to Work Together