https://issues.apache.org/bugzilla/show_bug.cgi?id=55850
Bug ID: 55850
Summary: Null Pointer Exception when exporting xml data from an
excel document
Product: POI
Version: 3.9
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: XSSF
Assignee: [email protected]
Reporter: [email protected]
Created attachment 31097
--> https://issues.apache.org/bugzilla/attachment.cgi?id=31097&action=edit
File which causes a NPE when exporting xml data from
I created a simple excel document with a mapped xml schema. I then tried to
export the xml data from the excel sheet. This failed with a null pointer
exception.
Here is the stacktrace:
java.lang.NullPointerException
at
org.apache.poi.xssf.extractor.XSSFExportToXml.indexOfElementInComplexType(XSSFExportToXml.java:430)
at
org.apache.poi.xssf.extractor.XSSFExportToXml.compare(XSSFExportToXml.java:411)
at
org.apache.poi.xssf.extractor.XSSFExportToXml.compare(XSSFExportToXml.java:77)
at java.util.TimSort.countRunAndMakeAscending(TimSort.java:324)
at java.util.TimSort.sort(TimSort.java:203)
at java.util.TimSort.sort(TimSort.java:173)
at java.util.Arrays.sort(Arrays.java:659)
at java.util.Collections.sort(Collections.java:217)
at
org.apache.poi.xssf.extractor.XSSFExportToXml.exportToXML(XSSFExportToXml.java:157)
This is the code which calls the poi api:
XSSFMap map = mapInfo.getXSSFMapById(1);
XSSFExportToXml exporter = new XSSFExportToXml(map);
ByteArrayOutputStream os = new ByteArrayOutputStream();
exporter.exportToXML(os, true); // It fails here with a NPE
String xmlData = os.toString("UTF-8");
And I also attached the excel file.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]