the exception: java.lang.ClassNotFoundException: org.eclipse.persistence.jaxb.JAXBContextFactory is due to the fact that MOXY needs to create a jax.properties file in the same package(s) as the domain objects and put the following inside it: javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory
In order to let cxf knows about org.eclipse.persistence.jaxb.JAXBContextFactory, I followed the discussion at: http://cxf.547215.n5.nabble.com/How-to-configure-CXF-to-use-different-JAXBContextFactory-td5281773.html My above code is conform to what is said in this discussion to let cxf knows about this missed class, but it doesn't work and I don't have any idea about the reason. However, I tested MOXY Jaxb without a service method context (without integrating it to cxf), by following the example at: http://blog.bdoughan.com/2010/07/moxy-jaxb-map-interfaces-to-xml.html and it works perfectly. Normally, my above code, must also work because I tried to do a similar thing to what is done in this example. I created a similar ObjectFactory class and I added it to the JAXB context by adding @XmlSeeAlso({MyObjectFactory}) at the beginning of my service interface which must be equivalent to : JAXBContext jaxbContext = JAXBContext.newInstance(ObjectFactory.class); Regards, Diana -- View this message in context: http://cxf.547215.n5.nabble.com/How-to-configure-cxf-to-use-MOXY-Jaxb-for-RESTful-tp5723506p5723586.html Sent from the cxf-user mailing list archive at Nabble.com.
