Bug 57914 - NPE on OPCPackage created with Excel 2013
Summary: NPE on OPCPackage created with Excel 2013
Status: RESOLVED DUPLICATE of bug 57699
Alias: None
Product: POI
Classification: Unclassified
Component: OPC (show other bugs)
Version: 3.9-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-11 11:01 UTC by miguel.penetra
Modified: 2016-02-27 10:24 UTC (History)
1 user (show)



Attachments
Excel 2013 (9.34 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2015-05-11 11:03 UTC, miguel.penetra
Details
Working file (9.14 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2015-05-11 11:04 UTC, miguel.penetra
Details

Note You need to log in before you can comment on or make changes to this bug.
Description miguel.penetra 2015-05-11 11:01:58 UTC

    
Comment 1 miguel.penetra 2015-05-11 11:03:42 UTC
Created attachment 32726 [details]
Excel 2013

Erroneous file
Comment 2 miguel.penetra 2015-05-11 11:04:04 UTC
Created attachment 32727 [details]
Working file
Comment 3 miguel.penetra 2015-05-11 11:05:26 UTC
I'm sorry but the bug creation did not go as planned and I can't delete it now. 
The problem is the following:

I have a web site where users can upload CSV and XLSX files and I use Apache-POI to parse XLSX files. However, I discovered something unusual. When I convert a CSV file to XLSX on Excel 2013 I get a NPE while initializing XSSFReader:

 java.lang.NullPointerException
	at org.apache.poi.openxml4j.opc.OPCPackage.getPart(OPCPackage.java:625)
	at org.apache.poi.xssf.eventusermodel.XSSFReader.<init>(XSSFReader.java:67)

file.exists() returns true.

I asked someone to convert the same file for me with Excel 2011 and the error disappears. I've tried this with poi-3.11 and 3.9 and respective dependencies with the same result.

Sample files are attached.
Comment 4 Dominik Stadler 2015-08-11 05:56:45 UTC
Some analysis: The XML files in the document use different XML namespaces, which POI does not support, I am not sure why Excel uses these in your case, e.g. instead of http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument, it uses http://purl.oclc.org/ooxml/officeDocument/relationships/officeDocument, where purl.oclc.org seems to be some URL-redirection mechanism...
Comment 5 Dominik Stadler 2016-02-27 10:24:56 UTC
These files are saved in "OOXML Strict" format, which POI does not yet support, see bug 57699 for the remaining work.

In r1732619 I have fixed the error message to better state this now and link to the bug for reference, so this bug is now marked as duplicate.

*** This bug has been marked as a duplicate of bug 57699 ***