Summary: | Updating excel file opended with OPCPackage throws: OpenXML4JRuntimeException: Rule M2.4 exception | ||
---|---|---|---|
Product: | POI | Reporter: | raja <cbenagaraj86> |
Component: | XSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED DUPLICATE | ||
Severity: | blocker | ||
Priority: | P2 | ||
Version: | 3.16-FINAL | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All | ||
Attachments: |
ExcelFileUpdateExample1.java
inputfile |
Description
raja
2018-01-10 13:30:41 UTC
Created attachment 35670 [details]
inputfile
Take care about the order you are closing the resources: FileOutputStream outputStream = new FileOutputStream("JavaBooks.xlsx"); workbook.write(outputStream); outputStream.close(); workbook.close(); //inputStream.close(); pkg.close(); Otherwise you are trying to write into a package (document) that has been closed. This is a classical duplicate of https://bz.apache.org/bugzilla/show_bug.cgi?id=60102 |