title: org.json.JSONException: A JSONArray text must start with '[' at 1 [character 2 line 1] - how to solve?
body: <p><strong>JsonArray Is:</strong></p>
  
  <pre><code>{
    "list": [
      {
        "name": abc,
        "start_date": "2017-5-18 0:30:00",
        "end_date": "2017-6-1 0:30:00",
        "start_address": "Gujarat 380060, India",
        "end_address": "Ognaj, Ahmedabad, Gujarat, India"
      },
      {
        "name": pqr,
        "start_date": "2017-5-18 0:30:00",
        "end_date": "2017-6-1 0:30:00",
        "start_address": "Gujarat 380060, India",
        "end_address": "Ognaj, Ahmedabad, Gujarat, India"
      }
    ]
  }
  </code></pre>
  
  <p>java code using springBoot is bellow</p>
  
  <blockquote>
    <p>@RequestMapping(value = "/addabc", method = RequestMethod.POST)</p>
    
    <p>@CrossOrigin<br>
    public Map addabc(@RequestBody String
    data,             HttpServletRequest request) {</p>
    
    <p>JSONArray jsonArray=new JSONArray(data);</p>
    
    <p>try{</p>
  
  <pre><code>for(int i=0; i &lt; jsonArray.length(); i++) {
    JSONObject jsonobject = jsonArray.getJSONObject(i); 
     ......
     ......
  
  }   
  </code></pre>
    
    <p>}catch (Exception e) { ...
    }</p>
  </blockquote>
  
  <p><strong>Getting exception is:-</strong></p>
  
  <pre><code>org.json.JSONException: A JSONArray text must start with '[' at 1 [character 2 line 1]
      at org.json.JSONTokener.syntaxError(JSONTokener.java:433) ~[json-20140107.jar:na]
      at org.json.JSONArray.&lt;init&gt;(JSONArray.java:105) ~[json-20140107.jar:na]
      at org.json.JSONArray.&lt;init&gt;(JSONArray.java:144) ~[json-20140107.jar:na]
      at com.abc.io.controller.abcController.addabc(abcController.java:214) ~[classes/:na]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_111]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_111]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_111]
      at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_111]
      at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
      at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
      at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
      at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:832) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
      at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:743) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
      at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(Abstract.......
  </code></pre>
  
  <p>when i convert json array into JSONArray class then getting exception. How can i handle json array to JSONArray.</p>