You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2016/02/18 07:19:45 UTC

[Bug 59026] New: NullPointerException when try to Exports XLSX data using Custom XML Mapping

https://bz.apache.org/bugzilla/show_bug.cgi?id=59026

            Bug ID: 59026
           Summary: NullPointerException when try to Exports XLSX data
                    using Custom XML Mapping
           Product: POI
           Version: 3.14-dev
          Hardware: All
                OS: All
            Status: NEW
          Severity: critical
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: ehtasham37@gmail.com

Created attachment 33568
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=33568&action=edit
Zip containing sample xsd, XLSX with Custom Mapping and code to reproduce this
issue

I got the following exception when try to export XLSX data using my Custom XML
Mapping. Its due to the following line. I comment out this line as a workaround
in my project because xml in sorted order is not my requirement. This issue
occur because my XML Schema contains Anonymous complex types and Abstract
complex types. I need a lot of changes to use all named complex types and
remove abstract types from my schema. Can I go with this workaround and expect
you will fix this issue in next release, so I don't need to rebuild the whole
project for this single line change. You may give an overrided method with an
additional boolean parameter to get whether need sorting or not like validation
as a quick fix for this.

XSSFExportToXml:153
Collections.sort(xpaths, this);

Here is the exception.

Exception in thread "main" java.lang.NullPointerException
    at
org.apache.poi.xssf.extractor.XSSFExportToXml.indexOfElementInComplexType(XSSFExportToXml.java:449)
    at
org.apache.poi.xssf.extractor.XSSFExportToXml.compare(XSSFExportToXml.java:430)
    at
org.apache.poi.xssf.extractor.XSSFExportToXml.compare(XSSFExportToXml.java:1)
    at java.util.TimSort.countRunAndMakeAscending(Unknown Source)
    at java.util.TimSort.sort(Unknown Source)
    at java.util.TimSort.sort(Unknown Source)
    at java.util.Arrays.sort(Unknown Source)
    at java.util.Collections.sort(Unknown Source)
    at
org.apache.poi.xssf.extractor.XSSFExportToXml.exportToXML(XSSFExportToXml.java:153)
    at
org.apache.poi.xssf.extractor.XSSFExportToXml.exportToXML(XSSFExportToXml.java:106)

I attached a zip containing sample xsd, XLSX with Custom Mapping and code to
reproduce this issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 59026] NullPointerException when try to Exports XLSX data using Custom XML Mapping

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59026

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #1 from Dominik Stadler <do...@gmx.at> ---
After r1767057 we avoid two possible null-pointer-exceptions in this area, the
export to XML seems to work fine then.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org