Community
Participate
Working Groups
When a java.awt.Component is instantiated from within a bundle, and no java.awt.Component has yet been instantiated in the JVM, the calling thread hangs in method sun.awt.windows.WToolkit.initializeDesktopProperties()--even if the calling thread is the AWT event dispatch thread. The initializeDesktopProperties() method delegates to a native method that is never found in this execution context. A simple workaround is to instantiate a javax.swing.JPanel before EclipseStarter.startup(), so that the main application thread initializes the WToolkit. The bundle will find the WToolkit initialized, and it will not try to call the problematic initializeDesktopProperties() method. At the very least, an exception should be thrown when an attempt is made to invoke an inaccessible native method in this context. It is very difficult to debug a hung thread within proprietary Sun binaries.
It turns out this is only a problem when equinox is started with the "-console" option. The problem does not occur when the console is inactive. It would be nice to be able to use the console in a Swing/Equinox app, but it is really not much work to implement a Swing-compatible console.
I suspect this is a flavor of bug 40066. Try setting the system property osgi.console.blockOnReady=true to work around.
Thanks, Thomas, that solves it. The console and Swing are both working with this property.
Thanks for reporting back Byron. I'm going to close this as a dup of bug 40066. *** This bug has been marked as a duplicate of bug 40066 ***