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

Gtk: SecurityException using WebView when running app with security manager

XMLWordPrintable

      To reproduce, run the attached program on a Linux machine with a security manager enabled (or run it as an untrusted applet or Web Start app).

      $ java -Djava.security.manager -webviewapp.Main

      Exception in Application start method
      Workaround until RT-13281 is implemented: keep toolkit alive
      java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Unknown Source)
      at com.sun.javafx.application.LauncherImpl.launchApplication(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
      Caused by: java.lang.RuntimeException: Exception in Application start method
      at com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
      at com.sun.javafx.application.LauncherImpl.access$000(Unknown Source)
      at com.sun.javafx.application.LauncherImpl$1.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
      Caused by: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "user.home" "read")
      at java.security.AccessControlContext.checkPermission(Unknown Source)
      at java.security.AccessController.checkPermission(Unknown Source)
      at java.lang.SecurityManager.checkPermission(Unknown Source)
      at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
      at java.lang.System.getProperty(Unknown Source)
      at com.sun.glass.ui.Application.getDataDirectory(Unknown Source)
      at javafx.scene.web.WebEngine.defaultUserDataDirectory(Unknown Source)
      at javafx.scene.web.WebEngine.applyUserDataDirectory(Unknown Source)
      at javafx.scene.web.WebEngine.load(Unknown Source)
      at webviewapp.Main.start(Main.java:32)
      at com.sun.javafx.application.LauncherImpl$8.run(Unknown Source)
      at com.sun.javafx.application.PlatformImpl$7.run(Unknown Source)
      at com.sun.javafx.application.PlatformImpl$6$1.run(Unknown Source)
      at com.sun.javafx.application.PlatformImpl$6$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.javafx.application.PlatformImpl$6.run(Unknown Source)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
      at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
      at com.sun.glass.ui.gtk.GtkApplication.access$200(Unknown Source)
      at com.sun.glass.ui.gtk.GtkApplication$6$1.run(Unknown Source)
      ... 1 more
      Exception running application webviewapp.Main

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

              Created:
              Updated:
              Resolved:
              Imported: