I will see it, thanks! Diana
On Fri, Feb 22, 2013 at 4:56 PM, Sergey Beryozkin <[email protected]>wrote: > On 22/02/13 15:49, allam-di wrote: > >> 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<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. >> > > Me neither... Have a look at Glen's example, he worked awhile back on > converting some of Jersey example to CXF: > https://github.com/gmazza/**jersey-samples-on-cxf/tree/** > master/moxy-oxm-mapping<https://github.com/gmazza/jersey-samples-on-cxf/tree/master/moxy-oxm-mapping> > > or may be try > > > JAXBContext jc = JAXBContextFactory.**createContext(new Class[] > {type}, null); > > Sergey > > > 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<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<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. >> > > > -- > Sergey Beryozkin > > Talend Community Coders > http://coders.talend.com/ > > Blog: http://sberyozkin.blogspot.com >
