title: Can not deserialize instance of model.* out of START_ARRAY token\n at
body: <p>I make traning REST service and now I try to add new item.</p>
  
  <p>model Message:</p>
  
  <pre><code>@Entity
  @Table(name="message")
  public class Message{
  
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      @Column(name = "ID")
      private long id;
      @Column(name = "MESSAGE")
      private String message;
      @Column(name = "AUTHOR")
      private String author;
      @Column(name = "CREATED")
      @Temporal(TemporalType.DATE)
      private Date created;
  
      public Message() {}
  
      public Message(Long id, String message, String author) {
          this.id = id;
          this.message = message;
          this.author = author;
          this.created = new Date();
      }
  + getters / setters
  </code></pre>
  
  <p>MessageController:</p>
  
  <pre><code>@RestController
  public class MessageController {
  
      @Autowired
      private MessageRepository messageRepository;
  
      @RequestMapping(
          value = "/api/messages",
          method = RequestMethod.POST,
          consumes = MediaType.APPLICATION_JSON_VALUE,
          produces = MediaType.APPLICATION_JSON_VALUE)
      public ResponseEntity&lt;?&gt; addMessage(@RequestBody Message newMessage) {
          return new ResponseEntity&lt;&gt;(messageRepository.save(newMessage), HttpStatus.CREATED);
      }
  }
  </code></pre>
  
  <p>Error:</p>
  
  <blockquote>
    <p>2016-11-06 10:52:53.857 WARN 1100 --- [nio-8080-exec-1]
    .w.s.m.s.DefaultHandlerExceptionResolver : Failed to read HTTP
    message:
    org.springframework.http.converter.HttpMessageNotReadableException:
    Could not read document: Can not deserialize instance of
    com.sttech.springrest.model.Message out of START_ARRAY token at
    [Source: java.io.PushbackInputStream@6ccdce8a; line: 1, column: 1];
    nested exception is
    com.fasterxml.jackson.databind.JsonMappingException: Can not
    deserialize instance of com.sttech.springrest.model.Message out of
    START_ARRAY token at [Source: java.io.PushbackInputStream@6ccdce8a;
    line: 1, column: 1]</p>
  </blockquote>
  
  <p>Through Postman I send new data in json and get Postman answer</p>
  
  <pre><code>[
    {
      "message": "Hello World1",
      "author": "ABC"
    }
  ]
  </code></pre>
  
  <blockquote>
    <p>"exception":
    "org.springframework.http.converter.HttpMessageNotReadableException",
    "message": "Could not read document: Can not deserialize instance of
    com.sttech.springrest.model.Message out of START_ARRAY token\n at
    [Source: java.io.PushbackInputStream@6ccdce8a; line: 1, column: 1];
    nested exception is
    com.fasterxml.jackson.databind.JsonMappingException: Can not
    deserialize instance of com.sttech.springrest.model.Message out of
    START_ARRAY token\n at [Source: java.io.PushbackInputStream@6ccdce8a;
    line: 1, column: 1]"</p>
  </blockquote>
  
  <p>How to fix it? I think the model does't get id.</p>