Use Moxy to implement JAXB by default

To use Moxy as a JAXB implementation, you need to add a file called jaxb.properties to the application domain class folder and include the following line

javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory 

Is it possible to make moxy the default for a project? In case I have many different folders with annotated domain classes, in which folder should I put this file?

+8
json xml jaxb moxy
source share
1 answer

Note. I am EclipseLink JAXB (MOXy) and a member of JAXB (JSR-222) .

MOXy is already the default implementation of JAXB in WebLogic 12.1.1:

In other environments, you can also use the META-INF/services mechanism to specify MOXy as the default JAXB provider:

  • Create a JAR containing a file named javax.xml.bind.JAXBContext in the META-INF/services
  • The contents of the javax.xml.bind.JAXBContext file must be org.eclipse.persistence.jaxb.JAXBContextFactory
  • Add this jar to your class path.
+12
source share

All Articles