|SWT in Java WebStart App stopped working on OSX after upgrading to Java 7 [message #957764]
||Thu, 25 October 2012 09:21
| Christian Niessner
Registered: October 2012
i'm maintaining a JavaWS application using SWT for our company for quite a while now. I have reports that it stopped to work on Apple OSX computers, so i started digging into it.
It seems Apple has dropped their own Java 1.6 implementation and Oracle's Java 7 is now installed by default. An here the misery begins...
My app started to report the known "***WARNING: Display must be created on main thread due to Cocoa restrictions. / org.eclipse.swt.SWTException: Invalid thread access" issue. Okay, it seems that -XstartOnFirstThread works for Apple's 1.6 but not for Oracle's java 7?
After digging into it i found out that Oracle's implementation didn't do a restart with -XstartOnFirstThread during javaws init. The cause was that i've dropped signing the application's jnlp file due to some issues on the Microsoft platform. Don't care, i signed it again and next try - and i got one step further:
Java is now restarted with -XstartOnFirstThread, but then everything freezes up. It seems there is a massive problem bringing up the AWT/Swing subsystem because javaws launcher is sitting on the main thread and AWT also want's the main thread because of the same cause we want it for SWT...
My next try was to add an additional -Djava.awt.headless=true parameter, and at least everything comes up into my app - but i'm dying on the "Invalid thread access" issue again. I think the javaws starter or maybe AWT is still fooling around with the threads...
BTW: i just tried it with swt-4.2.1.
Anyone out there having the same issue or idea's what else i can try?
Thanks & Bye,