-
Sep 2nd, 2011, 01:59 AM
#1
conversion from xmlbean object to json string fails
controller file
@RequestMapping(method=RequestMethod.GET, value="/assets/{content}", headers="Accept=application/xml, application/json")
public @ResponseBody DataServiceResponseDocument getAssets(@PathVariable String content) throws XmlException, IOException{
DataServiceRequestDocument dataServiceRequestDoc = null;
// other code details in here to send the request object to Coherence layer and get the responsse object.
System.out.println(dataServiceResponseDoc.toString ()); //prints correctly
return dataServiceResponseDoc;
}
spring config file
<bean class="org.springframework.web.servlet.mvc.annotat ion.AnnotationMethodHandlerAdapter">
<property name="messageConverters">
<ref bean="jsonHttpMessageConverter"/>
</property>
</bean>
<bean id="jsonHttpMessageConverter"
class="org.springframework.http.converter.json.Map pingJacksonHttpMessageConverter">
<property name="prefixJson" value="false" />
<property name="supportedMediaTypes" value="application/json" />
</bean>
Runtime error
org.codehaus.jackson.map.JsonMappingException: Could not get a Java numeric type from a Schema complex type (through reference chain: com.dell.it.services.sdr.response.dataservice.impl .DataServiceResponseDocumentImpl["dataServiceResponse"]->com.dell.it.services.sdr.response.dataservice. impl.DataServiceResponseTypeImpl["appplicationData"]->com.dell.it.services.sdr.response.dataservice. impl.AppplicationDataTypeImpl["floatValue"])
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules