See this section:
http://cxf.apache.org/docs/jax-rs-data-bindings.html#JAX-RSDataBindings-Jettison
Sergey
On 09/12/11 17:42, Jeff Wang wrote:
So you mean I should remove the writeXsiType false setting, and set up
the xs namespace on the client-side? Or is there another namespace
that I should be using?
I'm using CXF 2.4.2 and Jettison 1.3
thanks
Jeff
On Fri, Dec 9, 2011 at 9:20 AM, Sergey Beryozkin<[email protected]> wrote:
On 09/12/11 17:08, Jeff Wang wrote:
On Fri, Dec 9, 2011 at 8:56 AM, Jeff Wang<[email protected]> wrote:
Exception : 116916 [http-bio-8080-exec-4] WARN
org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper -
WebApplicationException has been caught :
com.sun.org.apache.xerces.internal.dom.ElementNSImpl cannot be cast to
java.lang.Long
Aha! with writeXsiType to false on the server side, I got the full
stack trace on the client side:
Caused by: java.lang.ClassCastException:
com.sun.org.apache.xerces.internal.dom.ElementNSImpl cannot be cast to
java.lang.Long
at com.myapp.data.User.setId(User.java:1)
at
com.myapp.data.Base$JaxbAccessorM_getId_setId_java_lang_Object.set(MethodAccessor_Ref.java:56)
at
com.sun.xml.bind.v2.runtime.reflect.Accessor.receive(Accessor.java:173)
<snip a bunch more xml bind stacks...>
at
org.apache.cxf.jaxrs.provider.JSONProvider.readFrom(JSONProvider.java:197)
Please set up a JSON namespace map on the receiving side; by the way this
exception seems vaguely familiar to me, it may have been fixed in Jettison
1.3, which CXF version do you work with ?
Cheers, Sergey
thanks,
Jeff
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com