title: Jackson Json Object mapper : how to map an array?
body: <p>I am trying to map an array from a backend api call. How can I map this data knowing that :</p>
  
  <p>the following classes will be used to hold the json array data :</p>
  
  <pre><code>    @Data
      private static class UserListBean {
          private List&lt;UserBean&gt; userList;
      }
  
      @Data
      private static class UserBean {
          private String id;
          private String userName;
          private String password;
      }
  </code></pre>
  
  <p>the json will have the following format (the following example just have one item in it) :</p>
  
  <pre><code>[
     {
        "id":1,
        "userName":"bob",
        "password":"403437d5c3f70b1329f37a9ecce02adbbf3e986"
     }
  ]
  </code></pre>
  
  <p>I am using Jackson and I have tried the following so far but it keeps sending me back an exception</p>
  
  <pre><code>        final ObjectMapper mapper = new ObjectMapper();
          mapper.configure(Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
          final ObjectReader reader = mapper.reader(UserListBean.class);
          GeoHubAccountListBean accounts = null;
  
          try {
              accounts = reader.readValue(jsonString);
          } catch (final IOException ex) {
              log.error("Cannot convert JSON into a list of users", ex);
          }
  </code></pre>
  
  <p>Here the <strong>final ObjectReader reader = mapper.reader(UserListBean.class);</strong> throws an exception</p>
  
  <pre><code>Can not deserialize instance of com.xxx.XXX$UserListBean out of START_ARRAY token
  </code></pre>
  
  <p>Any idea ?</p>
  
  <p>thanks</p>