Skip to content
Advertisement

How do I avoid the white label error(404) on localhost:8080?

I have been looking around here and in other forums for hours and I still haven’t found what I am doing wrong. I have built a simple Spring-Boot application with MongoDB and I have no errors in the console when i run it but i keep getting the white label error no matter what I do. My main and controller classes are in different packages but I have used @ComponentScan. I have also added web app folder thinking it would fix it but apparently that wasn’t the issue. I have also added all the necessary mappings to the controller class. These are the most common solutions I’ve seen but I still get the same error.

JavaScript

4.0.0 org.springframework.boot spring-boot-starter-parent 2.3.5.RELEASE com.example Kamerat 0.0.1-SNAPSHOT Kamerat Demo project for Spring Boot

JavaScript

Screenshot of Controller class

Advertisement

Answer

You are having this error because there is no defaut webPage for spring boot Screenshot with the error

To fix it , you just need to add a simple html file (index.html) in you sr/main/resources/statics directory

Screenshot of the config to do

Then you will have :

Screenshot after the fix

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement