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

On Mac the packager fails with NPE when facing multiple matching identities for signing

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8u20
    • Fix Version/s: 8u40
    • Component/s: deploy
    • Labels:
    • Environment:

      Java 8 U20 b23
      MacOSX

      Description

      I got NPE in packager's code (see below) while producing a signed PKG containing a signed APP.

      Root cause seems to be the fact I have multiple matches for the identity, then codesign returns an error and the packager code isn't expecting it (see codesign man page extract below). You can read as well the "ambiguous" related message in packager's output (below).

      I removed the second match from the keychain then all went like a charm.

      Extract of codesign man page:

      " The identity is first considered as the full name of a keychain identity preference. If such a preference exists, it directly names
           the identity used. Otherwise, the identity is located by searching all keychains for a certificate whose subject common name (only)
           contains the identity string given. If there are multiple matches, the operation fails and no signing is performed; however, an
           exact match is preferred over a partial match. These comparisons are case sensitive. Multiple instances of the exactly same cer-
           tificate in multiple keychains are tolerated as harmless.
      "

      Running [codesign, -f, -s, Developer ID Application: Eric Le Ponner (8R99683QD2), -vvvv, /var/folders/ky/7_fc88ls2q97_f16j48nyrt0000jvp/T/fxbundler1489476965879983147/images/pkg.image/Java Packaging Tool u2.app/Contents/Java/ant-javafx.jar]
      Developer ID Application: Eric Le Ponner (8R99683QD2): ambiguous (matches "Developer ID Application: Eric Le Ponner (8R99683QD2)" and "Developer ID Application: Eric Le Ponner (8R99683QD2)" in /Users/elp/Library/Keychains/login.keychain)
      java.io.IOException: Exec failed with code 1 command [[codesign, -f, -s, Developer ID Application: Eric Le Ponner (8R99683QD2), -vvvv, /var/folders/ky/7_fc88ls2q97_f16j48nyrt0000jvp/T/fxbundler1489476965879983147/images/pkg.image/Java Packaging Tool u2.app/Contents/Java/ant-javafx.jar] in unspecified directory
      java.io.IOException: Exec failed with code 1 command [[codesign, -f, -s, Developer ID Application: Eric Le Ponner (8R99683QD2), -vvvv, /var/folders/ky/7_fc88ls2q97_f16j48nyrt0000jvp/T/fxbundler1489476965879983147/images/pkg.image/Java Packaging Tool u2.app/Contents/Java/ant-javafx.jar] in unspecified directory
      at com.oracle.tools.packager.IOUtils.exec(IOUtils.java:165)
      at com.oracle.tools.packager.IOUtils.exec(IOUtils.java:138)
      at com.oracle.tools.packager.IOUtils.exec(IOUtils.java:132)
      at com.oracle.tools.packager.mac.MacBaseInstallerBundler.lambda$signAppBundle$113(MacBaseInstallerBundler.java:243)
      at com.oracle.tools.packager.mac.MacBaseInstallerBundler$$Lambda$376/1518881075.accept(Unknown Source)
      at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
      at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
      at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
      at java.util.Iterator.forEachRemaining(Iterator.java:116)
      at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
      at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:512)
      at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502)
      at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
      at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
      at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
      at com.oracle.tools.packager.mac.MacBaseInstallerBundler.signAppBundle(MacBaseInstallerBundler.java:217)
      at com.oracle.tools.packager.mac.MacBaseInstallerBundler.signAppBundle(MacBaseInstallerBundler.java:206)
      at com.oracle.tools.packager.mac.MacAppBundler.doBundle(MacAppBundler.java:437)
      at com.oracle.tools.packager.mac.MacBaseInstallerBundler.prepareAppBundle(MacBaseInstallerBundler.java:197)
      at com.oracle.tools.packager.mac.MacPkgBundler.bundle(MacPkgBundler.java:126)
      at com.oracle.tools.packager.mac.MacPkgBundler.execute(MacPkgBundler.java:472)
      at javapackagingtool.Packager.createBundle(Packager.java:443)
      at javapackagingtool.mac.MacPackager.run(MacPackager.java:69)
      at javapackagingtool.AbstractPackager.runAndGenerateReport(AbstractPackager.java:32)
      at javapackagingtool.mac.MacPackagingWizard.performFinish(MacPackagingWizard.java:51)
      at wizard.Wizard.lambda$handleFinishButton$5(Wizard.java:259)
      at wizard.Wizard$$Lambda$252/1101094132.run(Unknown Source)
      at java.lang.Thread.run(Thread.java:745)
        Config files are saved to /var/folders/ky/7_fc88ls2q97_f16j48nyrt0000jvp/T/fxbundler1489476965879983147/macosx. Use them to customize package.
      java.lang.NullPointerException
      at com.oracle.tools.packager.mac.MacPkgBundler.createPKG(MacPkgBundler.java:327)
      at com.oracle.tools.packager.mac.MacPkgBundler.bundle(MacPkgBundler.java:134)
      at com.oracle.tools.packager.mac.MacPkgBundler.execute(MacPkgBundler.java:472)
      at javapackagingtool.Packager.createBundle(Packager.java:443)
      at javapackagingtool.mac.MacPackager.run(MacPackager.java:69)
      at javapackagingtool.AbstractPackager.runAndGenerateReport(AbstractPackager.java:32)
      at javapackagingtool.mac.MacPackagingWizard.performFinish(MacPackagingWizard.java:51)
      at wizard.Wizard.lambda$handleFinishButton$5(Wizard.java:259)
      at wizard.Wizard$$Lambda$252/1101094132.run(Unknown Source)
      at java.lang.Thread.run(Thread.java:745)

        Attachments

          Activity

            People

            Assignee:
            shemnon Danno Ferrin (Inactive)
            Reporter:
            yjoan Yves Joan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: