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 2017/10/31 11:28:00 UTC
[Bug 61703] Fail to save stream with OpenXML4JRuntimeException
https://bz.apache.org/bugzilla/show_bug.cgi?id=61703
--- Comment #1 from Javen O'Neal <on...@apache.org> ---
Relevant portions of the stack trace:
> org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException: Fail to save: an
> error occurs while saving the package : The part /docProps/core.xml fail to be
> saved in the stream with marshaller
> org.apache.poi.openxml4j.opc.internal.marshallers.ZipPackagePropertiesMarshaller@5c5d22d0
> at org.apache.poi.openxml4j.opc.ZipPackage.saveImpl(ZipPackage.java:602)
> at org.apache.poi.openxml4j.opc.OPCPackage.save(OPCPackage.java:1557)
> at org.apache.poi.POIXMLDocument.write(POIXMLDocument.java:248)
>
> Caused by: org.apache.poi.openxml4j.exceptions.OpenXML4JException: The part
> /docProps/core.xml fail to be saved in the stream with marshaller
> org.apache.poi.openxml4j.opc.internal.marshallers.ZipPackagePropertiesMarshaller@5c5d22d0
> at org.apache.poi.openxml4j.opc.ZipPackage.saveImpl(ZipPackage.java:582)
> ... 245 more
From the stack trace, this error occurred while saving an OOXML file.
(In reply to Andrei Ivanov from POI Users mailing list)
> I have a hunch that the http request just gets aborted/reset so the
> output stream just gets closed.
> I'll probably wait for the next release to include it in our next
> release and then I'll follow the logs.
Have you looked into either of these?
Are you able to check if your output stream is getting closed before POI can
finish writing to it?
Do you have any logs to indicate what is happening on this platform?
Is this repeatable?
How many times are you writing out the workbook?
Are you able to write out the workbook to a ByteArrayOutputStream and then
write that BAOS to the desired OutputStream? This would help you figure out if
the problem is with POI or with the output stream getting closed unexpectedly.
class XLSXGenerator {
void writeTo(XSSFWorkbook workbook, OutputStream out) {
try (OutputStream baos = new ByteArrayOutputStream(8192)) {
try {
workbook.write(baos);
} finally {
workbook.close();
}
baos.writeTo(out);
}
}
}
--
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