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

Posted Jim

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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: [email protected]; 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: [email protected]; line: 1, column: 112] (through reference chain: com.webservice.net.model.GetAffairNewsListResponse["list"]->com.webservice.net.model.AffairNewsList["publishTime"])

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

以上是关于Jackson错误:Can not deserialize instance of java.lang.String out of START_OBJECT token的主要内容,如果未能解决你的问题,请参考以下文章

Spring Mvc使用Jackson进行json转对象时,遇到的字符串转日期的异常处理(JSON parse error: Can not deserialize value of type jav

spring cloud中微服务调用出现 Can not parse date while it seems to fit format 'yyyy-MM-dd'T'HH:mm

WinINet InternetGetProxyInfo:错误 1003 ERROR_CAN_NOT_COMPLETE

由于“Module not found: Error: Can't resolve”错误,Webpack 突然无法编译

出现编译错误 Can not load Mysql.pm in @INC

Intelj IDEA的pom.xml显示错误can not reconnect