Announcement Announcement Module
Collapse
No announcement yet.
conversion from xmlbean object to json string fails Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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[&quot;dataServiceResponse&quot;]-&gt;com.dell.it.services.sdr.response.dataservice. impl.DataServiceResponseTypeImpl[&quot;appplicationData&quot;]-&gt;com.dell.it.services.sdr.response.dataservice. impl.AppplicationDataTypeImpl[&quot;floatValue&quot;])
Working...
X