title: Spring @RequestBody: the request sent by the client was syntactically incorrect
body: <p>Hi everyone this is my first question here, hope you can help me with this issue I'm having right now.</p>
  
  <p>I want to send a JSON Object using JQuery to a Spring Controller.
  The format of the JSON Object is as follows:</p>
  
  <pre><code>{"ssoArray":["21212", "231341"], "groupArray":["g10002", "g10003"]}
  </code></pre>
  
  <p>But I got the error message:  <strong>the request sent by the client was syntactically incorrect</strong></p>
  
  <p>My Environment:</p>
  
  <ul>
  <li>Spring 3.0.6</li>
  <li>jackson 1.9.13</li>
  <li>JBoss 4.2</li>
  </ul>
  
  <p>JQuery code:
  <strong>Update:</strong> Added the full code of the javascript method that makes the ajax call</p>
  
  <pre><code>function addRemoveAdmin(action, ssoArray, groupArray) {
      var uri = actionPath + "/";
      var jsonParameter = {"ssoArray":ssoArray, "groupArray":groupArray};
  
      if(action == "add") {
          uri = uri + addAdminAction;
      } else {
          uri = uri + removeAdminAction;
      }               
  
      console.log(typeof jsonParameter);
  
      $.ajax({
          url:uri,
          type:"POST",
          data:jsonParameter,
          contentType:"application/json; charset=utf-8",
          dataType:"json",
          success: function(){
              alert(data);
          }
      });
  }
  </code></pre>
  
  <p>Controller code:</p>
  
  <pre><code>@RequestMapping(value = "/addAdmin", method = RequestMethod.POST)
  public String addAdmin(@RequestBody final AdminAndGroup personsAndGroups) throws Exception {
      LOGGER.info("[RequestController] - addAdmin start");
  
      LOGGER.info(personsAndGroups.toString());
  
      return "OK";
  }
  </code></pre>
  
  <p>Mapping class:</p>
  
  <pre><code>public class AdminAndGroup implements Serializable {
  
  private static final long serialVersionUID = 9024455757311860269L;
  
  private List&lt;String&gt; ssoArray;
  private List&lt;String&gt; groupArray;
  
  public AdminAndGroup(){}
  
  public List&lt;String&gt; getSsoArray() {
      return ssoArray;
  }
  public void setSsoArray(List&lt;String&gt; ssoArray) {
      this.ssoArray = ssoArray;
  }
  public List&lt;String&gt; getGroupArray() {
      return groupArray;
  }
  public void setGroupArray(List&lt;String&gt; groupArray) {
      this.groupArray = groupArray;
  }
  
  @Override
  public String toString() {
      return "AdminAndGroup [ssoArray=" + ssoArray + ", groupArray="
              + groupArray + "]";
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I have used java.util.List to map the arrays that come inside the JSON Object but I'm not sure if this is the right way to tackle the issue.</p>
  
  <p>Also I have searched in Stack Overflow and I haven't found an example on how to map arrays inside a JSON Object.</p>
  
  <p>Thanks in advance.</p>