The jaxb.properties needs to be in the same package as the domain classes you are creating the JAXBContext on.
I am using Moxy’s xml driven configuration since I doesn’t want to use annotations or XJC generated objects. I have an existing domain classes that are spread across multiple packages. Does this mean that i need to have the jaxb.properties present in all those packages or there is a better alternative (Maybe writing my own implementation of some interface that can read from a jvm arg or something)?
If you are creating your
JAXBContexton classes, then you need to have ajaxb.propertiesfile in at least one of the packages of the domain classes passed in. In the example below you could have ajaxb.propertiesfile in eitherpackage1orpackage2.If you are creating your
JAXBContexton package names, then you need to have ajaxb.propertiesfiles in at least one of the packages. Note that packages are separated by a ‘:’.My preference is to use the standard JAXB APIs with a
jaxb.propertiesfile to specify MOXy as the JAXB provider. Some people prefer using the native MOXy APIs to do this:For More Information