Hi
On 24/01/12 14:24, hdave wrote:
I'd like to use MOXy for XML marshalling and unmarshalling in CXF because I
need some of their extensions to JAXB.
There documentation says 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
But I cannot find anything in the CXF documentation (or the JAXB 2.1 spec)
about this "jaxb.properties" file and so I conclude it will not be honored.
In any event, I'd prefer to create and configure the ContextFactory via
Spring. Currently, my CXF configuration looks like this:
<jaxrs:server id="myAppSvcRest" address="/rest">
<jaxrs:serviceBeans>
<ref bean="fooService" />
<ref bean="barService" />
</jaxrs:serviceBeans>
<jaxrs:providers>
<ref bean="jsonProvider" />
</jaxrs:providers>
<jaxrs:features>
<cxf:logging />
</jaxrs:features>
</jaxrs:server>
Any idea how I go about telling CXF to use my JAXBContextFactory?
You probably need to register (within the jaxrs:providers)
a custom ContextResolver<JAXBContext> implementation which would load
org.eclipse.persistence.jaxb.JAXBContextFactory and will delegate to it
on all the ContextResolver calls
Give it a try please
Cheers, Sergey
--
View this message in context:
http://cxf.547215.n5.nabble.com/How-to-configure-CXF-to-use-different-JAXBContextFactory-tp5281773p5281773.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