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

Reply via email to