JDK-8157060 : [Linux] sandboxed applications fail with AccessControlException
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: 9
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-05-16
  • Updated: 2016-05-16
  • Resolved: 2016-05-16
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 9
9Fixed
Related Reports
Relates :  
Description
Following the fix for JDK-8137050 we now get an AccessControlException when running any FX program that does not extend javafx.application.Application (e.g., a JFXPanel app or an application with a custom launcher) with a security manager. For example:

$ java -Djava.security.manager HelloJFXPanel
Exception in thread "AWT-EventQueue-0" java.security.AccessControlException: access denied ("java.util.PropertyPermission" "glass.gtk.uiScale" "read")
	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:468)
	at java.security.AccessController.checkPermission(AccessController.java:894)
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:541)
	at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1285)
	at java.lang.System.getProperty(System.java:721)
	at com.sun.glass.ui.gtk.GtkApplication.getFloat(GtkApplication.java:67)
	at com.sun.glass.ui.gtk.GtkApplication.<init>(GtkApplication.java:114)
	at com.sun.glass.ui.gtk.GtkPlatformFactory.createApplication(GtkPlatformFactory.java:41)
	at com.sun.glass.ui.Application.run(Application.java:146)
	at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:257)
	at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:231)
	at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:141)
	at javafx.embed.swing.JFXPanel.initFx(JFXPanel.java:211)
	at javafx.embed.swing.JFXPanel.<init>(JFXPanel.java:226)
	at helloworld.HelloJFXPanel.<init>(HelloJFXPanel.java:53)
	at helloworld.HelloJFXPanel$3.run(HelloJFXPanel.java:102)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:759)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:712)
	at java.awt.EventQueue$3.run(EventQueue.java:706)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:77)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:729)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:192)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:117)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:106)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:102)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:94)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:83)

Comments
Changeset: 93a70718eb87 Author: kcr Date: 2016-05-16 13:03 -0700 URL: http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/93a70718eb87
16-05-2016

The code change looks fine, but I can't seem to run these tests on my Linux machine to test it...
16-05-2016

Webrev: http://cr.openjdk.java.net/~kcr/8157060/webrev.00/ Simple fix to wrap the call to getFloat in a doPrivileged call.
16-05-2016

The following unit tests found this failure: test.sandbox.SandboxAppTest.testFXNonApp test.sandbox.SandboxAppTest.testJFXPanelApp test.sandbox.SandboxAppTest.testJFXPanelImplicitExitApp
16-05-2016