Can not deserialize instance of my.package.name.PlaceData[] out of START_OBJECT token

Thunder Dragon

I have been trying to deserialize a json stirng. Do not understand where is the problem. It is throwing-

org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of my.package.name.PlaceData[] out of START_OBJECT token
 at [Source: java.io.StringReader@1fea1293; line: 1, column: 1]

My JSON string (placesData) is

    {
      "d":[
        {
          "__type":"my.package.name.PlaceData",
          "Id":1212,
          "Name":"Delhi",
          "MeetingId":1211,
          "Sessions":[]
        },
        {
          "__type":"my.package.name.PlaceData",
          "Id":8787,
          "Name":"Bangalore",
          "MeetingId":1211,
          "SessionNames":[]
        }
      ]
    }

Java object is-

public class PlaceData  {
    public String __type;
    public Integer Id;
    public String Name;
    public Integer MeetingId;
    public SessionData[] sessionData=new SessionData[0];

    public PlaceData() {
    }

    @Override
    public String toString() {
        return "PlaceData{" +
                "__type='" + __type + '\'' +
                ", Id=" + Id +
                ", Name='" + Name + '\'' +
                ", MeetingId=" + MeetingId +
                ", SessionData=" + Arrays.toString(SessionData) +
                '}';
    } }

Deserialization code-

ObjectMapper mapper = new ObjectMapper();
List<PlaceData> placesList = Arrays.asList(mapper.readValue(placesData, PlaceData[].class));

Any clue??

Patrick Grimard

It looks like you're deserializing an object rather than an array. The START_OBJECT token refers to the opening { bracket. You're actual data is accessible from propert 'd' of that object.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Can not deserialize instance of my package out of START_ARRAY token

From Dev

JSON deserialization throwing exception - Can not deserialize instance of java.util.ArrayList out of START_OBJECT token

From Java

Can not deserialize instance of java.util.ArrayList out of START_OBJECT token

From Dev

Could not read JSON: Can not deserialize instance of hello.Country[] out of START_OBJECT token

From Dev

JsonMappingException: Can not deserialize instance of java.lang.Integer out of START_OBJECT token

From Dev

Exception: Can not deserialize instance of java.util.ArrayList out of START_OBJECT token at

From Dev

JsonMappingException: Can not deserialize instance of java.lang.Integer out of START_OBJECT token

From Dev

JsonMappingException: Can not deserialize instance of java.util.List out of START_OBJECT token

From Dev

Exception: "org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of java.lang.String out of START_OBJECT token"

From Dev

jsonMappingException org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of java.util.ArrayList out of START_OBJECT token at

From Dev

Can not deserialize instance of Object out of START_ARRAY token

From Dev

Can not deserialize instance of Object out of START_ARRAY token

From Dev

AWS Can not deserialize instance of java.lang.String out of START_OBJECT

From Dev

Can not deserialize instance of JsonGen out of START_ARRAY token : newbee

From Dev

Can not deserialize instance of SaleListDTO out of START_ARRAY token

From Dev

Java REST API: Can not deserialize instance of Object out of START_ARRAY token

From Dev

com.fasterxml.jackson.databind.exc.MismatchedInputException: Can not deserialize instance of object out of START_ARRAY token

From Dev

Convert JSON to Object throws JsonMappingException "Can not deserialize instance of class out of START_ARRAY token"

From Dev

Java REST API: Can not deserialize instance of Object out of START_ARRAY token

From Dev

Can not deserialize instance of java.util.HashMap out of START_ARRAY token

From Dev

Json Mapping Exception can not deserialize instance out of START_ARRAY token

From Dev

Ignore the "Can not deserialize instance of java.util.LinkedHashMap out of START_ARRAY token" error

From Java

com.fasterxml.jackson.databind.exc.MismatchedInputException: Can not deserialize instance of object out of START_ARRAY token - JAVA

From Dev

com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of org.springframework.data.domain.Sort out of START_ARRAY token

From Dev

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

From Dev

com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of Object out of START_ARRAY token

From Dev

ObjectMapper fails to deserialize - cannot deserialize instance of .... out of START_ARRAY token

From Dev

Jackson Can not deserialize instance of java.util.ArrayList out of VALUE_STRING token

From Java

Jackson error: Cannot deserialize instance of `java.lang.String` out of START_ARRAY token

Related Related

  1. 1

    Can not deserialize instance of my package out of START_ARRAY token

  2. 2

    JSON deserialization throwing exception - Can not deserialize instance of java.util.ArrayList out of START_OBJECT token

  3. 3

    Can not deserialize instance of java.util.ArrayList out of START_OBJECT token

  4. 4

    Could not read JSON: Can not deserialize instance of hello.Country[] out of START_OBJECT token

  5. 5

    JsonMappingException: Can not deserialize instance of java.lang.Integer out of START_OBJECT token

  6. 6

    Exception: Can not deserialize instance of java.util.ArrayList out of START_OBJECT token at

  7. 7

    JsonMappingException: Can not deserialize instance of java.lang.Integer out of START_OBJECT token

  8. 8

    JsonMappingException: Can not deserialize instance of java.util.List out of START_OBJECT token

  9. 9

    Exception: "org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of java.lang.String out of START_OBJECT token"

  10. 10

    jsonMappingException org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of java.util.ArrayList out of START_OBJECT token at

  11. 11

    Can not deserialize instance of Object out of START_ARRAY token

  12. 12

    Can not deserialize instance of Object out of START_ARRAY token

  13. 13

    AWS Can not deserialize instance of java.lang.String out of START_OBJECT

  14. 14

    Can not deserialize instance of JsonGen out of START_ARRAY token : newbee

  15. 15

    Can not deserialize instance of SaleListDTO out of START_ARRAY token

  16. 16

    Java REST API: Can not deserialize instance of Object out of START_ARRAY token

  17. 17

    com.fasterxml.jackson.databind.exc.MismatchedInputException: Can not deserialize instance of object out of START_ARRAY token

  18. 18

    Convert JSON to Object throws JsonMappingException "Can not deserialize instance of class out of START_ARRAY token"

  19. 19

    Java REST API: Can not deserialize instance of Object out of START_ARRAY token

  20. 20

    Can not deserialize instance of java.util.HashMap out of START_ARRAY token

  21. 21

    Json Mapping Exception can not deserialize instance out of START_ARRAY token

  22. 22

    Ignore the "Can not deserialize instance of java.util.LinkedHashMap out of START_ARRAY token" error

  23. 23

    com.fasterxml.jackson.databind.exc.MismatchedInputException: Can not deserialize instance of object out of START_ARRAY token - JAVA

  24. 24

    com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of org.springframework.data.domain.Sort out of START_ARRAY token

  25. 25

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

  26. 26

    com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of Object out of START_ARRAY token

  27. 27

    ObjectMapper fails to deserialize - cannot deserialize instance of .... out of START_ARRAY token

  28. 28

    Jackson Can not deserialize instance of java.util.ArrayList out of VALUE_STRING token

  29. 29

    Jackson error: Cannot deserialize instance of `java.lang.String` out of START_ARRAY token

HotTag

Archive