title: Jackson JsonMappingException: Can not deserialize instance of class out of START_ARRAY token
body: <p>Unable to read value of image arr. <strong>How can I read the value of Image arr using jackson json mapper .</strong></p>
  
  <p><strong>JSON</strong> </p>
  
  <pre><code>{
    query: "rann of kutch",
    response: {
      image: [
        "http://www.ouralaskancruise.com/wp-content/uploads/2010/05/Princess_Denali_Express_Rail.jpg"
      ],
      source: "chatbot",
      text: "Very interesting.",
      time: 5572
    },
    uid: "11222"
  }
  </code></pre>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>String responseJson = null;
              try {
                  responseJson = Utils.executeHttpGet(url);
              } catch (Exception e) {
  
                  if (e != null) {
                      error = e.getMessage();
                      e.printStackTrace();
                  }
  
              }
  </code></pre>
  
  <p><strong>Classes</strong></p>
  
  <pre><code>public class ResponseDetails {
  
      public String query;
      public String uid;
      public Response response;
  
  }
  public class Response {
      public Image image;
      public String source;
      public String text;
      public long time;
  
  }
  public class Image {
      public ArrayList&lt;String&gt; urls;
  //public    String url;
  }
  </code></pre>
  
  <p><strong>Exception:</strong></p>
  
  <pre><code>11-07 18:48:34.321: W/System.err(15921): com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of com.Travel.TravelChat.DataClasses.Image out of START_ARRAY token
  11-07 18:48:34.321: W/System.err(15921):  at [Source: java.io.StringReader@417fbc70; line: 4, column: 5] (through reference chain: com.Travel.TravelChat.DataClasses.ResponseDetails["response"]-&gt;com.Travel.TravelChat.DataClasses.Response["image"])
  11-07 18:48:34.341: W/System.err(15921):    at com.fasterxml.jackson.databind.DeserializationContext.mappingException(DeserializationContext.java:575)
  11-07 18:48:34.341: W/System.err(15921):    at com.fasterxml.jackson.databind.DeserializationContext.mappingException(DeserializationContext.java:569)
  11-07 18:48:34.341: W/System.err(15921):    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromArray(BeanDeserializerBase.java:1121)
  11-07 18:48:34.341: W/System.err(15921):    at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:148)
  11-07 18:48:34.341: W/System.err(15921):    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:123)
  11-07 18:48:34.341: W/System.err(15921):    at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:464)
  11-07 18:48:34.341: W/System.err(15921):    at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:107)
  11-07 18:48:34.341: W/System.err(15921):    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:295)
  11-07 18:48:34.341: W/System.err(15921):    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:121)
  11-07 18:48:34.341: W/System.err(15921):    at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:464)
  11-07 18:48:34.341: W/System.err(15921):    at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:107)
  11-07 18:48:34.341: W/System.err(15921):    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:295)
  11-07 18:48:34.341: W/System.err(15921):    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:121)
  11-07 18:48:34.341: W/System.err(15921):    at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2888)
  11-07 18:48:34.341: W/System.err(15921):    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2034)
  11-07 18:48:34.341: W/System.err(15921):    at com.Travel.TravelChat.Helpers.Utils.readResponseDetailsJson(Utils.java:97)
  11-07 18:48:34.341: W/System.err(15921):    at com.Travel.TravelChat.Helpers.GetResponseTask.doInBackground(GetResponseTask.java:46)
  11-07 18:48:34.341: W/System.err(15921):    at com.Travel.TravelChat.Helpers.GetResponseTask.doInBackground(GetResponseTask.java:1)
  11-07 18:48:34.341: W/System.err(15921):    at android.os.AsyncTask$2.call(AsyncTask.java:264)
  11-07 18:48:34.341: W/System.err(15921):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
  11-07 18:48:34.341: W/System.err(15921):    at java.util.concurrent.FutureTask.run(FutureTask.java:137)
  11-07 18:48:34.341: W/System.err(15921):    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:208)
  11-07 18:48:34.341: W/System.err(15921):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
  11-07 18:48:34.341: W/System.err(15921):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
  11-07 18:48:34.341: W/System.err(15921):    at java.lang.Thread.run(Thread.java:856)
  11-07 18:48:34.341: W/dalvikvm(15921): threadid=11: thread exiting with uncaught exception (group=0x40c18a68)
  11-07 18:48:34.351: E/AndroidRuntime(15921): FATAL EXCEPTION: AsyncTask #1
  </code></pre>
  
  <p>I have gone through the following links :
  <a href="https://stackoverflow.com/questions/19333106/jsonmappingexception-out-of-start-array-token">JsonMappingException: out of START_ARRAY token</a></p>
  
  <p><a href="https://stackoverflow.com/questions/10719729/cannot-deserialize-instance-of-object-out-of-start-array-token-in-spring-3-rest">Cannot deserialize instance of object out of START_ARRAY token in Spring 3 REST Webservice</a></p>
  
  <p>Please help .</p>
  
  <p>Thanks!</p>