title: net.sf.json.JSONException: JSONObject["geonames"] is not a JSONArray
body: <p>I am trying to pull data from json sample url <a href="http://api.geonames.org/citiesJSON?north=44.1&amp;south=-9.9&amp;east=-22.4&amp;west=55.2&amp;lang=de&amp;username=demo" rel="nofollow noreferrer">http://api.geonames.org/citiesJSON?north=44.1&amp;south=-9.9&amp;east=-22.4&amp;west=55.2&amp;lang=de&amp;username=demo</a> via HTTP transformation and then using java transformation to parse it.</p>
  
  <p>In java transformation i am giving below code:</p>
  
  <pre><code>    //converting the input stream HTTPOUT into JSON object   
  
      JSONObject json = (JSONObject) JSONSerializer.toJSON(HTTPOUT);   
  
      //Initializing JSON Array 'geonames'    
  
      JSONArray  geonames  = json.getJSONArray("geonames");   
  
      //Looping through all the Array objects   
  
      for (int i = 0; i &lt; geonames.size(); ++i) {
  
          //Getting JSON Objects from the Array
  
          JSONObject geoname = geonames.getJSONObject(i);
  
          String lng = geoname.getString("lng");
          lngOUT=lng;
          String geonameId = geoname.getString("geonameId");
          geonameIdOUT=geonameId;
          String countrycode = geoname.getString("countrycode");
          countrycodeOUT=countrycode;
          String name = geoname.getString("name");
          nameOUT=name;
  
      // Generating rows in informatica 
  
        generateRow();  
      }
  </code></pre>
  
  <p>List of jar files:</p>
  
  <pre><code>commons-io-2.4.jar;
  commons-logging-1.2.jar;
  commons-lang-2.6.jar;
  commons-beanutils-1.9.2.jar;
  json-lib-2.4-jdk15.jar;
  ezmorph-1.0.6.jar;
  commons-lang3-3.1.jar;
  commons-collections-3.2.1.jar;
  commons-beanutils-1.8.0.jar
  </code></pre>
  
  <p>In Import packages section I have given below packages.</p>
  
  <pre><code>    import java.io.InputStream;
      import java.lang.String;
      import net.sf.json.JSONObject;
      import net.sf.json.JSONArray;
      import net.sf.json.JSONSerializer;
  </code></pre>
  
  <p>In java class path I have mentioned all the external jar files used.
  ETL job is getting failed for below error:</p>
  
  <pre><code>Message Code: JAVA PLUGIN_1762
  Message: [ERROR] net.sf.json.JSONException: JSONObject["geonames"] is not a JSONArray.at net.sf.json.JSONObject.getJSONArray(JSONObject.java:2038)
  at com.informatica.powercenter.server.jtx.JTXPartitionDriverImplGen.execute(JTXPartitionDriverImplGen.java:161)
  </code></pre>