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

NullPointerException when starting from signed JNLP file with non-standard VM args

XMLWordPrintable

    • x86
    • windows_7

      FULL PRODUCT VERSION :
      java version "1.8.0_92"
      Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
      Java HotSpot(TM) Client VM (build 25.92-b14, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      Starting a webstart application gives a NullPointerException on the client if the file contains Java 9-style VM arguments (-addmods thing for example, instead of -Xarg=value)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Produce a small webstart application
      2. Make sure the JNLP file has <j2se version="1.6+" max-heap-size="512m" java-vm-args="-ea -addmods java.se.ee"/> in it
      3. Sign the JNLP file and the JAR file
      4. Launch the application

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The application should launch

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      java.lang.NullPointerException
      at com.sun.javaws.JnlpxArgs.execProgram(Unknown Source)
      at com.sun.javaws.Launcher.relaunch(Unknown Source)
      at com.sun.javaws.Launcher.prepareResources(Unknown Source)
      at com.sun.javaws.Launcher.prepareAllResources(Unknown Source)
      at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
      at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
      at com.sun.javaws.Launcher.launch(Unknown Source)
      at com.sun.javaws.Main.launchApp(Unknown Source)
      at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
      at com.sun.javaws.Main.access$000(Unknown Source)
      at com.sun.javaws.Main$1.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      test.jnlp
      ======

      <?xml version="1.0" encoding="utf-8"?>
      <jnlp spec="6.0+" codebase="http://jfkweb.cib.net/webstart" href="test.jnlp">
        <information>
          <title>Test app</title>
          <vendor>Anon</vendor>
          <offline-allowed/>
        </information>
        <security>
            <all-permissions/>
        </security>
        <update check="always" policy="always" />
        <resources>
          <j2se version="1.6+" max-heap-size="512m" java-vm-args="-ea -addmods java.se.ee"/>
          <jar href="test.jar" main="true"/>
        </resources>

        <application-desc main-class="Toto"/>
      </jnlp>

      Toto.java
      =========

      public class Toto {
        public static void main(String... argv) throws Exception {
          System.out.println("Success.");
        }
      }


      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Add an extra line to the JNLP file so that the Java 9-style arguments are only taken into account for jdk > 8

            mcherkas Mikhail Cherkasov (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: