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

28,539

Solution 1

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

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

@JsonIgnoreProperties(ignoreUnknown=true)

Solution 2

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

Share:
28,539

Related videos on Youtube

Oliver.Oakley
Author by

Oliver.Oakley

Updated on July 30, 2020

Comments

  • Oliver.Oakley
    Oliver.Oakley over 3 years

    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.

Related