title: Spring mvc , Could not read JSON: Can not deserialize instance of java.util.Vector out of START_OBJECT token
body: <p>Ok, im trying to receive this kind of JSON</p>
  
  <pre><code>[{"username":"pippo","password":"bla"},{"username":"pluto","password":"bla"},{"username":"topolino","password":"bla"}]
  </code></pre>
  
  <p>But i receive this error:</p>
  
  <pre><code>    Resolving exception from handler [public void sequenziatore.server.presenter.LoginController.CheckLogin(java.util.Vector&lt;sequenziatore.server.presenter.Utente&gt;)]: org.springframework.http.converter.HttpMessageNotReadableException: Could not read JSON: Can not deserialize instance of java.util.Vector out of START_OBJECT token
   at [Source: org.apache.catalina.connector.CoyoteInputStream@68c40ef9; line: 1, column: 1]; nested exception is org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of java.util.Vector out of START_OBJECT token
   at [Source: org.apache.catalina.connector.CoyoteInputStream@68c40ef9; line: 1, column: 1]
  Resolving exception from handler [public void sequenziatore.server.presenter.LoginController.CheckLogin(java.util.Vector&lt;sequenziatore.server.presenter.Utente&gt;)]: org.springframework.http.converter.HttpMessageNotReadableException: Could not read JSON: Can not deserialize instance of java.util.Vector out of START_OBJECT token
   at [Source: org.apache.catalina.connector.CoyoteInputStream@68c40ef9; line: 1, column: 1]; nested exception is org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of java.util.Vector out of START_OBJECT token
   at [Source: org.apache.catalina.connector.CoyoteInputStream@68c40ef9; line: 1, column: 1]
  Resolving exception from handler [public void sequenziatore.server.presenter.LoginController.CheckLogin(java.util.Vector&lt;sequenziatore.server.presenter.Utente&gt;)]: org.springframework.http.converter.HttpMessageNotReadableException: Could not read JSON: Can not deserialize instance of java.util.Vector out of START_OBJECT token
   at [Source: org.apache.catalina.connector.CoyoteInputStream@68c40ef9; line: 1, column: 1]; nested exception is org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of java.util.Vector out of START_OBJECT token
   at [Source: org.apache.catalina.connector.CoyoteInputStream@68c40ef9; line: 1, column: 1]
  </code></pre>
  
  <p>And this is the controller that im using :</p>
  
  <pre><code>@Controller
  @RequestMapping(value = "/login")
  public class LoginController {
      @RequestMapping(method=RequestMethod.POST, consumes = "application/json", produces = "application/json")
      @ResponseBody
      public void CheckLogin(@RequestBody Vector&lt;Utente&gt; vec) {
      .....
      }
  </code></pre>
  
  <p>I tried to change the type that i receive with Utente[] instead of Vector but nothing changed, and the real problem is that i don t understand what the error is...
  This is the JSON that i receive if i change the receiving type in String and print it...</p>
  
  <pre><code>{"0":{"username":"pippo","password":"bla"},"1":{"username":"pluto","password":"bla"},"2":{"username":"topolino","password":"bla"}}
  </code></pre>
  
  <p>This is the class Utente</p>
  
  <pre><code>public class Utente {
      private String username=null;
      private String password=null;
  
      public String getUsername() {
          return username;
      }
      public void setUsername(String username) {
          this.username = username;
      }
      public String getPassword() {
          return password;
      }
      public void setPassword(String password) {
          this.password = password;
      }
      public Utente(){}
  }
  </code></pre>