Ok, I think I have this solved now.

The RT.jar exposes javax.xml.bind ( which must not be the version expected
by CXF ). 

Since I needed to include org.apache.servicemix.jaxws-api-2.2 to satisfy
dependencies in cxf-dosgi-ri-dsw-cxf, I also needed to include
org.apache.servicemix.specs.jaxb-api-2.2 because of a hard dependency on the
javax.xml.bind version it exposes. Again, this was to get it working from a
run configuration in Eclipse. 

Ultimately, two javax.xml.bind were exposed on the classpath. The one
provided by the rt.jar was interfering. I had gotten this cxf / jettison
configuration to work in a Virgo Kernal installation as well. It would only
work if I removed the javax.xml.bind entries from the java6server.profile
file.

What I did to fix this in my Eclipse project, was first I had to change my
jsonProvider bean definition to the following:

<bean id="jsonProvider"
class="org.apache.cxf.jaxrs.provider.json.JSONProvider" >               
                <property name="singleJaxbContext" value="true" />              
        
                <property name="marshallAsJaxbElement" value="true"/>
                <property name="unmarshallAsJaxbElement" value="true" />        
        
</bean> 


Next, I had to add the following to the Imported Packages in Manifest of the
bundle containing the above Spring config AND in the bundle containing my
POJO's using the JAXB annotations:

javax.xml.bind(2.2.1) 
javax.xml.bind.annotation(2.2.1)
javax.xml.bind.util(2.2.1)

Finally, I could call my Restful service through the FireFox rest client and
I received the Object back in json form. I still need to do some more
testing by integrating the rest of my application, but I am cautiously
optimistic.

Hope this helps.

Neil




--
View this message in context: 
http://cxf.547215.n5.nabble.com/JaxRs-Yet-another-Unmarshall-Marshall-issue-with-CXF-2-7-2-tp5729213p5729285.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to