I have a project where I want to work with a set of Classes generated by JAXB from an XSD. With these classes I would like to marshall/unmarshall from XML and JSON.
<You need to make sure the jaxb.properties
file is under the resources directory in the same package structure as the corresponding model classes.
Example
Example, in maven the java class
src\main\java\com\example\sitemap\generate\domain
and the file jaxb.properties
src\main\resources\com\example\sitemap\generate\domain\jaxb.properties
Use it as a System property, if it is cumbersome to add jaxb.properties files for each and every java packages where JAXB pojo classes are present.
System.setProperty("javax.xml.bind.JAXBContextFactory", "org.eclipse.persistence.jaxb.JAXBContextFactory");