zoukankan      html  css  js  c++  java
  • 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"])

    遇到这样的错误,主要是服务器数据和客户端数据类型不一致,这里遇到的publishTime数据类型,服务器是datetime型,而我客户端数据是String型,就会导致这样的错误,调成一致即可。

  • 相关阅读:
    IOS:兼容ios6和低版本
    iOS开发~sizeClass和autolayout
    iOS开发~即时通讯工具参考的一些开源框架和教程
    移动开发网站导航
    mac工具总结
    推送总结(重要)
    IOS常用学习网站和博客
    iOS~静态库开发
    iOS~视频开发
    iOS~视频编码转换
  • 原文地址:https://www.cnblogs.com/EasonJim/p/8275383.html
Copyright © 2011-2022 走看看