|Summary:||NPE on OPCPackage created with Excel 2013|
|Component:||OPC||Assignee:||POI Developers List <dev>|
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 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 ***