Leave a Reply

18 Comments on "Spring Boot Quick Start 12 – Returning Objects From Controller"

Notify of
avatar

PARIKSHIT MURRIA
Guest
PARIKSHIT MURRIA
8 days 1 hour ago

Hi Koushik,Thank you for such a wonderful tutorial.Could you please explain why a no-arg constructor is required in Topic class. If i remove it and call GET /topics API, it throws an error saying no constructor matched. Why is thjs happening ?Thank you.

Ben H
Guest
Ben H
10 days 19 hours ago

I could return the String ok but the Topic object just came back with White Label Error. It complained about converting Array to ArrayList. Adding this dependency solved the issue:<dependency>    <groupId>com.fasterxml.jackson.core</groupId>    <artifactId>jackson-databind</artifactId>    <version>2.5.0</version></dependency>

alaapable
Guest
alaapable
23 days 14 hours ago

Hi Koushik,I followed the exactly same steps as mentioned in the tutorial but getting the below exception:java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.Arrays$ArrayList at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:188) ~[spring-webmvc-4.3.4.RELEASE.jar:4.3.4.RELEASE] Can you please tell me what went wrong?For the HelloController I am getting the response fine but not for the TopicController. Please help!Thanks in anticipation.

Samuel Abramov
Guest
Samuel Abramov
1 month 20 hours ago

Thank you so much

Arun
Guest
Arun
1 month 10 days ago

At 7:11 the key in JSON are not exactly the name of properties but in actual those are values of getter and setter methods after omitting the get and set from the method name. Even if we change the properties in the class but keep the name of getter and setter same we will not see any change in the JSON. Anyways Many thanks to Kaushik, he is a genious.

Tarık Nural
Guest
Tarık Nural
1 month 12 days ago

I have been only working on finding this for 3 days. Tried every spring examples online got several bullshit errors and could not find out what they were about. You are just amazing. Thank you for your effort.

Vikash Kumar
Guest
Vikash Kumar
2 months 17 days ago

I got the solution, Just rebuilt the project and error is gone. Thank you for your videos, it is so helpful. Expecting more Real time projects on Spring. Thank you for your videos.

Vikash Kumar
Guest
Vikash Kumar
2 months 17 days ago

I wrote exactly same code in STS, Following your tutorials from the begining, I am Stuck in a Error while running program on browser. The Code Compiles fine but I am getting following error. Unresolved compilation problems: The method asList(T…) in the type Arrays is not applicable for the arguments (Topic, Topic, Topic) The constructor Topic(String, String, String) is undefined The constructor Topic(String, String, String) is undefined The constructor Topic(String, String, String) is undefinedPlease Help me solve the problem.

golokesh patra
Guest
golokesh patra
2 months 22 days ago

Hello, public static void main(String[] args)throws IOException{ byte[] jsonData=Files.readAllBytes(Paths.get("ver.json")); ObjectMapper objectMapper = new ObjectMapper(); status stat = objectMapper.readValue(jsonData, status.class);I have this object created in the main class. Now I want to make a restcontroller that returns all the data in the ver.json onto localhost.How should I write the RestController ?

chandu sekhar
Guest
chandu sekhar
2 months 28 days ago

could you please upload jenkins tutorial if possible????

wpDiscuz