[Bug 61281] New: XML export of xlsx results in IndexOutOfBoundsException

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 61281] New: XML export of xlsx results in IndexOutOfBoundsException

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61281

            Bug ID: 61281
           Summary: XML export of xlsx results in
                    IndexOutOfBoundsException
           Product: POI
           Version: 3.14-FINAL
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: [hidden email]
          Reporter: [hidden email]
  Target Milestone: ---

When attempting to Export the XML of attached xlsx, there occurs following
exception:
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
        at java.util.ArrayList.rangeCheck(Unknown Source)
        at java.util.ArrayList.get(Unknown Source)
        at
org.apache.poi.xssf.extractor.XSSFExportToXml.exportToXML(XSSFExportToXml.java:203)
        at
org.apache.poi.xssf.extractor.XSSFExportToXml.exportToXML(XSSFExportToXml.java:109)

The reason is, that one column of the table isn't mapped. When I do the export
from Excel, it works. There is a different handling between Excel and Apache
POI.
The code for exporting the XML is as following:

 XSSFWorkbook wb = /*given from previous code execution*/;
       for (XSSFMap map : wb.getCustomXMLMappings()) {
           XSSFExportToXml exporter = new XSSFExportToXml(map);

           ByteArrayOutputStream os = new ByteArrayOutputStream();
           exporter.exportToXML(os, true);
       }

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 61281] XML export of xlsx results in IndexOutOfBoundsException

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61281

Daniel <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--- Comment #1 from Daniel <[hidden email]> ---
Created attachment 35119
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35119&action=edit
[PATCH] proposed patch including testcase

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 61281] XML export of xlsx results in IndexOutOfBoundsException

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61281

Daniel <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #35119|0                           |1
        is obsolete|                            |
  Attachment #35119|1                           |0
           is patch|                            |

--- Comment #2 from Daniel <[hidden email]> ---
Comment on attachment 35119
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35119
[PATCH] proposed patch including testcase

Mark patch as obsolete, as the solution is not complete

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 61281] XML export of xlsx results in IndexOutOfBoundsException

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61281

--- Comment #3 from Daniel <[hidden email]> ---
Created attachment 35120
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35120&action=edit
xlsx which ends up in a IndexOutOfBoundsException

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 61281] XML export of xlsx results in IndexOutOfBoundsException

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61281

PJ Fanning <[hidden email]> changed:

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

--- Comment #4 from PJ Fanning <[hidden email]> ---
added guard in https://svn.apache.org/viewvc?view=revision&revision=1801634

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 61281] XML export of xlsx results in IndexOutOfBoundsException

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61281

Daniel <[hidden email]> changed:

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

--- Comment #5 from Daniel <[hidden email]> ---
Thanks for your fast fix. unfortunately, it just gets rid of the exception, but
doesn't provide the same behaviour as the export in Excel does. ==> Reopen

Please see attached patch that has a testcase illustrating the Problem and a
proposed fix.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 61281] XML export of xlsx results in IndexOutOfBoundsException

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61281

--- Comment #6 from Daniel <[hidden email]> ---
Created attachment 35122
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35122&action=edit
Proposed fix that provides same behaviour as excel

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 61281] XML export of xlsx results in IndexOutOfBoundsException

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61281

--- Comment #7 from PJ Fanning <[hidden email]> ---
Hi Daniel - any chance you could do a Github Pull Request?
https://github.com/apache/poi

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 61281] XML export of xlsx results in IndexOutOfBoundsException

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61281

PJ Fanning <[hidden email]> changed:

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

--- Comment #8 from PJ Fanning <[hidden email]> ---
Latest patch applied using
https://svn.apache.org/viewvc?view=revision&revision=1801721

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...