We Are Going To Discuss About java.lang.IllegalArgumentException: No converter found for return value of type. So lets Start this Java Article.
java.lang.IllegalArgumentException: No converter found for return value of type
- java.lang.IllegalArgumentException: No converter found for return value of type
The problem was that one of the nested objects in
Foo
didn't have anygetter/setter
- java.lang.IllegalArgumentException: No converter found for return value of type
The problem was that one of the nested objects in
Foo
didn't have anygetter/setter
Solution 1
The problem was that one of the nested objects in Foo
didn’t have any getter/setter
Original Author Marc Of This Content
Solution 2
Add the below dependency to your pom.xml:
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.10.0.pr3</version>
</dependency>
Original Author PAA Of This Content
Solution 3
Add the getter/setter missing inside the bean mentioned in the error message.
Original Author Soumyajit Swain Of This Content
Solution 4
Use @ResponseBody
and getter/setter
. Hope it will solve your issue.
@RequestMapping(value = "/bar/foo", method = RequestMethod.GET)
@ResponseBody
public ResponseEntity<foo> foo() {
and update your mvc-dispatcher-servlet.xml
:
<mvc:annotation-driven>
<mvc:message-converters>
<bean class="org.springframework.http.converter.StringHttpMessageConverter"/>
<bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"/>
</mvc:message-converters>
</mvc:annotation-driven>
Original Author SkyWalker Of This Content
Conclusion
So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.