Bug 58630

Summary: Signing failed after deletion of first sheet
Product: POI Reporter: Constantin <c.pagenkopp>
Component: POIFSAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 3.13-FINAL   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: Test class and sample files

Description Constantin 2015-11-20 15:10:01 UTC
Created attachment 33285 [details]
Test class and sample files

Hello,

we have an Excel workbook (XLSX) which we would like to read and modify.
In the end we would like to sign it.

Unfortunately we get an NullPointerException while signing, when we have deleted the first sheet before:
java.lang.NullPointerException
	at org.apache.poi.poifs.crypt.dsig.facets.OOXMLSignatureFacet.addManifestReferences(OOXMLSignatureFacet.java:164)
	at org.apache.poi.poifs.crypt.dsig.facets.OOXMLSignatureFacet.addManifestObject(OOXMLSignatureFacet.java:100)
	at org.apache.poi.poifs.crypt.dsig.facets.OOXMLSignatureFacet.preSign(OOXMLSignatureFacet.java:89)
	at org.apache.poi.poifs.crypt.dsig.SignatureInfo.preSign(SignatureInfo.java:472)
	at org.apache.poi.poifs.crypt.dsig.SignatureInfo.confirmSignature(SignatureInfo.java:315)

Please note that this problem does not occur when we delete another sheet instead.

Please find attached a test class and sample files.

Thanks and best regards
Constantin
Comment 1 Andreas Beeker 2015-11-20 22:46:07 UTC
Thank you for providing a good test and example file - this made things easy 
for me.
Patched with r1715438

I've tried to recreate the error by creating a file from scratch and 
save/reloading it,
but this didn't triggered the reference path error.
I've only spent little time to compare the output of the scratch file to your 
template.xlsx -
on a quick view they look quite similar ... I guess you are happy when the 
signing works :)

Andi
Comment 2 Constantin 2015-11-25 08:50:19 UTC
Hi!

Thank you very much! Signing is working right now!

Best regards
Constantin