JDK-6526970 : [OpenJDK] we should not throw UnsatisfiedLinkError when user wants MToolkit
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: OpenJDK6,7
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux,linux_ubuntu,solaris_10
  • CPU: x86,sparc
  • Submitted: 2007-02-21
  • Updated: 2011-07-28
  • Resolved: 2011-05-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8Resolved
Related Reports
Duplicate :  
Description
If jdk is built w/o MToolkit and user specifies MToolkit as default one (using AWT_TOLKIIT
env.var. or awt.toolkit java property) we throw UnsatisfiedLinkError.  E.g.
Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: /awt/yan/jdk7.fo/build/linux-i586-openjdk/lib/i386/motif21/libmawt.so
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1650)
        at java.lang.Runtime.load0(Runtime.java:770)
        at java.lang.System.load(System.java:1005)
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668)
        at java.lang.Runtime.loadLibrary0(Runtime.java:823)
        at java.lang.System.loadLibrary(System.java:1030)
        at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
        at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:30)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.awt.NativeLibLoader.loadLibraries(NativeLibLoader.java:38)
        at sun.awt.DebugHelper.<clinit>(DebugHelper.java:29)
        at java.awt.Component.<clinit>(Component.java:540)

We should not require mawt library and should fail with AWTError as with any other non-existent toolkit. E.g.:
Exception in thread "main" java.awt.AWTError: Toolkit not found: sun.awt.motif.WToolkit
        at java.awt.Toolkit$2.run(Toolkit.java:856)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:841)
        at java.awt.Window.getToolkit(Window.java:1142)
        at java.awt.Window.init(Window.java:369)
        at java.awt.Window.<init>(Window.java:407)
        at java.awt.Frame.<init>(Frame.java:402)
        at java.awt.Frame.<init>(Frame.java:367)
        at AWTTest.<init>(AWTTest.java:7)
        at AWTTest.main(AWTTest.java:41)

Comments
EVALUATION There's in fact nothing very serious in this defect. We cannot and do not provide MToolkit with OpenJDK, therefore an application never would start if MToolkit is required. It's not a linker error per se, as there's cannot be library to link: it's just a matter of alarming-looking report of the problem. As soon as we have the absense of Motif properly documented, and we have, user would have no real problem with this bug. At the same time, it's hard to fix it consistently until the actual launch. For instance, we depend on fix to 6534568.
05-04-2007