Summary: | CTBarChart org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException | ||
---|---|---|---|
Product: | POI | Reporter: | dengyf <yongfeid> |
Component: | XSLF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED DUPLICATE | ||
Severity: | enhancement | ||
Priority: | P2 | ||
Version: | 3.14-FINAL | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows NT | ||
Attachments: |
CTBarChar use ooxml-schemas-1.1.jar
simplified unit test simplified unit test |
Description
dengyf
2016-07-06 08:12:35 UTC
What version of POI are you using? Could you try this again with ooxml-schemas-1.3, making sure to delete any duplicate ooxml-schemas and poi-ooxml-schemas on your classpath? https://poi.apache.org/faq.html#faq-N10025 Created attachment 34015 [details]
simplified unit test
I cut your example down to the attached unit test.
The source of the problem is in getChartFromTitle. You're opening the slideshow, creating an XSLFChart object, and closing the slideshow. Then you're passing the XSLFChart object that belongs to the closed slideshow back to updateBarChartTemplate.
Naturally, once you've closed a resource, any subsequent operations performed on that resource are likely to fail.
Perhaps we could give a more informative error message here, like "could not access package part output stream because the underlying document has been closed.
Created attachment 34016 [details]
simplified unit test
Set to enhancement as original problem is explained by closing the Slideshow too early and only some improved error reporting is remaining to be done. |