Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-229

Failing of package as Installers on Netbeans Platform applications [NPE]

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 8.2, 9.0
    • 9.0

    Description

      Build failed performing Package as -> Installers on Netbeans Platform application.

      Environment and setup details:
      OS: Linux mint 18.3 - 64bit
      incubator-netbeans repo status: Pull on same day
      Installers to generate: windows

      Exception Details:

      /home/thilina/github/incubator-netbeans/nbbuild/netbeans/harness/nbi/stub/template.xml:66: The following error occurred while executing this line:
      /mnt/DATA/Documents/GitHubOff/nbiz/NbizApp/build/installer/build.xml:185:
      org.netbeans.installer.infra.lib.registries.ManagerException: Could not create bundle - error in running the engine

      [2017-12-27 12:05:34.811]: An unexpected exception happened in thread Thread-5
      [2017-12-27 12:05:34.812]: java.lang.NullPointerException
      [2017-12-27 12:05:34.812]: at org.netbeans.installer.utils.FileUtils.getCrc32(FileUtils.java:418)
      [2017-12-27 12:05:34.812]: at org.netbeans.installer.utils.system.launchers.impl.ExeLauncher.addFileSection(ExeLauncher.java:359)
      [2017-12-27 12:05:34.812]: at org.netbeans.installer.utils.system.launchers.impl.ExeLauncher.create(ExeLauncher.java:145)
      [2017-12-27 12:05:34.812]: at org.netbeans.installer.utils.SystemUtils.createLauncher(SystemUtils.java:470)
      [2017-12-27 12:05:34.812]: at org.netbeans.installer.wizard.components.actions.CreateNativeLauncherAction.execute(CreateNativeLauncherAction.java:97)
      [2017-12-27 12:05:34.812]: at org.netbeans.installer.wizard.components.WizardAction$1.run(WizardAction.java:103)

      *Traced originate location *
      class: org.netbeans.installer.utils.system.launchers.impl.ExeLauncher
      method: create
      line number: 145
      line code: addFileSection(fos, testJVMFile, progress,total);

      Invistigation:

      added println to inspect values above the suspected line (145)

      code:
      System.out.println("thilina01:create[145]@"+getClass());
      System.out.println(testJVMFile);
      System.out.println(testJVMFile.getPath());
      System.out.println(testJVMFile.getAbsolutePath());
      System.out.println(testJVMFile.getPathType());
      addFileSection(fos, testJVMFile, progress,total);

      output:
      thilina01:create[145]@class org.netbeans.installer.utils.system.launchers.impl.ExeLauncher
      org.netbeans.installer.utils.system.launchers.LauncherResource@5433a1a1
      org/netbeans/installer/utils/applications/TestJDK.class
      $L

      {nbi.launcher.tmp.dir}

      /TestJDK.class
      nbi.launcher.tmp.dir

      Note: According to the output there should be a file named TestJDK.class at org/netbeans/installer/utils/applications/
      But the file is not present at the location.

      Fix attempts:
      Skip error: [Failed]
      tried skipping the null pointer by using if statement, it completes the build and displays "Build Success"
      but generated installer is corrupted

      Externally provide the missing resource: [Success]

      on old netbeans hg repo, noticed the needed binary file is present, Downloaded and placed the file.

      Link:
      http://hg.netbeans.org/main/file/tip/nbi/engine/src/org/netbeans/installer/utils/applications/TestJDK.class

      Location placed: incubator-netbeans/nbi/engine/src/org/netbeans/installer/utils/applications/TestJDK.class
      Full path (on my PC): /home/thilina/github/incubator-netbeans/nbi/engine/src/org/netbeans/installer/utils/applications/TestJDK.class

      Result:
      Build Success

      Generated installer is fine, successfully installed on windows 10 64bit PC

      Summary:
      Failing of package as Installers on Netbeans Platform applications can be fixed by adding the missing binary file TestJDK.class to the /incubator-netbeans/nbi/engine/src/org/netbeans/installer/utils/applications/ folder.

      Discussion:
      Is the file skipped intentionally in the process of transition due to any issue in licensing or other reason? Please explain
      Is it okay to add the file and submit PR? If not, What would be the applicable fix? Happy to help.

      Thanks,
      Thilina Ranathunga (thilina01)

      Attachments

        1. code.png
          10 kB
          Thilina Ranathunga
        2. errjava.png
          15 kB
          Thilina Ranathunga
        3. output.png
          5 kB
          Thilina Ranathunga
        4. packageas.png
          27 kB
          Thilina Ranathunga
        5. sout
          0.3 kB
          Thilina Ranathunga
        6. xmler.png
          17 kB
          Thilina Ranathunga

        Issue Links

          Activity

            People

              thilina01 Thilina Ranathunga
              thilina01 Thilina Ranathunga
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h
                  1h