title: Error: JSONObject["result"] is not a JSONObject
body: <p>I am fetching a JSONObject "result" from the following JSONObject:</p>
  
  <pre><code>{
      "success" : true,
      "message" : "",
      "result" : {
              "uuid" : "e606d53c-8d70-11e3-94b5-425861b86ab6"
          }
  }
  </code></pre>
  
  <p>I am using this code:</p>
  
  <pre><code>    CloseableHttpClient httpclient = HttpClients.createDefault();
      String url = "some url";
      HttpGet httpget20 = new HttpGet(url);
      httpget20.setHeader("apisign",buildHmacSignature(url, apisecret));
        try (   CloseableHttpResponse response2 = httpclient.execute(httpget20)){
          HttpEntity entity = response2.getEntity();
          JSONObject obj2 = new JSONObject(EntityUtils.toString(entity));
          JSONObject result = obj2.getJSONObject("result");
  </code></pre>
  
  <p><code>obj2</code> is the whole json object including "success", "message" and "result".
  However, this line of code generates the following error message:</p>
  
  <pre><code>Exception in thread "AWT-EventQueue-0" org.json.JSONException: JSONObject["result"] is not a JSONObject.
  </code></pre>
  
  <p>I am not sure how a JSONObject can not be a JSONObject. Can someone explain the problem here?</p>