Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8097371

[JFXPanel] SecurityException in PlatformUtil when running SwingInterop with security manager

    Details

      Description

      To reproduce the bug, run the SwingInterop example program, or any other JFXPanel app, such as HelloJFXPanel, with a security manager enabled (or run it as an untrusted applet or Web Start app). For example:

      $ java -Djava.security.manager helloworld.HelloJFXPanel

      Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
      at com.sun.javafx.tk.Toolkit.getDefaultToolkit(Toolkit.java:118)
      at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:166)
      at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:214)
      at javafx.embed.swing.JFXPanel.initFx(JFXPanel.java:198)
      at javafx.embed.swing.JFXPanel.<init>(JFXPanel.java:213)
      at helloworld.HelloJFXPanel.<init>(HelloJFXPanel.java:53)
      at helloworld.HelloJFXPanel$3.run(HelloJFXPanel.java:102)
      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
      at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:744)
      at java.awt.EventQueue.access$400(EventQueue.java:97)
      at java.awt.EventQueue$3.run(EventQueue.java:697)
      at java.awt.EventQueue$3.run(EventQueue.java:691)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:714)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
      Caused by: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "javafx.platform" "read")
      at java.security.AccessControlContext.checkPermission(AccessControlContext.java:457)
      at java.security.AccessController.checkPermission(AccessController.java:884)
      at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
      at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1294)
      at java.lang.System.getProperty(System.java:714)
      at com.sun.javafx.PlatformUtil.<clinit>(PlatformUtil.java:63)
      ... 21 more

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kcr Kevin Rushforth
                Reporter:
                kcr Kevin Rushforth
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: