https://bz.apache.org/bugzilla/show_bug.cgi?id=66625

            Bug ID: 66625
           Summary: Unable to sign a docx file multiple times
           Product: POI
           Version: 5.2.3-FINAL
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: POIFS
          Assignee: dev@poi.apache.org
          Reporter: rcc.d...@gmail.com
  Target Milestone: ---

Created attachment 38573
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=38573&action=edit
Code that produces the exception (while executing the second loop block)

Hi everyone. I am trying to sign a docx document repeatedly, but I am at a
loss. The `setAllowMultipleSignatures` option is allowing me to sign the
document multiple times as long as I don't close the package. If I close the
package and reopen it to try to sign it again, the following exception is
thrown:

`java.lang.NullPointerException: Cannot invoke
"org.apache.poi.openxml4j.opc.PackagePart.getContentType()" because "pp2" is
null
        at
org.apache.poi.poifs.crypt.dsig.facets.OOXMLSignatureFacet.addManifestReferences(OOXMLSignatureFacet.java:176)
        at
org.apache.poi.poifs.crypt.dsig.facets.OOXMLSignatureFacet.addManifestObject(OOXMLSignatureFacet.java:110)
        at
org.apache.poi.poifs.crypt.dsig.facets.OOXMLSignatureFacet.preSign(OOXMLSignatureFacet.java:96)
        at
org.apache.poi.poifs.crypt.dsig.SignatureInfo.preSign(SignatureInfo.java:383)
        at
org.apache.poi.poifs.crypt.dsig.SignatureInfo.confirmSignature(SignatureInfo.java:225)`

I am attaching my code. I guess the mere `java.lang.NullPointerException`
exception is enough reason to report this as a bug. Any help is appreciated.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to