Leave a Reply

27 Comments on "Spring Boot Quick Start 11 – Adding a REST Controller"

Notify of
avatar

Sugam Shende
Guest
Sugam Shende
3 days 9 hours ago

Description Resource Path Location TypeArchive for required library: 'C:/Users/HP/.m2/repository/org/hibernate/hibernate-validator/5.2.4.Final/hibernate-validator-5.2.4.Final.jar' in project 'course-api' cannot be read or is not a valid ZIP file course-api Build path Build Path ProblemSir please may i known how to resolve this problem

Marinakulichok
Guest
Marinakulichok
4 days 6 hours ago

If some one have the same error as me "The Tomcat connector configured to listen on port 8080 failed to start. The port may already be in use or the connector may be misconfigured." This is a port conflict , my programm is still running and I tried to run it again.Always normally terminate your "run" red buttone closed to "console" then rerun your project! It have to help

krishna chaitanya
Guest
krishna chaitanya
6 days 14 hours ago

Kaushik, a bit off topic question. whats the keyboard that you are using. love the sound of the keypress.

Ashutosh Sharma
Guest
Ashutosh Sharma
1 month 15 days ago

@RequestMapping is not working on for me. Tomcat started successfully but not able to see any response on browser.

Emre Verim
Guest
Emre Verim
1 month 5 days ago

add this under @springbootapplication @ComponentScan(basePackages = "<basepackage>)basepackage should be the package which you have your Restcontroller.

Emre Verim
Guest
Emre Verim
1 month 5 days ago

same issue here, if i can fix it up, i will post it

Angshuman Dey
Guest
Angshuman Dey
1 month 21 days ago

Hi, Kaushik I am just wondering how the view resolver worked here? Does Spring boot sets default view resolver?

Uttam Patra
Guest
Uttam Patra
1 month 22 days ago
Hi kaushik, I am not able to see tomcat in the console2017-03-30 13:41:51.059 INFO 14820 — [ main] com.ukp.springbootstarter.CourseApiApp : Starting CourseApiApp on BDC4A-L-6440LBB with PID 14820 (C:uttamMyDemosSpringBootws1course-apitargetclasses started by uttam.patra.kumar in C:uttamMyDemosSpringBootws1course-api)2017-03-30 13:41:51.066 INFO 14820 — [ main] com.ukp.springbootstarter.CourseApiApp : No active profile set, falling back to default profiles: default2017-03-30 13:41:51.212 INFO 14820 — [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@769f71a9: startup date [Thu Mar 30 13:41:51 IST 2017]; root of context hierarchy2017-03-30 13:41:55.404 INFO 14820 — [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup2017-03-30 13:41:55.649 INFO 14820 — [ main] com.ukp.springbootstarter.CourseApiApp : Started CourseApiApp in 5.666… Read more »
Shyam Rao Singham
Guest
Shyam Rao Singham
1 month 16 days ago

Same problem to me. Please give me a solution if you solved the issue

bbvkishore
Guest
bbvkishore
1 month 24 days ago

For those whom it worked .. How did this work without adding @ComponentScan("io.javabrains")? At least, it didn't work until I added that 🙁

sumanth varada
Guest
sumanth varada
2 months 17 days ago

Hi Kaushik, Thanks for this wonderful tutorial. I can't see the tomcat running in my console. Can u help me ??

Angshuman Dey
Guest
Angshuman Dey
1 month 13 days ago

that works like a charm…..

Ekta Dubey
Guest
Ekta Dubey
1 month 13 days ago

In your ApplicationStarter(where you have added SpringBootApplication annotation) class add @ComponentScan(basePackages = "<basepackage>"), in place of <basepackage> put package of TestController or put a parent package so that everything is scanned..after that it should work..

Angshuman Dey
Guest
Angshuman Dey
1 month 17 days ago
Hi Vaibhav,Did that but no success. Same thing is happening. Don't know what's wrong with my code it's really very frustrating.localhost:8282/firstTestController class—————————-@RestControllerpublic class TestController { @RequestMapping("/firstTest") public String springBootFirstTest(){ return "THIS IS MY FIRST SPRING BOOT APPLICATION"; }}Log output———————2017-04-05 12:53:09.389 DEBUG 5320 — [nio-8282-exec-1] o.s.web.servlet.DispatcherServlet : DispatcherServlet with name 'dispatcherServlet' processing GET request for [/firstTest]2017-04-05 12:53:09.392 DEBUG 5320 — [nio-8282-exec-1] s.w.s.m.m.a.RequestMappingHandlerMapping : Looking up handler method for path /firstTest2017-04-05 12:53:09.396 DEBUG 5320 — [nio-8282-exec-1] s.w.s.m.m.a.RequestMappingHandlerMapping : Did not find handler method for [/firstTest]2017-04-05 12:53:09.396 DEBUG 5320 — [nio-8282-exec-1] o.s.w.s.handler.SimpleUrlHandlerMapping : Matching patterns for request [/firstTest] are [/**]2017-04-05 12:53:09.397 DEBUG 5320… Read more »
G. VAIBHAV REDDY
Guest
G. VAIBHAV REDDY
1 month 18 days ago

Angshuman Dey try to change the port number and start again!

Angshuman Dey
Guest
Angshuman Dey
1 month 18 days ago
Hi Lionel, I can see my tomcat is running. But still getting the White Label error page by default for the url.localhost:8080/hello. Can you help me with that?My eclipse console output is as below2017-04-04 17:06:53.066 INFO 7092 — [ main] com.ad.springboot.app.CourseApiApp : Starting CourseApiApp on angsdey2 with PID 7092 (C:personalSTS-WorkspaceSpring-Bootcourse-apitargetclasses started by ibm in C:personalSTS-WorkspaceSpring-Bootcourse-api)2017-04-04 17:06:53.069 INFO 7092 — [ main] com.ad.springboot.app.CourseApiApp : No active profile set, falling back to default profiles: default2017-04-04 17:06:53.132 INFO 7092 — [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@1de60b4: startup date [Tue Apr 04 17:06:53 IST 2017]; root of context hierarchy2017-04-04 17:06:55.138 INFO 7092 — [… Read more »
G. VAIBHAV REDDY
Guest
G. VAIBHAV REDDY
1 month 20 days ago

Thanks Worked like a gem 🙂

Lionel Kamdem
Guest
Lionel Kamdem
2 months 7 days ago

Try to create the "Application.properties" file in src/main/resources and add try to change you embedded tomcat server port by adding these lines into the Application.properties file: 1. logging.level.org.springframework: DEBUG2. server.port=8282Run again your project and try: localhost:8282/hello. Hope I helped!

Skullid13
Guest
Skullid13
2 months 20 days ago

thanks Rajesh for this tutorial

Yuanzhi Bao
Guest
Yuanzhi Bao
3 months 6 days ago

Thank you! Great videos!

wpDiscuz