简体   繁体   中英

org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field “id” (Class Criteria), not marked as ignorable

I am getting this exception when I am trying to parse Json to Java pojo object. The object graph has couple objects.

org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "id" (Class Criteria), not marked as ignorable

I wanted to see, in which case this exception will come, where could be the problem is it in the object graph??

I am doing this in my android project I am not using annotations here I am not sure how to add this field as ignorable.

You don't show any code, so...

Anyway, try and add this annotation to the class you deserialize:

@JsonIgnoreProperties(ignoreUnknown=true)

This will also happen if you have defined the field in your POJO, but do not have a getter AND setter methods defined. Ignoring the field may have unintended consequences.

This does look to be a duplicate of: Jackson with JSON: Unrecognized field, not marked as ignorable

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM