title: JSONObject["user_birthday"] not a string
body: <p>Sorry for the repeated problem but I didn't found the answer on google.
  I am trying to parse json to an object of setter/getter class.</p>
  
  <pre><code>public ArrayList&lt;User&gt; getArrayList(StringBuffer jsonReceived){
      ArrayList&lt;User&gt; userArrayList = new ArrayList&lt;User&gt;();
      JSONObject json = new JSONObject(jsonReceived.toString());
      JSONArray userTable = json.getJSONArray("user");
      for (int i = 0; i &lt; userTable.length(); i++) {
          User user = new User();
          user.setId(userTable.getJSONObject(i).getInt("user_id"));
          user.setLastName(userTable.getJSONObject(i).getString("user_last_name"));
          user.setFirstName(userTable.getJSONObject(i).getString("user_first_name"));
          user.setEmail(userTable.getJSONObject(i).getString("user_email"));
          System.out.println(userTable.getJSONObject(i).getString("user_birthday"));
          String dateStr = userTable.getJSONObject(i).getString("user_birthday");
          SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
          try {
              Date birthDate = sdf.parse(dateStr);
              user.setBirthday(birthDate);
          } catch (ParseException e) {
              e.printStackTrace();
          }
          user.setCountry(userTable.getJSONObject(i).getString("user_country"));
          user.setCity(userTable.getJSONObject(i).getString("user_city"));
          userArrayList.add(user);
      }
      System.out.println("la list d'utilisateurs : "+userTable.toString());
      System.out.println("ArrayList : "+userArrayList.toString());
      return userArrayList;
  }
  </code></pre>
  
  <p>Here mon json string user :</p>
  
  <pre><code>{
  "tag": "getUsers",
  "success": 1,
  "error": 0,
  "user": [
      {
          "user_id": "1",
          "user_last_name": "Alain",
          "user_first_name": "Ron",
          "user_birthday": "2014-02-01",
          "user_email": "alain@ron.fr",
          "user_country": "",
          "user_city": ""
      },
      {
          "user_id": "2",
          "user_last_name": "Rodrigues",
          "user_first_name": "Richard",
          "user_birthday": null,
          "user_email": "richard@r.fr",
          "user_country": null,
          "user_city": null
      }
  ]}
  </code></pre>
  
  <p>and my error log is :</p>
  
  <blockquote>
    <p>Exception in thread "AWT-EventQueue-0" org.json.JSONException: JSONObject["user_birthday"] not a string.
        at org.json.JSONObject.getString(JSONObject.java:661)
        at fr.moveo.applicationlourde.services.AbstractMethods.getArrayList(AbstractMethods.java:50)
        at fr.moveo.applicationlourde.Views.frames.WindowConnexion.actionPerformed(WindowConnexion.java:75)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2346)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)</p>
  </blockquote>
  
  <p>I have tried all the methods I found in the first and the second page of google but it didn't work....</p>