title: Why am I getting a JsonSyntaxException: Expected BEGIN_ARRAY but was STRING here?
body: <p>I have one JSON file:</p>
  
  <pre><code>{
  "settings": {
      "header": {
          "id": "240A64CDC43F",
          "filename": "network",
          "sequence": "0",
          "last_modified": "2015-04-21T16:33",
          "JSON_file_version": "2.1"
      },
      "data": {
          "engine_config": {
              "bed_name": "IdealTempCDC43F",
              "provisioned": "false",
              "connected": "false",
              "IP_address": "192.168.10.1",
              "connection_error": "None"
          },
          "networks": {
              "available": "7",
              "SSIDs": {
                  "wireless_1": {
                      "SSID": "$$ASI_WIFI$$",
                      "mac_address": "A0:EC:F9:11:35:04",
                      "channel": "11",
                      "RSSI": "-64dBm",
                      "security": "true",
                      "security_type": "WPA"
                  },
                  "wireless_2": {
                      "SSID": "$$ASI_GUEST$$",
                      "mac_address": "A0:EC:F9:11:35:02",
                      "channel": "11",
                      "RSSI": "-65dBm",
                      "security": "true",
                      "security_type": "WPA"
                  }
              }
          }
      }
  }
  }
  </code></pre>
  
  <p>For parsing this json I am using this:</p>
  
  <pre><code>HttpResponse response = client.execute(request); 
  String strResponse = response.toString();
  parseJSON(strResponse);
  </code></pre>
  
  <p>and </p>
  
  <pre><code>public void parseJSON(String jsonString) {
    Gson gsonParser = new Gson();
    ProveQuerySetting gsonResponse = new ProveQuerySetting();
    Type collectionType = new TypeToken&lt;Collection&lt;ProveQuerySetting&gt;&gt;() {
    }.getType();
    gsonResponse = gsonParser.fromJson(jsonString, collectionType);
    String str = gsonParser.toJson(gsonResponse);
    System.out.println(" final json " + str);
  }
  </code></pre>
  
  <p>But I am getting this exception:</p>
  
  <pre><code>04-21 07:08:13.864: W/System.err(4187): com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $
  04-21 07:08:13.864: W/System.err(4187): com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $
  04-21 07:08:13.865: W/System.err(4187):     at com.google.gson.Gson.fromJson(Gson.java:822)
  04-21 07:08:13.865: W/System.err(4187):     at com.google.gson.Gson.fromJson(Gson.java:775)
  04-21 07:08:13.865: W/System.err(4187):     at com.google.gson.Gson.fromJson(Gson.java:724)
  04-21 07:08:13.865: W/System.err(4187):     at com.easi.main.network.NetworkCom.parseJSON(NetworkCom.java:127)
  04-21 07:08:13.865: W/System.err(4187):     at com.easi.main.network.NetworkCom.sendFirst(NetworkCom.java:50)
  04-21 07:08:13.865: W/System.err(4187):     at com.easi.main.setting.ConnectToBox$MyAsyncTask.doInBackground(ConnectToBox.java:89)
  04-21 07:08:13.865: W/System.err(4187):     at com.easi.main.setting.ConnectToBox$MyAsyncTask.doInBackground(ConnectToBox.java:1)
  04-21 07:08:13.865: W/System.err(4187):     at android.os.AsyncTask$2.call(AsyncTask.java:288)
  04-21 07:08:13.865: W/System.err(4187):     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
  04-21 07:08:13.865: W/System.err(4187):     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
  04-21 07:08:13.865: W/System.err(4187):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
  04-21 07:08:13.865: W/System.err(4187):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
  04-21 07:08:13.865: W/System.err(4187):     at java.lang.Thread.run(Thread.java:818)
  04-21 07:08:13.865: W/System.err(4187): Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $
  04-21 07:08:13.865: W/System.err(4187):     at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:350)
  04-21 07:08:13.866: W/System.err(4187):     at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:79)
  04-21 07:08:13.866: W/System.err(4187):     at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:60)
  04-21 07:08:13.866: W/System.err(4187):     at com.google.gson.Gson.fromJson(Gson.java:810)
  04-21 07:08:13.866: W/System.err(4187):     ... 12 more
  </code></pre>
  
  <p>Here is my POJO class:</p>
  
  <pre><code>public class ProveQuerySetting {
    ProvQueryData provEngnData;
    ProvQueryHeader provEngnhHeader;
  
    public ProvQueryData getProvEngnData() {
      return provEngnData;
    }
  
    public void setProvEngnData(ProvQueryData provEngnData) {
      this.provEngnData = provEngnData;
    }
  
    public ProvQueryHeader getProvEngnhHeader() {
      return provEngnhHeader;
    }
  
    public void setProvEngnhHeader(ProvQueryHeader provEngnhHeader) {
      this.provEngnhHeader = provEngnhHeader;
    }
  }
  </code></pre>
  
  <p>Why I am getting this exception?</p>