It seems as though I have already done this once in the past, but I cannot find any reference to what I had done to get it to work.
I have a web application in which
Note: I'm the EclipseLink JAXB (MOXy) lead and a member of the JAXB 2 (JSR-222) expert group.
To specify a JAXB (JSR-222) implementation other than the default you need to include a file called jaxb.properties
in the same package as your domain classes. The following is an example of the jaxb.properties
file used to specify the MOXy implementation of JAXB:
javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory
For More Information
It is possible to load JAXB implementation from a specific library using the Java Endorsed Standards Override Mechanism. This is also suggested in the guide Using JAXB 2.1/2.2 with JavaSE 6.
Alternatively, in your application server you may modify the class-loader policy for your application to parent last so that classes are first looked up in the libraries bundled with your application before being searched in JRE.