JDK-8067274 : RCP/SWT application exited with an SWTException illegal thread access
  • Type: Bug
  • Component: deploy
  • Sub-Component: webstart
  • Affected Version: 7u67
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: other
  • CPU: x86
  • Submitted: 2014-09-13
  • Updated: 2014-12-11
  • Resolved: 2014-09-15
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :


ADDITIONAL OS VERSION INFORMATION :
Darwin XXXX 13.3.0 Darwin Kernel Version 13.3.0: Tue Jun  3 21:27:35 PDT 2014; root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64

A DESCRIPTION OF THE PROBLEM :
I've installed the latest oracle JRE on my macbook but I can't get our rcp/swt application to start over jnlp.

The app start crashes with
!ENTRY org.eclipse.osgi 4 0 2014-09-13 19:35:07.912
!MESSAGE Application error
!STACK 1
org.eclipse.swt.SWTException: Invalid thread access
        at org.eclipse.swt.SWT.error(SWT.java:4361)
        at org.eclipse.swt.SWT.error(SWT.java:4276)
        at org.eclipse.swt.SWT.error(SWT.java:4247)
        at org.eclipse.swt.widgets.Display.error(Display.java:1070)
        at org.eclipse.swt.widgets.Display.createDisplay(Display.java:827)
        at org.eclipse.swt.widgets.Display.create(Display.java:810)
        at org.eclipse.swt.graphics.Device.<init>(Device.java:130)
        at org.eclipse.swt.widgets.Display.<init>(Display.java:701)
        at org.eclipse.swt.widgets.Display.<init>(Display.java:692)
        at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:716)
        at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:161)
        ...

I've found a load of threads with this problem - all with the same solution: add -XstartOnFirstThread to the java-vm-args

According to the jnlp syntax (http://docs.oracle.com/javase/7/docs/technotes/guides/javaws/developersguide/syntax.html) this argument seems to be "insecure" and I think therefore the app crashes because the argument is not passed to the vm.

So I've tried to run the jnlp with latest jre from apple and the app started as expected.
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Commands/java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

So I think this is a problem of the jre maybe only because -XstartOnFirstThread is not declared as a secure argument.




ADDITIONAL REGRESSION INFORMATION: 
apples jre
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)


ERROR MESSAGES/STACK TRACES THAT OCCUR :
!ENTRY org.eclipse.osgi 4 0 2014-09-13 19:35:07.912
!MESSAGE Application error
!STACK 1
org.eclipse.swt.SWTException: Invalid thread access
        at org.eclipse.swt.SWT.error(SWT.java:4361)
        at org.eclipse.swt.SWT.error(SWT.java:4276)
        at org.eclipse.swt.SWT.error(SWT.java:4247)
        at org.eclipse.swt.widgets.Display.error(Display.java:1070)
        at org.eclipse.swt.widgets.Display.createDisplay(Display.java:827)
        at org.eclipse.swt.widgets.Display.create(Display.java:810)
        at org.eclipse.swt.graphics.Device.<init>(Device.java:130)
        at org.eclipse.swt.widgets.Display.<init>(Display.java:701)
        at org.eclipse.swt.widgets.Display.<init>(Display.java:692)
        at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:716)
        at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:161)
        ...

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
Start with apples jre
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Commands/javaws