I am using Spring boot I try to create a new Student.
@RequestMapping(path="/student/create", method=RequestMethod.POST)<br>
public ResponseEntity<String> createStudent(@RequestBody Long nummer, String firstname, String lastname){<br>
service.createStudent(matrikelnummer, vorname, nachname);<br>
return new ResponseEntity<String>("gut gemacht", HttpStatus.OK);
Here my RequestBody with RESTCLIENT
{"nummer":15557,"firstname":"toti","lastname":"Innna"}
I have this Error:
{"timestamp":"2019-12-20T19:41:30.083+0000","status":400,"error":"Bad Request","message":"JSON parse error: Cannot deserialize instance of
java.lang.Longout of START_OBJECT token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance ofjava.lang.Longout of START_OBJECT token\n at [Source: (PushbackInputStream); line: 1, column: 1]","trace":"org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize instance ofjava.lang.Longout of START_OBJECT token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance ofjava.lang.Longout of START_OBJECT token\n at [Source: (PushbackInputStream); line: 1, column: 1]\r\n\tat