title: org.json.JSONException: JSONObject["properties"] not found
body: <p>I am new to programming and am trying to read massages from Kafka as a whole String and convert them into a JSON object (Array) and then access each element in the JSON Array to extract the values. But it is giving me the following error:</p>
  <p><strong>org.json.JSONException: JSONObject[&quot;properties&quot;] not found.</strong></p>
  <p><strong>Here is my JSON Array:</strong>
  Please note that I have multiple JSON arrays like this which is why I am looping them all to iterate this process and put them each in a separate JSON Object.</p>
  <pre><code>{&quot;type&quot;: &quot;FeatureCollection&quot;, &quot;features&quot;: [{&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;STATIONS_ID&quot;: 662, &quot;MESS_DATUM&quot;: 202204120000, &quot;RWS_DAU_10&quot;: 0, &quot;RWS_10&quot;: 0.0, &quot;RWS_IND_10&quot;: 0}, &quot;geometry&quot;: {&quot;type&quot;: &quot;Point&quot;, &quot;coordinates&quot;: [10.516667, 52.266666]}}]}
  </code></pre>
  <p>This is my code:</p>
  <pre><code>// input massages from a Kafka topic
  JSONObject json_obj = new JSONObject(valueFromKafka); 
  // Access to the JSON Array element &quot;features&quot;
  JSONArray jsonFeatures =  (JSONArray) objJsonObject.getJSONArray(&quot;features&quot;);
  
  // for anhanced loop to iterate this process
  for (Object feature_obj : jsonFeatures) {
  JSONObject feature = new JSONObject(feature_obj);
  
  // access and get values from the JSON Array
  Long STATIONS_ID = feature.getJSONObject(&quot;properties&quot;).getLong(&quot;STATIONS_ID&quot;);
  Long MESS_DATUM = feature.getJSONObject(&quot;properties&quot;).getLong(&quot;MESS_DATUM&quot;);
  Double RWS_DAU_10 = feature.getJSONObject(&quot;properties&quot;).getDouble(&quot;RWS_DAU_10&quot;);
  Long RWS_IND_10 = feature.getJSONObject(&quot;properties&quot;).getLong(&quot;RWS_IND_10&quot;);
  Float RWS_10 = feature.getJSONObject(&quot;properties&quot;).getFloat(&quot;RWS_10&quot;);
  JSONArray coordJson = feature.getJSONObject(&quot;properties&quot;).getJSONObject(&quot;geometry&quot;).getJSONArray(&quot;coordinates&quot;);
  String pointWKT = &quot;POINT(&quot; + coordJson.getFloat(0) + &quot; &quot; + coordJson.getFloat(1) + &quot;)&quot;;
  </code></pre>