Announcement Announcement Module
No announcement yet.
Deserialization Problem from Json to Model Class Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Deserialization Problem from Json to Model Class

    I have created one application with Spring3 mvc,Hibernate3

    My configuration in Spring-servlet.xml, I have configured Json and JacksonMessageBean

    class="org.springframework.web.servlet.view.Conten tNegotiatingViewResolver">
    <property name="mediaTypes">
    <entry key="atom" value="application/atom+xml" />
    <entry key="html" value="text/html" />
    <entry key="json" value="application/json" />
    <property name="viewResolvers">
    <bean class="org.springframework.web.servlet.view.UrlBas edViewResolver">
    <property name="viewClass"
    value="org.springframework.web.servlet.view.JstlVi ew" />
    <property name="prefix" value="/WEB-INF/jsp/" />
    <property name="suffix" value=".jsp" />
    <property name="defaultViews">
    <bean class="org.springframework.web.servlet.view.json.M appingJacksonJsonView" />
    <bean class="org.springframework.web.servlet.mvc.annotat ion.AnnotationMethodHandlerAdapter">
    <property name="messageConverters">
    <bean id="jsonConverter" class="org.springframework.http.converter.json.Map pingJacksonHttpMessageConverter"/>

    I have used
    • jackson-core-asl-1.4.2.jar
    • jackson-mapper-asl-1.4.2.jar
    jars for configuration


    my POJO class

    public class DevicePolling implements Serializable{

    public Integer getId() {
    return id;

    public void setId(Integer id) { = id;

    public DeviceMaster getDeviceID() {
    return deviceID;

    public void setDeviceID(DeviceMaster deviceID) {
    this.deviceID = deviceID;

    public double getLattitude() {
    return lattitude;

    public void setLattitude(double lattitude) {
    this.lattitude = lattitude;

    public double getLongitude() {
    return longitude;

    public void setLongitude(double longitude) {
    this.longitude = longitude;
    public Date getPollingTime() {
    return pollingTime;

    public void setPollingTime(Date pollingTime) {
    this.pollingTime = pollingTime;

    private static final long serialVersionUID = -7227603185161812526L;

    private Integer id;

    @ManyToOne(cascade={CascadeType.ALL,CascadeType.ME RGE})
    private DeviceMaster deviceID;

    private double lattitude;

    private double longitude;

    private Date pollingTime;


    I have many to one relationship in this POJO..
    with URL I have passed json


    and I got the Error like

    10:35:10,032 DEBUG DispatcherServlet:696 - Could not complete request Can not deserialize instance of DeviceMaster
    out of VALUE_STRING token

    Is there any configuration missing? What should I do to solve this exception?