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

[Quantum] SecurityException on exit when running any FX program with security manager

XMLWordPrintable

      I discovered this while implementing the tests for RT-36197. To reproduce:

      1) Run any FX program with a security manager, for example:

          java -Djava.security.manager -cp dist/Hello.jar hello.HelloRectangle

      The program should come up and run fine.

      2) Close the window by pressing the window close button.

      The following exception will be thrown by the dispose code:

      Exception in thread "JavaFX Application Thread" java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "shutdownHooks")
      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.Runtime.removeShutdownHook(Runtime.java:237)
      at com.sun.javafx.tk.quantum.QuantumToolkit.dispose(QuantumToolkit.java:706)
      at com.sun.javafx.tk.quantum.QuantumToolkit.exit(QuantumToolkit.java:695)
      at com.sun.javafx.application.PlatformImpl$10.run(PlatformImpl.java:465)
      at com.sun.javafx.application.PlatformImpl$7.run(PlatformImpl.java:335)
      at com.sun.javafx.application.PlatformImpl$6$1.run(PlatformImpl.java:301)
      at com.sun.javafx.application.PlatformImpl$6$1.run(PlatformImpl.java:298)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.javafx.application.PlatformImpl$6.run(PlatformImpl.java:298)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
      at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
      at com.sun.glass.ui.win.WinApplication.access$300(WinApplication.java:39)
      at com.sun.glass.ui.win.WinApplication$4$1.run(WinApplication.java:112)
      at java.lang.Thread.run(Thread.java:744)

            kcr Kevin Rushforth
            kcr Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: