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=true
on the browser, I see this in the logs:Answer:
Your controller is in packagecom.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!