Announcement Announcement Module
No announcement yet.
Exception while receiving List<Object> in Json (Andorid platform) Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exception while receiving List<Object> in Json (Andorid platform)

    Below is my rest service,

    1) @ResponseBody UserDetails getUserDetails(); and my UserDetails class is
    class UserDetails {
    String userName;
    // getters and setters;
    I can able to retrieve the UserDetails in android without any issues.

    Now I have modified my rest service to
    @ResponseBody UserCollections getUserDetails(); and my UserCollections class is

    class UserCollections {
    List<UserDetails> userDetailsList;
    //getters and setters;

    Now i am getting the following exception

    Caused by: Can not deserialize instance of java.util.List out of START_OBJECT token
    at [Source: [email protected] ; line: 1, column: 2] (through reference chain: com.application.user.models.UserCollections ["userDetailsList"])
    at ontext.mappingException(StdDeserializationContext. java:198)
    at zer.handleNonArray( )
    at zer.deserialize(
    at zer.deserialize(

    Any idea to solve this error ?

    I am using MappingJacksonHttpMessageConverter for conversion.