Bug 63888 - Error creating PPTX when a slide contains more than a charts inside
Summary: Error creating PPTX when a slide contains more than a charts inside
Alias: None
Product: POI
Classification: Unclassified
Component: XDDF (show other bugs)
Version: 4.1.1-FINAL
Hardware: PC Linux
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2019-10-28 13:11 UTC by Cesare Mauri
Modified: 2019-12-02 00:23 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Cesare Mauri 2019-10-28 13:11:51 UTC
After modifiing data in a slide than contains more than one chart an exception is thrown because excel name is not unique.
Original template contains:
and so on, but after processing numbering is lost:

org.apache.poi.openxml4j.exceptions.PartAlreadyExistsException: A part with the name '/ppt/embeddings/Microsoft_Excel_Worksheet0.xlsx' already exists : Packages shall not contain equivalent part names and package implementers shall neither create nor recognize packages with equivalent part names. [M1.12]

	at org.apache.poi.openxml4j.opc.OPCPackage.createPart(OPCPackage.java:830)
	at org.apache.poi.openxml4j.opc.OPCPackage.createPart(OPCPackage.java:793)
	at org.apache.poi.ooxml.POIXMLDocumentPart.createRelationship(POIXMLDocumentPart.java:583)
	at org.apache.poi.xddf.usermodel.chart.XDDFChart.createRelationshipInChart(XDDFChart.java:675)
	at org.apache.poi.xddf.usermodel.chart.XDDFChart.createWorksheetPart(XDDFChart.java:694)
	at org.apache.poi.xddf.usermodel.chart.XDDFChart.saveWorkbook(XDDFChart.java:715)
	at org.apache.poi.xddf.usermodel.chart.XDDFChart.commit(XDDFChart.java:826)
	at org.apache.poi.ooxml.POIXMLDocumentPart.onSave(POIXMLDocumentPart.java:463)
	at org.apache.poi.ooxml.POIXMLDocumentPart.onSave(POIXMLDocumentPart.java:468)
	at org.apache.poi.ooxml.POIXMLDocumentPart.onSave(POIXMLDocumentPart.java:468)
	at org.apache.poi.ooxml.POIXMLDocument.write(POIXMLDocument.java:236)
Comment 1 Cesare Mauri 2019-10-28 13:17:35 UTC
Note: I started from a pptx created from openoffice, if I make the same from a msoffice file the problem doesn't occur but final file is corrupted (openoffice opens it but msoffice not)

http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/BarChartDemo.java present the same problem (corrupted pptx file when template is saved and than opened from msoffice)
Comment 2 Alain Fagot Bearez 2019-12-02 00:23:21 UTC
fixed by r1870696