I am bit confused with MOXy and need some help.
We are using docx4j for converting xhtml to docx.
While I was playing around with xhtml import, I got this exception javax.xml.bind.JAXBException: JAXB: neither Reference Implementation nor Java 6 implementation present?
I am using java 7 and 8, so I have no idea how it could happen that jaxb from jre not found. Probably some class loading issue. Our application runs as an osgi bundle. (I am not an osgi expert, just scratching the surface.)
So I decided to give MOXy a try and added the dependencies to pom.xml. My understanding is that if I change to MOXy, It should not look for RI, or jre jaxb implementations at all.
Now I am still getting this exception but from different calls. I could localize 2 call chains:
one is when converting the html to wml objcets. (Called mainly for logging)
Here is the stack trace:
- Code: Select all
at org.docx4j.XmlUtils.marshaltoString(XmlUtils.java:783)
at org.docx4j.XmlUtils.marshaltoString(XmlUtils.java:666)
at org.docx4j.convert.in.xhtml.XHTMLImporterImpl.addParagraphProperties(XHTMLImporterImpl.java:2257)
at org.docx4j.convert.in.xhtml.XHTMLImporterImpl.populatePPr(XHTMLImporterImpl.java:1501)
at org.docx4j.convert.in.xhtml.XHTMLImporterImpl.getPPr(XHTMLImporterImpl.java:1452)
at org.docx4j.convert.in.xhtml.XHTMLImporterImpl.traverse(XHTMLImporterImpl.java:1204)
at org.docx4j.convert.in.xhtml.XHTMLImporterImpl.traverse(XHTMLImporterImpl.java:800)
at org.docx4j.convert.in.xhtml.XHTMLImporterImpl.convert(XHTMLImporterImpl.java:483)
The other is when saving the docx file calling wordMLPackage.save(file) (After commenting out the previous logging statements).
stack trace:
- Code: Select all
at org.docx4j.jaxb.NamespacePrefixMapperUtils.getPrefixMapper(NamespacePrefixMapperUtils.java:46)
at org.docx4j.openpackaging.contenttype.ContentTypeManager.marshal(ContentTypeManager.java:829)
at org.docx4j.openpackaging.io3.stores.ZipPartStore.saveContentTypes(ZipPartStore.java:213)
at org.docx4j.openpackaging.io3.Save.save(Save.java:176)
at org.docx4j.openpackaging.packages.OpcPackage.save(OpcPackage.java:693)
at org.docx4j.openpackaging.packages.OpcPackage.save(OpcPackage.java:582)
at org.docx4j.openpackaging.packages.OpcPackage.save(OpcPackage.java:565)
at org.docx4j.openpackaging.packages.OpcPackage.save(OpcPackage.java:554)
I assume if using MOXy, NamespacePrefixMapperUtils.getPrefixMapper() should not be called, or handle MOXy as well. Is it correct?
Could you please help if I misconfigured something?
Do you have any idea how to work around this issue?
Thanks in advance,
László