Page 1 of 1

Exception when running the PPTX EditEmbeddedCharts Sample

PostPosted: Sat Jan 05, 2013 7:48 am
by cdobrem
I am currently using docx4j to handle creating docx files and it working very nicely. I am now needing to update an existing pptx slide deck replacing current chart data with new values.

I did a git clone the other day, built the source and then try to run the EditEmbeddedCharts java sample under pptx4j.

When doing so I am getting the following errors:

Code: Select all
javax.xml.bind.JAXBException: No JAXBElement has been created for this part, yet!
   at org.docx4j.openpackaging.parts.JaxbXmlPart.marshal(JaxbXmlPart.java:226)
   at org.docx4j.openpackaging.parts.JaxbXmlPart.marshal(JaxbXmlPart.java:202)
   at org.docx4j.openpackaging.io.SaveToZipFile.saveRawXmlPart(SaveToZipFile.java:246)
   at org.docx4j.openpackaging.io.SaveToZipFile.saveRawXmlPart(SaveToZipFile.java:195)
   at org.docx4j.openpackaging.io.SaveToZipFile.savePart(SaveToZipFile.java:419)
   at org.docx4j.openpackaging.io.SaveToZipFile.addPartsFromRelationships(SaveToZipFile.java:382)
   at org.docx4j.openpackaging.io.SaveToZipFile.save(SaveToZipFile.java:165)
   at org.pptx4j.samples.EditEmbeddedCharts.main(EditEmbeddedCharts.java:152)
org.docx4j.openpackaging.exceptions.Docx4JException: Failed to add parts from relationships of /
   at org.docx4j.openpackaging.io.SaveToZipFile.addPartsFromRelationships(SaveToZipFile.java:387)
   at org.docx4j.openpackaging.io.SaveToZipFile.save(SaveToZipFile.java:165)
   at org.pptx4j.samples.EditEmbeddedCharts.main(EditEmbeddedCharts.java:152)
Caused by: org.docx4j.openpackaging.exceptions.Docx4JException: Problem saving part xl/workbook.xml
   at org.docx4j.openpackaging.io.SaveToZipFile.saveRawXmlPart(SaveToZipFile.java:304)
   at org.docx4j.openpackaging.io.SaveToZipFile.saveRawXmlPart(SaveToZipFile.java:195)
   at org.docx4j.openpackaging.io.SaveToZipFile.savePart(SaveToZipFile.java:419)
   at org.docx4j.openpackaging.io.SaveToZipFile.addPartsFromRelationships(SaveToZipFile.java:382)
   ... 2 more
Caused by: javax.xml.bind.JAXBException: No JAXBElement has been created for this part, yet!
   at org.docx4j.openpackaging.parts.JaxbXmlPart.marshal(JaxbXmlPart.java:226)
   at org.docx4j.openpackaging.parts.JaxbXmlPart.marshal(JaxbXmlPart.java:202)
   at org.docx4j.openpackaging.io.SaveToZipFile.saveRawXmlPart(SaveToZipFile.java:246)
   ... 5 more
Exception in thread "main" org.docx4j.openpackaging.exceptions.Docx4JException: Failed to add parts from relationships of /
   at org.docx4j.openpackaging.io.SaveToZipFile.addPartsFromRelationships(SaveToZipFile.java:387)
   at org.docx4j.openpackaging.io.SaveToZipFile.save(SaveToZipFile.java:165)
   at org.pptx4j.samples.EditEmbeddedCharts.main(EditEmbeddedCharts.java:152)
Caused by: org.docx4j.openpackaging.exceptions.Docx4JException: Problem saving part xl/workbook.xml
   at org.docx4j.openpackaging.io.SaveToZipFile.saveRawXmlPart(SaveToZipFile.java:304)
   at org.docx4j.openpackaging.io.SaveToZipFile.saveRawXmlPart(SaveToZipFile.java:195)
   at org.docx4j.openpackaging.io.SaveToZipFile.savePart(SaveToZipFile.java:419)
   at org.docx4j.openpackaging.io.SaveToZipFile.addPartsFromRelationships(SaveToZipFile.java:382)
   ... 2 more
Caused by: javax.xml.bind.JAXBException: No JAXBElement has been created for this part, yet!
   at org.docx4j.openpackaging.parts.JaxbXmlPart.marshal(JaxbXmlPart.java:226)
   at org.docx4j.openpackaging.parts.JaxbXmlPart.marshal(JaxbXmlPart.java:202)
   at org.docx4j.openpackaging.io.SaveToZipFile.saveRawXmlPart(SaveToZipFile.java:246)
   ... 5 more

I was able to run the RoundTripTest program without any errors to verify that I built the library correctly.

Any insight as to a possible solution or workaround for this?

Thanks in Advance.

Re: Exception when running the PPTX EditEmbeddedCharts Sampl

PostPosted: Mon Jan 07, 2013 5:04 pm
by jason
If you update your sources from github now, it should work.

I had been doing some work recently to make loading/saving more flexible; you encountered a teething issue. Sorry about that!

Re: Exception when running the PPTX EditEmbeddedCharts Sampl

PostPosted: Thu Jan 10, 2013 7:09 am
by cdobrem
Jason,

Thanks, that example is now working.

I am not having another issue, but will be posting as a separate topic.

Regards.