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

java.lang.NullPointerException: Cannot read the array length because the return

XMLWordPrintable

    • x86_64
    • os_x

      ADDITIONAL SYSTEM INFORMATION :
      Mac OSX Catalina 10.15.5 (19F101)
      java --version
      openjdk 16-ea 2021-03-16
      OpenJDK Runtime Environment (build 16-ea+6-203)
      OpenJDK 64-Bit Server VM (build 16-ea+6-203, mixed mode, sharing)

      A DESCRIPTION OF THE PROBLEM :
      jpackage --type dmg --app-image repeatably gives:
      java.lang.NullPointerException: Cannot read the array length because the return value of "java.io.File.list()" is null
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.DeployParams.validate(DeployParams.java:209)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.Arguments.processArguments(Arguments.java:510)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.main.Main.execute(Main.java:98)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.main.Main.main(Main.java:52)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Set up appropriate file structure and Apple Developer certificates. Prove that jpacage runs well with other options.

      Try the combination of --type dmg --app-image as for example the following:

      jpackage --type dmg --app-image /Users/davidjlgradwell/NetBeansDev/PKBAnt/jpackagepkgoutput23rdJuly2020stapledKeep/PKB-1.0.pkg --name PKBInstaller --dest /Users/davidjlgradwell/NetBeansDev/PKBAnt/jpackagedmgoutputpkg23july2020 --resource-dir /Users/davidjlgradwell/NetBeansDev/PKBAnt/resources --temp /Users/davidjlgradwell/NetBeansDev/PKBAnt/jpackageappimagepkg23july2020 --verbose


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Would expect a .dmg to be produced.
      ACTUAL -
      WARNING: Using incubator modules: jdk.incubator.jpackage
      [14:26:18.002] java.lang.NullPointerException: Cannot read the array length because the return value of "java.io.File.list()" is null
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.DeployParams.validate(DeployParams.java:209)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.Arguments.processArguments(Arguments.java:510)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.main.Main.execute(Main.java:98)
      at jdk.incubator.jpackage/jdk.incubator.jpackage.main.Main.main(Main.java:52)

      ---------- BEGIN SOURCE ----------
      Needs a complete application package. I used one created successfully using jpackage immediately before.
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      No work around

      FREQUENCY : always


            adev Anupam Dev
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: