Cannot deserialize instance of object out of START_ARRAY token in Spring 3 REST Webservice

You should map it to List<Consultant> rather than to Consultant.class.


Solution in a similar situation was to map to Consultant[].class This applies if you try to deserialize a JSON array of your mapped objects.


This is related to Jackson and the way you're attempting to deserialize and initialize a container from an array.

While my usage context is a bit different, this may help some who get here from searching for Jackson-specific deserialization errors.

I had to do it like this:

List<Consultant> consultants = Arrays.asList(
    mapper.readValue(myJson.toString(), Consultants[].class)
);