java.lang.IllegalArgumentException: No converter found for return value of type

Marc :

With this code

@RequestMapping(value = "/bar/foo", method = RequestMethod.GET)
    public ResponseEntity<foo> foo() {

        Foo model;
        ...
        return ResponseEntity.ok(model);
    }
}

I get the following exception

java.lang.IllegalArgumentException: No converter found for return value of type

My guess is that the object cannot be converted to JSON because Jackson is missing. I don't understand why because I thought that Jackson was built in with spring boot.

Then I have tried to add Jackson to the pom.xml but I still have the same error

<dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-core</artifactId>
    <version>2.4.3</version>
</dependency>
<dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-databind</artifactId>
    <version>2.4.3</version>
</dependency>

Do I have to change any spring boot properties to make this work?

Thank you

Marc :

The problem was that one of the nested objects in Foo didn't have any getter/setter

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=419522&siteId=1