Bug 58630 - Signing failed after deletion of first sheet
Summary: Signing failed after deletion of first sheet
Alias: None
Product: POI
Classification: Unclassified
Component: POIFS (show other bugs)
Version: 3.13-FINAL
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2015-11-20 15:10 UTC by Constantin
Modified: 2015-11-25 08:50 UTC (History)
0 users

Test class and sample files (17.88 KB, application/zip)
2015-11-20 15:10 UTC, Constantin

Note You need to log in before you can comment on or make changes to this bug.
Description Constantin 2015-11-20 15:10:01 UTC
Created attachment 33285 [details]
Test class and sample files


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:
	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
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 :)

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

Thank you very much! Signing is working right now!

Best regards