Restful service built using spring mvc framework. The requirement is to send response to the client either in XML or JSON format depending upon the Accept HTTP header attribute value.
Works well when the response is in XML. Fails for JSON
string.
Stack trace:
=============================================================
org.codehaus.jackson.map.JsonMappingException: Could not get a
Java numeric typ
from a Schema complex type (through reference chain: com.dell.it.services.sdr.
esponse.dataservice.impl.DataServiceResponseDocumentImpl["dataServiceResponse"]
>com.dell.it.services.sdr.response.dataservice.impl.DataServiceResponseImpl["ap
plicationData"]->com.dell.it.services.sdr.response.dataservice.impl.Appplicatio
DataImpl["floatValue"])
at org.codehaus.jackson.map.JsonMappingException.wrapWithPath(JsonMappi
gException.java:218)
at org.codehaus.jackson.map.JsonMappingException.wrapWithPath(JsonMappi
gException.java:183)
at org.codehaus.jackson.map.ser.SerializerBase.wrapAndThrow(SerializerB
se.java:131)
at org.codehaus.jackson.map.ser.BeanSerializer.serializeFields(BeanSeri
lizer.java:183)
at org.codehaus.jackson.map.ser.BeanSerializer.serialize(BeanSerializer
java:142)
Truncated. see log file for complete stacktrace
Caused By: org.apache.xmlbeans.impl.values.XmlValueNotSupportedException: Could
not get a Java numeric type from a Schema complex type
at org.apache.xmlbeans.impl.values.XmlObjectBase.getBigDecimalValue(XmlO
bjectBase.java:1395)
at org.apache.xmlbeans.impl.values.XmlObjectBase.getFloatValue(XmlObject
Base.java:1391)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
Truncated. see log file for complete stacktrace
>
======================================================