您的位置:首页 > 移动开发 > Objective-C

使用objectMapper.readValue(json, City.class);报错com.fasterxml.jackson.databind.JsonMappingException

2018-02-06 16:42 387 查看
错误信息:com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of com.boot.es.mybootes.bean.City: no suitable constructor found, can not deserialize from Object value (missing default constructor or creator, or perhaps need to add/enable type information?)at [Source: {"cityname":"杭州","id":1}; line: 1, column: 2]解决:
public City(){}
需要在bean类中添加无参构造函数

                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐