title: Spring: Type definition error when posting a new object using a REST service
body: <p>I have an object which gets two parameters through a json POST request to create a new entry in the database and I get this error:</p>
  
  <blockquote>
    <p>"Type definition error: [simple type, class
    ffuentese.rest_example.Persona]; nested exception is
    com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot
    construct instance of <code>ffuentese.rest_example.Persona</code> (no Creators,
    like default construct, exist): cannot deserialize from Object value
    (no delegate- or property-based Creator) at [Source:
    (PushbackInputStream); line: 2, column: 3]",</p>
  </blockquote>
  
  <p>This is the object:</p>
  
  <pre><code>@Entity
  public class Persona {
      @Id
      @GeneratedValue(strategy=GenerationType.AUTO)
      private Integer id;
      private String nombre;
      private String apellido;
  
  
  
      public Persona(String nombre, String apellido) {
  
          this.nombre = nombre;
          this.apellido = apellido;
      }
      public Integer getId() {
          return id;
      }
  
      public String getNombre() {
          return nombre;
      }
      public void setNombre(String nombre) {
          this.nombre = nombre;
      }
      public String getApellido() {
          return apellido;
      }
      public void setApellido(String apellido) {
          this.apellido = apellido;
      }
  
  
  }
  </code></pre>
  
  <p>This is the controller method:</p>
  
  <pre><code>@PostMapping(path="/persona")
  public @ResponseBody String addPersona(@RequestBody Persona p) {
      personaRepository.save(p);
      return "success";
  
  }
  </code></pre>