4 Replies Latest reply on Oct 8, 2011 5:16 PM by 888925

    How to move the html file

    888925
      With Netbeans IDE 7.1 Beta I have generated the JavaFXApplication. After "clean and Build Main Project", I can click on the html file in the dist directory and the Hello World application is working.

      Now I have modified the html file changing the relative path informations to absolute ones. But still it's working in the dist directory but not elsewhere. If I try then I get a "Runtime Error":

      Java-Plug-in 10.0.1.255
      JRE-Version verwenden 1.6.0_27-b07 Java HotSpot(TM) Client VM
      Benutzer-Home-Verzeichnis = C:\Users\Javus.Argos-PC
      ----------------------------------------------------
      ...
      ----------------------------------------------------
      java.lang.NullPointerException
           at sun.plugin2.applet.JNLP2Manager.initialize(Unknown Source)
           at sun.plugin2.main.client.PluginMain.initManager(Unknown Source)
           at sun.plugin2.main.client.PluginMain.access$200(Unknown Source)
           at sun.plugin2.main.client.PluginMain$2.run(Unknown Source)
           at java.lang.Thread.run(Unknown Source)
      Error while initializing manager: java.lang.NullPointerException, bail out


      My modified html file:
      <html><head>
        <SCRIPT src="file:///C:/Users/Javus.Argos-PC/Documents/NetBeansProjects/JavaFXApplication5/dist/web-files/dtjava.js"></SCRIPT>
      <script>
          function javafxEmbed_fxApp() {
              dtjava.embed(
                  {
                      id : 'fxApp',
                      url : 'file:///C:/Users/Javus.Argos-PC/Documents/NetBeansProjects/JavaFXApplication5/dist/JavaFXApplication5.jnlp',
                      placeholder : 'javafx-app-placeholder',
                      width : 800,
                      height : 600,
                      jnlp_content : 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxqbmxwIHNwZWM9IjEuMCIgeG1sbnM6amZ4PSJodHRwOi8vamF2YWZ4LmNvbSIgaHJlZj0iSmF2YUZYQXBwbGljYXRpb241LmpubHAiPg0KICA8aW5mb3JtYXRpb24+DQogICAgPHRpdGxlPkphdmFGWEFwcGxpY2F0aW9uNTwvdGl0bGU+DQogICAgPHZlbmRvcj5KYXZ1czwvdmVuZG9yPg0KICAgIDxkZXNjcmlwdGlvbj5TYW1wbGU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xhc3M9ImphdmFmeGFwcGxpY2F0aW9uNS5KYXZhRlhBcHBsaWNhdGlvbjUiICBuYW1lPSJKYXZhRlhBcHBsaWNhdGlvbjUiIC8+DQogIDx1cGRhdGUgY2hlY2s9ImJhY2tncm91bmQiLz4NCjwvam5scD4NCg=='
                  },
                  {
                      javafx : '2.0+'
                  },
                  {}
              );
          }
          <!-- Embed FX application into web page once page is loaded -->
          dtjava.addOnloadCallback(javafxEmbed_fxApp);
      </script>
      
      </head><body>
      <h2>Test page for <b>JavaFXApplication5</b></h2>
      
        <!-- Applet will be inserted here -->
        <div id='javafx-app-placeholder'></div>
      </body></html>
        • 1. Re: How to move the html file
          865474
          I am having the same problem check forum

          reference jnlp
          • 2. Re: How to move the html file
            888925
            The references to the jnlp in the html-file are ignored!

            1) I generated a new JavaFXApplication with Netbeans.
            2) I modified the jnlp-filename in the html-file.
            3) The application was still working!!!
            4) I renamed the jnlp-file.
            5) Then I got the runtime error.

            Motivation:
            I have written a JavaFX application. I want to embed it into my blog. I can embed html-code into my blog pages but I don't know where it is located. I want to store the referenced jnlp-file, the jar and the other files from the dist directory on my web server.

            It would be very helpful, if the Netbeans example could demonstrate how to move the html-file.
            • 3. Re: How to move the html file
              817264
              I suspect that problem in your case is caused by 2 things:
              a) html has jnlp_content tag that may not correspond to real JNLP as internally it does not specify codebase and therefore all reltive resources will be resolved
              relatively to html page location
              b) cache may have "old" content and this may add noise to your tests
              (make sure to start with clean cache)

              See Re: reference jnlp for working examples.
              1 person found this helpful
              • 4. Re: How to move the html file
                888925
                I have removed the jnlp_content. Now, it works. Thx Igor.