2 Replies Latest reply: Feb 15, 2013 12:45 PM by nlorain-Oracle RSS

    JavaFX MediaPlayer initiated from Javascript 'access denied'

    991119
      I'm trying to use JavaFX's MediaPlayer class to playback a media from a specified url.

      If my code runs (which creates the MediaPlayer class) for a JavaFX-button.click, everything works fine, if my code is initiated via Javascript by an HTML link.click inside the webpage where the JavaFX applet is embedded, I get the following error:

      MediaException: UNKNOWN : access denied ("java.lang.RuntimePermission" "modifyThreadGroup")

      My JavaFX applet requests 'unrestricted access' and self-signed by Netbeans.

      I have the latest 7u13 JDK, the 'funny' thing is that everything worked with 7u11 :(

      Any workaround for this problem? I can't put all my UI code into the JavaFX, I want them in HTML.

      @EDIT: forgot to mention, that in my Javascript-called method, I marshal the call to the main JavaFX-thread via javafx.application.Platform.runLater but still somehow JavaFX knows that the code is executed by a non-user-initiated action.

      Edited by: 988116 on Feb 14, 2013 7:06 AM
        • 1. Re: JavaFX MediaPlayer initiated from Javascript 'access denied'
          jsmith
          I have the latest 7u13 JDK, the 'funny' thing is that everything worked with 7u11
          I advise you to put together some small sample code so that somebody could replicate this and log a bug against the runtime project at:
          http://javafx-jira.kenai.com

          Tag the bug regression.

          Most likely it is a Java core platform bug rather than a JavaFX bug, but the JavaFX developers should be able to triage it and assign it to the right team.

          Normally a workaround would just be to use an older Java version, but because most browsers will block older Java versions due to security issues, that's not really an option for your applet, so you'll need to work out some other way of doing this or just disable that functionality from your application for now.
          • 2. Re: JavaFX MediaPlayer initiated from Javascript 'access denied'
            nlorain-Oracle
            This may be related to the changes in the security policy for applets and WebStart applications introduced in 7u13. See http://javafx-jira.kenai.com/browse/RT-28239 for more details