Hi javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory can't work since the container uses jaxb as well (and cxf uses container loader and not app loader so it can't load it).
That's said moxy has a provider which should work for you no? MOXyJsonProvider Romain Manni-Bucau Twitter: @rmannibucau Blog: http://rmannibucau.wordpress.com/ LinkedIn: http://fr.linkedin.com/in/rmannibucau Github: https://github.com/rmannibucau 2014-09-11 12:19 GMT+02:00 Anthony Fryer <[email protected]>: > I have been trying to use moxy as the JAXBContext implementation in tomee and > have had some issues. I had the following war file... > > moxy-test.war > |-WEB-INF > |-lib > |-config-moxy.jar > |- META-INF > |- services > |-javax.xml.bind.JAXBContext > > The content of the javax.xml.bind.JAXBContext file is > "org.eclipse.persistence.jaxb.JAXBContextFactory" > > When i created a JAXBContext in my app, it was always creating an instance > of com.sun.xml.bind.v2.runtime.JAXBContextImpl. > > I tried setting the following in system.properties... > javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory > > but that also didn't work and still i was always getting an > com.sun.xml.bind.v2.runtime.JAXBContextImpl instance. > > Lastly i tried moving config-moxy.jar into tomee/lib and finally i started > getting instances of org.eclipse.persistence.jaxb.JAXBContext. > > Then i renamed config-moxy.jar to moxy-config.jar in tomee/lib and it > stopped working. That's when i looked at the jars packaged in tomee/lib and > found that jaxb-impl.jar has a META-INF/services/javax.xml.bind.JAXBContext > file with the content "com.sun.xml.bind.v2.ContextFactory" which was causing > all my JAXBContext instances to be of that type. I got lucky when i named > my file config-moxy.jar in tomee/lib because it came before jaxb-impl.jar > and configured moxy. > > I then deleted the META-INF/services folder from tomee/lib/jaxb-impl.jar and > tested my original war file which had the config-moxy.jar in WEB-INF/lib and > it started working. > > I was wondering, should jaxb-impl.jar have that > META-INF/services/javax.xml.bind.JAXBContext file? It makes it very > difficult to configure your own jaxb implementation from a war file. > > Also shouldn't the javax.xml.bind.context.factory system property override > any jar file configuration? > > Regards, > > Anthony > > > > > > -- > View this message in context: > http://tomee-openejb.979440.n4.nabble.com/tomee-and-moxy-tp4671723.html > Sent from the TomEE Users mailing list archive at Nabble.com.
