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

            Bug ID: 69322
           Summary: setting useTempFilePackageParts is true  Cause an
                    error: Fail to save: an error occurs while saving the
                    package : arraycopy: destination index out of bounds
           Product: POI
           Version: 5.3.0-FINAL
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: SXSSF
          Assignee: dev@poi.apache.org
          Reporter: a96219...@gmail.com
  Target Milestone: ---

Enable the following Settings in the program
  ZipInputStreamZipEntrySource.setThresholdBytesForTempFiles(50000000);
  ZipPackage.setUseTempFilePackageParts(true);


Then export 200 images to excel xlsx file
The following error occurred

A test case was uploaded on github with the following repository address:
https://github.com/a96219/TempFilePackagePartsError

Running the org.example.Main.main method produces the following error:

Exception in thread "main"
org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException: Fail to save: an
error occurs while saving the package : arraycopy: destination index -2331 out
of bounds for byte[33554432]
        at
org.apache.poi.openxml4j.opc.ZipPackage.saveImpl(ZipPackage.java:604)
        at org.apache.poi.openxml4j.opc.OPCPackage.save(OPCPackage.java:1531)
        at org.apache.poi.openxml4j.opc.OPCPackage.close(OPCPackage.java:506)
        at org.apache.poi.ooxml.POIXMLDocument.close(POIXMLDocument.java:189)
        at
org.apache.poi.xssf.usermodel.XSSFWorkbook.close(XSSFWorkbook.java:642)
        at
org.apache.poi.xssf.streaming.SXSSFWorkbook.close(SXSSFWorkbook.java:936)
        at org.example.Main.main(Main.java:65)
Caused by: java.lang.ArrayIndexOutOfBoundsException: arraycopy: destination
index -2331 out of bounds for byte[33554432]
        at java.base/java.lang.System.arraycopy(Native Method)
        at
org.apache.commons.io.output.AbstractByteArrayOutputStream.writeImpl(AbstractByteArrayOutputStream.java:332)
        at
org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream.write(UnsynchronizedByteArrayOutputStream.java:207)
        at
org.apache.commons.compress.archivers.zip.StreamCompressor$OutputStreamCompressor.writeOut(StreamCompressor.java:64)
        at
org.apache.commons.compress.archivers.zip.StreamCompressor.writeCounted(StreamCompressor.java:305)
        at
org.apache.commons.compress.archivers.zip.StreamCompressor.deflate(StreamCompressor.java:197)
        at
org.apache.commons.compress.archivers.zip.StreamCompressor.flushDeflater(StreamCompressor.java:230)
        at
org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.flushDeflater(ZipArchiveOutputStream.java:983)
        at
org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.closeArchiveEntry(ZipArchiveOutputStream.java:585)
        at
org.apache.poi.openxml4j.opc.internal.marshallers.ZipPartMarshaller.marshall(ZipPartMarshaller.java:93)
        at
org.apache.poi.openxml4j.opc.internal.TempFilePackagePart.save(TempFilePackagePart.java:117)
        at
org.apache.poi.openxml4j.opc.internal.marshallers.DefaultMarshaller.marshall(DefaultMarshaller.java:46)
        at
org.apache.poi.openxml4j.opc.ZipPackage.saveImpl(ZipPackage.java:590)
        ... 6 more

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to