• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: RestController Returning 404 (Spring Boot 2.3.7)

Resolved: RestController Returning 404 (Spring Boot 2.3.7)

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I have written a Spring Boot application with RestContoller. But when I hit the URL in a browser, I get a 404 error. But i am not sure what I am doing wrong. Everything seems to be all correct. My controller class looks like this:
My main class is like this:
My application properties are:
And when I enter http://localhost:8080/deviceConnection?verify=true on the browser, I see this in the logs:
Can you please let me know what am I doing wrong. Any help is much appreciated.

Answer:

Your controller is in package com.gtt.wcas.device.root but you setup @ComponentScan(basePackages = "com.gtt.wcas.device.details").
You controller is never picked up by Spring. Either move it to another package or change your component scan.

If you have better answer, please add a comment about this, thank you!

java spring spring-boot spring-restcontroller
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: How to compare two text files and and change the sign of the data in powershell?

27/03/2023

Resolved: Java Virtual Machines deleted

27/03/2023

Resolved: PyCharm cannot see my newly compiled .pyc see on import

27/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.