• Register
0 votes
732 views

Problem :

I am very new to Spring Boot. I am learning to write code in Spring Boot. I have written my first Spring Boot code as below

@RequestMapping(value = "/bar/foo", method = RequestMethod.GET)
    public MyResponseEntity<foo> foo() {
Foo model;
        ...
        return MyResponseEntity.ok(model);
    }
}

But I am facing below exception

“Java.lang.IllegalArgumentException: No converter found for return value of type”

I am unable to understand the above exception.

I have also tried to add the Jackson to my pom.xml as shown below but still I am facing the above exception

<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>

How can I fix above Spring Boot exception?

8 4 2
2,300 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I have understood your problem. If you are receiving the Converter error then a most possible cause is that a Jackson is unable to find the necessary getter methods. Please check your POJO getter methods very carefully. In my case my mistake was I had the lower-cased getter on one of the property instead of a expected camel case e.g  getmetaTag() instead of getMetaTag().

You can also try to add a below dependency to your pom.xml:

<dependency>

    <groupId>com.fasterxml.jackson.core</groupId>

    <artifactId>jackson-databind</artifactId>

    <version>2.10.0.pr3</version>

</dependency>

In some cases If you forgot to add the library jackson-core.jar along with jackson-annotations.jar and jackson-databind.jar. Then try adding these jars it will fix your issue.

5 2 1
4,980 points

Related questions

0 votes
1 answer 13 views
13 views
Problem: I am trying to run a spring boot application which is made by someone else. I have tried to attach my local database to the application but when I run this, it gives the following error; org.springframework.beans.factory.BeanCreationException: Error creating bean with ... { return new ModelMapper(); } } EDIT3 I run the Spring boot application with CMD using the command: java -jar xxx.jar
asked Apr 26 Yeamin 22k points
0 votes
1 answer 37 views
37 views
Problem : I am trying to POST a List of custom objects but i am getting exception as below can not deserialize instance of java.util.arraylist out of start_object token
asked Mar 6 Wafa Abu Yousef 6.1k points
0 votes
1 answer 387 views
387 views
Problem : I want to POST the List of custom objects. My JSON in a request body is as below : {     "collection": [         {             "name": "Test ordert1",             "detail": "ahk ksa"         },         {             "name": "Test ... } But I am facing below error: &ldquo;Can not deserialize instance of java.util.arraylist out of start_object token&rdquo; How can I fix the above error?
asked Jan 21, 2020 jwilliam 3.9k points
0 votes
1 answer 6.6K views
6.6K views
Problem : I am trying to POST a List of custom objects but i am getting exception as below can not deserialize instance of java.util.arraylist out of start_object token
asked Oct 22, 2019 peterlaw 6.9k points
0 votes
1 answer 36 views
36 views
Problem: org.apache.catalina.lifecycleexception: failed to start component [connector[http/1.1-8080]]
asked Feb 18 Lucky Guy 1.5k points
0 votes
1 answer 5 views
5 views
Problem: Please help me if you have any solution > Failed to process import candidates for configuration class.
asked 4 days ago Irenka Kiri 17.9k points
0 votes
1 answer 9 views
9 views
Problem: I am migrating from Spring Boot 1.4.9 to Spring Boot 2.0 and also to Spring Security 5 and I am trying to do authenticate via OAuth 2. But I am getting this error: java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null ... secret") .accessTokenValiditySeconds(1800); } } Please guide me with this issue. I have spend hours to fix this but not able to fix.
asked Apr 25 Moumita Bhowmick 12.9k points
0 votes
1 answer 16 views
16 views
Problem: I am migrating from Spring Boot 1.4.9 to Spring Boot 2.0 and also to Spring Security 5 and I am trying to do authenticate via OAuth 2. But I am getting this error: java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null
asked Mar 19 ummesalma 29.2k points
0 votes
1 answer 85 views
85 views
Problem : After executing spring boot with h2 database and JPA i am facing below error, any help: org.hibernate.tool.schema.spi.commandacceptanceexception: error executing ddl via jdbc statement
asked Mar 6 Wafa Abu Yousef 6.1k points
0 votes
1 answer 5.2K views
5.2K views
Problem : After executing spring boot with h2 database and JPA i am facing below error org.hibernate.tool.schema.spi.commandacceptanceexception: error executing ddl via jdbc statement
asked Nov 12, 2019 peterlaw 6.9k points