Can not deserialize instance of java.lang.String out of START_OBJECT token
2015-11-21 14:31
661 查看
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.combanc.jxhd.webservice.net.model.GetAffairNewsListResponse["list"]->com.combanc.jxhd.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.combanc.jxhd.webservice.net.model.GetAffairNewsListResponse["list"]->com.combanc.jxhd.webservice.net.model.AffairNewsList["publishTime"])
遇到这样的错误,主要是服务器数据和客户端数据类型不一致,如我这里遇到的publishTime数据类型,服务器是date型,而我客户端数据是String型,就会导致这样的错误,调成一致就好了。
at [Source: org.apache.http.conn.EofSensorInputStream@42b0f150; line: 1, column: 112] (through reference chain: com.combanc.jxhd.webservice.net.model.GetAffairNewsListResponse["list"]->com.combanc.jxhd.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.combanc.jxhd.webservice.net.model.GetAffairNewsListResponse["list"]->com.combanc.jxhd.webservice.net.model.AffairNewsList["publishTime"])
遇到这样的错误,主要是服务器数据和客户端数据类型不一致,如我这里遇到的publishTime数据类型,服务器是date型,而我客户端数据是String型,就会导致这样的错误,调成一致就好了。
相关文章推荐
- Objective-C 的属性与合成方法使用详解
- object-UI之基本控件
- object-UI之基本控件
- Objective-c单例模式的正确写法
- Objective-C加强-block代码块和protocol协议
- iOS开发系列—Objective-C之Foundation框架
- iOS开发系列—Objective-C之内存管理
- iOS开发系列--Objective-C之KVC、KVO
- iOS开发系列--Objective-C之协议、代码块、分类
- Objective-C中对IPhone设备震动的调用
- Object-c学习之自定义视图
- Object-c学习之自定义视图
- Python中QuerySet和Objects类
- iOS应用开发最佳实践:编写高质量的Objective-C代码
- Foundation框架之NSString和NSArray
- Objective-C加强-内存管理
- Block 技巧与底层解析
- 在Xcode 7上直接使用Address Sanitizer
- objective-c 算法积累
- Objective-C关联引用