Jackson错误:Can not deserialize instance of java.lang.String out of START_OBJECT token

org.springframework.http.converter.HttpMessageNotReadableException: Could not read JSON: Can not deserialize instance of java.lang.String out of START_OBJECT token
 at [Source: org.apache.http.conn.EofSensorInputStream@42b0f150; line: 1, column: 112] (through reference chain: com.webservice.net.model.GetAffairNewsListResponse["list"]->com.webservice.net.model.AffairNewsList["publishTime"]); 

nested exception is org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of java.lang.String out of START_OBJECT token

 at [Source: org.apache.http.conn.EofSensorInputStream@42b0f150; line: 1, column: 112] (through reference chain: com.webservice.net.model.GetAffairNewsListResponse["list"]->com.webservice.net.model.AffairNewsList["publishTime"])

出现上述错误的原因是,我再接收前端的参数的时候,没有按照正确的方式进行接收,前端给我的是一个json格式字符串,而我接收的是一个数组,所以才会出现上面的异常

 

上一篇:《剑指Offer》37. 序列化二叉树


下一篇:二叉树的序列化与反序列化