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

Javafx Web-Start desktop shortcut issue with JNLP deployment.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Cannot Reproduce
    • Affects Version/s: 7u10
    • Fix Version/s: None
    • Component/s: deploy
    • Environment:

      Description

      Hi there,

      I am using Maven-Ant-tasks to compile javafx application and deploying as a web start. And using new javafx ant build syntax with java_jdk 7U10/7U11
      I am signing all jar files for full system access and the application will request for permissions <all-permissions>.
      My intention is to create a desktop shortcut to the application using JNLP. Start menu is excluded in the creation. I use new <fx: /> syntax for jar deployment fx:deploy fx:Jar etc.

      I had a problem here.

      ---------------
      Issue 1
      ---------------
      While deploying application I used <fx:deploy><fx:preferences shortcut="true" menu="false" /></fx:deploy>
      So I want to create only the desktop short cut ignoring start menu entries.
      The generated JNLP look like this.
      ------------------------
      <?xml version="1.0" encoding="utf-8"?>
      <jnlp spec="1.0" xmlns:jfx="http://javafx.com" href="MYAPP.jnlp">
        <information>
          <title>MYAPP</title>
          <vendor>Hewlett-Packard</vendor>
          <description>Secure Collaboration Services</description>
          <offline-allowed/>
        </information>
        <resources>
          <jfx:javafx-runtime version="2.2+" href="http://javadl.sun.com/webapps/download/GetFile/javafx-latest/windows-i586/javafx2.jnlp"/>
        </resources>
        <resources>
          <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
          <jar href="MYAPP.jar" size="591971" download="eager" />
          <jar href="libs/guava-13.0.1.jar" size="1914717" download="eager" />
          <jar href="libs/log4j-1.2.17.jar" size="490849" download="eager" />
          <jar href="libs/plexus-utils-3.0.8.jar" size="234550" download="eager" />
        </resources>
        <security>
          <all-permissions/>
        </security>
        <shortcut><desktop/></shortcut>
        <applet-desc width="1085" height="750" main-class="com.javafx.main.NoJavaFXFallback" name="MYAPP" >
          <param name="requiredFXVersion" value="2.2+"/>
        </applet-desc>
        <jfx:javafx-desc width="1085" height="750" main-class="com.MYAPP" name="MYAPP" />
        <update check="background"/>
      </jnlp>
      --------------------------
      This placing the "<shortcut><desktop/></shortcut>" outside the "<information>". This is not as described in JNLP docs.
      Even If i enable Menu "<fx:preferences shortcut="true" menu="true" />" this doesn't insert any additional nodes in <shortcut>. It always has "<desktop/>".

      ---------------
      Issue 2
      ---------------
      When the application is deployed in the test server[locally running in intranet/lan]. The first launch (after cleaning all the jars from the java cache) will create a desktop shortcut and application runs.
      STRANGE : Though the menu entry made false or no xml nodes were generated to for menu, there is a start menu entry is getting created. Cannot stop!

      ---------------
      Issue 3 MAJOR
      ---------------
      Next time when i try to run the application from the desktop shortcut OR start menu shortcut.
      The application runs for the first time from the shortcut.
      After a while the desktop shortcut will disappear for a second and reappears [kind of icon refresh. No other icons will have any effect.]
      Once it happens, double clicking the icon will start throwing the error window.
      Shows window with title "Application Err" with "Unable to launch the application".
      The deatils button will show "More Information" telling "java.io.FileNotFoundException: C:\Users\XXXX\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\32\MYAPP.jnlp (The system cannot find the file specified)"

      ----------------------------------------------
      STEPS I HAVE TAKES FOR TROUBLESHOOTING
      ----------------------------------------------
      {clearing up the java cache every time while troubleshooting and running the server on different ports and renaming the files to avoid proxy caching}
      [A] Tried to move the "<shortcut><desktop/></shortcut>" node to "<information>".
      [B] Tried to add "<menu>" in "<shortcut>" for each try.

      These steps resulted in no change. proble remain same for each operation.

      Further I noticed.
      Some wired behaviour with short cut after and before refresh.

      Initially the folder "C:\Users\XXXX\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\32" had 3 files
      2c3f60-6.0.lap [This file containing the application run/install status]
      2c3f60-40c4eaa0 [Literally this is a JNLP file]
      2c3f60-40c4eaa0.idx [Encrypted]
      The desktop short cut (before it is refreshed automatically) is pointing to the file "2c3f60-40c4eaa0".
      C:\Windows\SysWOW64\javaws.exe -localfile -J-Djnlp.application.href=http://server:9010/MYAPP.jnlp "C:\Users\XXXX\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\32\2c3f60-40c4eaa0"

      Once the application is launched for the first time from the desktop shortcut two additional files were created in the same directory.
      2c3f60-2820d52b [Contains same jnlp data with all the FX syntaxes ]
      2c3f60-2820d52b.idx[Encrypted]

      The desktp shortcut still pointing to file "2c3f60-40c4eaa0"
      C:\Windows\SysWOW64\javaws.exe -localfile -J-Djnlp.application.href=http://server:9010/MYAPP.jnlp "C:\Users\XXXX\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\32\2c3f60-40c4eaa0"

      With some curiosity i tried to change the desktop short cut to point to the newly created file "2c3f60-2820d52b"
      C:\Windows\SysWOW64\javaws.exe -localfile -J-Djnlp.application.href=http://server:9010/MYAPP.jnlp "C:\Users\XXXX\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\32\2c3f60-2820d52b"

      VOLA ! that will work.
      But the problem! the shortcut pointing to the old file will not work any more.

        Attachments

          Activity

            People

            • Assignee:
              herrick Andy Herrick
              Reporter:
              duke J. Duke (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: