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:
http://localhost:8080/deviceConnection?verify=trueon the browser, I see this in the logs:
Answer:Your controller is in package
com.gtt.wcas.device.rootbut 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!