1
As a beginner to SpringBoot, this error can be happened to anyone at least once, due to some reasons.
- The Application class (eg: SpringAppApplication.java) should be at the root level, and the controller classes can be placed under the same level or maybe in a subdirectory. This application class should be denoted using
@SpringBootApplication
or extends from SpringBootApplication
- You may miss the
@RestController
annotation on top of the controller class.
- Can be missed the mapping annotation.(
@PostMapping("/save")
or @GetMapping("/id")
etc.)
- finally check whether you are entering the correct request mapping address(URL), because you may miss a slash or annotation. else double-check the spelling. eg:
@RequestMapping("/customer")