THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||||
---|---|---|---|---|
| ||||
import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.ws.rs.ext.ContextResolver; import org.eclipse.persistence.jaxb.JAXBContextFactory; public class MoxyJaxbContextResolved implements ContextResolver<JAXBContext> { org.eclipse.persistence.jaxb.JAXBContextFactory factory = new JAXBContextFactory(); public JAXBContext getContext(Class<?> cls) { try { return factoryJAXBContextFactory.createContext(new Class[] {cls}, null); } catch (JAXBException ex) { throw new RuntimeException(ex); } } } |
Alternatively, add a "jaxb.properties" file with the entry "javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory" to a package where JAXB beans are located.
...