'Tomcat started on port(s): 8080 but getting 404

I am trying to run a simple spring-boot application but every time I am getting 404. Even with the simple setting and no code. any clue what am I missing to run this application?

enter image description here

enter image description here

enter image description here



Solution 1:[1]

That's the expected outcome. The 404 is a real HTTP response from your Tomcat server. As you are starting an empty Spring Boot project, there's nothing to serve and the "Whitelabel Error Page" is the default Spring Boot 404 page.

To understand the difference when your Spring Boot application is not running, stop the Spring Boot application and then revisit http://localhost:8080.

You can now follow this Spring Boot guide and add your own endpoints to your project.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 rieckpil