"Could not find acceptable representation" using spring-boot-starter-web "Could not find acceptable representation" using spring-boot-starter-web json json

"Could not find acceptable representation" using spring-boot-starter-web


You have no public getters for your UpdateResult, for example :

public static class UploadResult {    private String value;    public UploadResult(final String value)    {        this.value = value;    }    public String getValue() {       return this.value;    }}

I believe by default auto discovery is on and will try to discover your getters. You can disable it with @JsonAutoDetect(getterVisibility=Visibility.NONE), and in your example will result in [].


I had a similar error using spring/jhipster RESTful service (via Postman)

The endpoint was something like:

@RequestMapping(value = "/index-entries/{id}",        method = RequestMethod.GET,        produces = MediaType.APPLICATION_JSON_VALUE)@Timedpublic ResponseEntity<IndexEntry> getIndexEntry(@PathVariable Long id) {

I was attempting to call the restful endpoint via Postman with header Accept: text/plain but I needed to use Accept: application/json


I too was facing a similar issue. In my case the request path was accepting mail id as path variable, so the uri looked like /some/api/test@test.com

And based on path, Spring determined the uri is to fetch some file with ".com" extension and was trying to use different media type for response then intended one. After making path variable into request param it worked for me.