Page 1 of 1

PDF Conversion docx4j and MOXy

PostPosted: Thu Feb 27, 2014 2:31 pm
by AlfDev
DOCX to PDF Conversion giving errors while using docx4j 3.0.0 , docx4j-MOXy-JAXBContext3.0.0 and org.eclipse.persistence.moxy2.5.1

ERROR [openpackaging.contenttype.ContentTypeManager] java.lang.ClassCastException: org.docx4j.openpackaging.contenttype.CTTypes cannot be cast to javax.xml.bind.JAXBElement
org.docx4j.openpackaging.exceptions.InvalidFormatException: Bad [Content_Types].xml
at org.docx4j.openpackaging.contenttype.ContentTypeManager.parseContentTypesFile(ContentTypeManager.java:691)
at org.docx4j.openpackaging.io.LoadFromZipNG.process(LoadFromZipNG.java:206)
at org.docx4j.openpackaging.io.LoadFromZipNG.get(LoadFromZipNG.java:193)
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:301)
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:245)
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:213)
at org.docx4j.openpackaging.packages.WordprocessingMLPackage.load(WordprocessingMLPackage.java:184)

Thoughts?

Re: PDF Conversion docx4j and MOXy

PostPosted: Thu Feb 27, 2014 4:05 pm
by jason
Are you sure you don't have an older docx4j on your classpath?

That doesn't look like a docx4j 3.0 error; see https://github.com/plutext/docx4j/commi ... 12e7208f79

Re: PDF Conversion docx4j and MOXy

PostPosted: Thu Feb 27, 2014 10:43 pm
by AlfDev
Thanks for your quick response.
I did clean my project setup and I got away that error , however the PDF conversion still fails,I enabled the log level to debug and here is the dump.
http://pastebin.com/gnSFg0zT

Appreciate your help on this.