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

New plugin has very misleading error messages for invalid JNLP files

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 6u10
    • 6u10
    • deploy
    • b12
    • b28
    • x86
    • windows, windows_xp

      If the JNLP used for an applet is invalid then the applet will fail to load. This is correct. However, the error message in the Java console is extremely misleading, causing the developer to search in vain trying to fix the wrong thing. The plugin will report that the JNLP file could not be found, when in fact it *was* found but it did not parse correctly. This problem has already been seen in the wild by external developers testing JavaSE 6 update 10 betas.

      Below is the stack trace produce if you leave the name, width, or height attributes out of the applet-desc element of your JNLP file:

      exception: null.
      java.io.FileNotFoundException: JNLP not available: foo.jnlp
         at sun.plugin2.applet.JNLP2Manager.loadJarFiles(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
      Exception: java.io.FileNotFoundException: JNLP not available: foo.jnlp

      There are two things wrong here. First, there is an exception being thrown "exception: null" without printing the full stack trace or a description of the real problem. Second, the secondary exception: FileNotFoundException, is incorrect. The jnlp *was* in fact found, but the parsing failed because a required attribute was missing. The actual failing code should instead be throwing a valid exception, and whatever code is throwing the FNF should check to ensure that the file was in fact not found.

      To reproduce this error, take any working JNLP applet and remove the width attribute of the applet-desc tag in the JNLP file.

      This error has been found in the community as evidenced by these forum posts:

      http://forums.java.net/jive/thread.jspa?threadID=41534&tstart=0

      http://forums.java.net/jive/thread.jspa?messageID=284047&tstart=0#284047

      In the second case, it appears that the XML file was malformed, but again the exception was FileNotFound rather than an XML parsing exception.

            kbr Kenneth Russell (Inactive)
            jmarinacsunw Joshua Marinacci (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: