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

JNLP files must have a .jnlp extension to be shown in applications tab of cache viewer

XMLWordPrintable

    • 6
    • x86
    • windows_xp

      FULL PRODUCT VERSION :
      java version "1.6.0_01"
      Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
      Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)


      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      Java 1.5 JavaWebStart will correctly install an application even if the reference to the JNLP file does not have a ".jnlp" extension. For example, a ".php" extension can be used, to allow a php generated JNLP file to be served. To do this, the MIME type of the JNLP file is set to application/x-java-jnlp-file.

      With Java 1.6, with a .php the application still loads with JavaWebStart. However, when using javaws -vewier, the application is not present under the "Applications" tab. It is present as a collection of resources (each of the resources from the JNLP file) under the "Resources" tab. This means that the application cannot be removed using the viewer (at least as one application), cannot be started from the viewer, and shortcuts cannot be reinstalled. If the JNLP file is changed from a .php extension to .jnlp, then it works as expected.

      This could be a documentation defect - clearly document that the JNLP file must have a .jnlp extension, regardless of the correct MIME type being used. However, the behaviour with a .php extension is strange, and it 's not clear what installing the resources means when the application itself isn't installed.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Generate a JNLP file from a PHP script, with a .php extension. Ensure that the MIME type is set to application/x-java-jnlp-file. eg save this as //server/test/test.php:

      <?php

      // Ensure the mime type is correctly set for a JNLP file
      header('Content-Type: application/x-java-jnlp-file');
      // In a real example would want to set the modified date properly
      // header('Last-Modified: '.$date);
      ?>

      <?xml version="1.0" encoding="utf-8"?>
      <jnlp spec="1.0+" codebase="http://server/test" href="test.php">
          <information>
              <title>JNLP test</title>
              <vendor>Vendor</vendor>
              <homepage href="http://server/home.html"/>
              <description>JNLP test</description>
              <offline-allowed/>
              <shortcut online="true">
                  <desktop />
                  <menu submenu="JNLP test" />
              </shortcut>
          </information>
          <security>
              <all-permissions />
          </security>
          <resources>
              <j2se version="1.5+"/>
              <jar href="jarfile.jar" main="true" />
         </resources>
         <application-desc/>
      </jnlp>


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The application "JNLP test" to be installed as an application in JavaWebStart.
      ACTUAL -
      The jar file and JNLP file are cached as resources, but no application is visible in the Applications tab.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      Using an apache URL rewrite from .jnlp to .php allows the expected behaviour to be seen, by calling the JNLP file a .jnlp, but mapping it internally to a .php file.

      Release Regression From : 5.0u10
      The above release value was the last known release where this
      bug was not reproducible. Since then there has been a regression.

            herrick Andy Herrick (Inactive)
            ryeung Roger Yeung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: