Page 1 of 1


PostPosted: Mon Nov 05, 2012 8:59 pm
by jason
As of now, docx4j in GitHub can easily be made to use MOXy ( ) as its JAXB implementation.

There are a few longstanding issues with the Sun/Oracle JAXB in Java 6/7:

Hopefully MOXy doesn't suffer from these deficiencies. In any case, the MOXy guys have been really responsive so far (via StackOverflow), so I'm confident they'd help with any issues we uncover.

To use MOXy as your JAXB implementation
# 1. in pom.xml, uncomment the org.eclipse.persistence.moxy dependency, and the EclipseLink Repo
# 2. run ant JAXB-use-MOXy

To switch back to the Oracle / reference implementation
# 1. run ant JAXB-switch-from-MOXy-to-Oracle
# 2. in pom.xml, comment those things again

If you are successfully using MOXy, your logs should contain:

Code: Select all
INFO org.docx4j.jaxb.Context .<clinit> line 70 - MOXy JAXB implementation intended..
INFO org.docx4j.jaxb.Context .<clinit> line 102 - loading Context jc
INFO org.docx4j.jaxb.Context .<clinit> line 112 - loaded org.eclipse.persistence.jaxb.JAXBContext .. loading others ..
INFO org.docx4j.jaxb.Context .<clinit> line 115 - MOXy is being used.

Another way to try using MOXy is to download it from and use ... 121106.jar

I tried it with:
Code: Select all
         +- org.eclipse.persistence:org.eclipse.persistence.moxy:jar:2.4.1
         |  +- org.eclipse.persistence:org.eclipse.persistence.core:jar:2.4.1
         |  |  \- org.eclipse.persistence:org.eclipse.persistence.asm:jar:3.3.1.v201206041142
         |  \- org.eclipse.persistence:org.eclipse.persistence.antlr:jar:3.2.0.v201206041011      

I'm thinking the next release of docx4j will be designated 3.0, to make it easy to know the point at which MOXy support was offered.

Feedback welcome.

Re: MOXy!

PostPosted: Tue Nov 06, 2012 11:45 am
by jason
Hmmm, see ... ong-object

Please wait until this issue is addressed before trying it out!

Re: MOXy!

PostPosted: Tue Nov 06, 2012 10:19 pm
by bdoughan
We're very happy to see docx4j using MOXy. I came across the corresponding issue on Stack Overflow and haven't been able to reproduce the results. I have posted an answer that contains what I have tried so far. Could someone take a look at it and help me refine the test case?



Blaise Doughan
Team Lead, EclipseLink MOXy

Re: MOXy!

PostPosted: Wed Nov 07, 2012 1:13 pm
by jason
Hi Blaise

Thanks for taking an interest in what we're doing.

I've updated the question on SO with a test case based on yours, which exhibits the issue.

cheers .. Jason

Re: MOXy!

PostPosted: Thu Nov 08, 2012 5:33 am
by bdoughan
Hi Jason,

We have been able to reproduce the error you are seeing in EclipseLink 2.4.1. We have not been able to reproduce the issue in the EclipseLink 2.4.2 or 2.5.0 streams. I would recommend downloading the latest 2.4.2 nightly build and trying it out:


We are still investigating this issue to ensure that it is truly fixed.


Re: MOXy!

PostPosted: Wed Oct 09, 2013 10:33 am
by jason
To enable MOXy in docx4j 3, you need:

1. the relevant EclipseLink jars
2. docx4j-MOXy-JAXBContext-3.0.0.jar (which just contains the files)

The files just say:


If you are using maven, you'll just need to add:


docx4j-MOXy-JAXBContext isn't in Maven Central quite yet; get it from ... -3.0.0.jar

Re: MOXy!

PostPosted: Wed Nov 27, 2013 7:46 am
by jason
Its in Maven Central now (along with docx4j v3); see

Re: MOXy!

PostPosted: Tue Dec 29, 2015 12:13 am
by PUE
Does Java 8 also suffer from those issues?