velamma hindi pdf kickass download in hindi
velamma pdf kickass download in hindi
velamma hindi pdf kickass download in hindiQ:
REST API endpoint returning large string value
I'm working on a web application that uses the following REST API:
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public User findById(@PathVariable(name = "id") Long id) {
final String apiUrl = "" + id;
Optional optionalUser = restTemplate.getForObject(apiUrl, User.class);
User user = optionalUser.orElse(new User());
return user;
}
For some reason the RestTemplate.getForObject() call will fail with the exception below.
The strange thing is, if I run curl -v I get the following response which makes sense.
But, if I run curl -v -H "Content-Type: application/json" -H "Accept: application/json" -X GET "" the RestTemplate call will fail with the exception below.
org.springframework.http.converter.HttpMessageNotReadableException: Could not read document: Can not construct instance of com.model.User: no suitable constructor found, can not deserialize from Object value (label is empty); nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Can not construct instance of com.model.User: no suitable constructor found, can not deserialize from Object value (label is empty)
at [Source: (String)"{"id":5e6bcb940a954078fbb8ddea}"; line: 1, column: 1] (through reference chain: com.model.User["user"])
at org.springframework.http.converter.json.MappingJackson2HttpMessageConverter.readInternal(MappingJackson ac619d1d87
Related links:
Comments