Whitelabel Error Page Spring Boot
Whitelabel Error Page on Browser page. There was an unexpected error (type=Not Found, status=404). Whitelabel Error Page : Spring Boot can be resolved as per the instructions given in solution below.
Warning On console:
[nio-8080-exec-3]_[0;39m _[36mo.s.w.s.r.ResourceHttpRequestHandler _[0;39m _[2m:_[0;39m Path with “WEB-INF” or “META-INF”: [WEB-INF/pages/loginPage.jsp]
Cause Of Issue:
One of the reasons of getting the most common ‘Whitelabel Error Page’ in Spring Boot is that you may not have added web server related dependency.
If you are running your application on Tomcat (Spring Boot selects Tomcat by default), Ensure that you have jasper jar in the list of dependencies :
<dependency> <groupId>org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed-jasper</artifactId> </dependency>
If you are using a Jetty server, add below dependency:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jetty</artifactId> </dependency>
Similarly If you are using Undertow server, add below dependency:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-undertow</artifactId> </dependency>
You can find maven dependencies from the maven repository.
Additionally, you can have jstl jar as well if you are using JSP as a view Page to use JSTL tags and don’t want to see blank page again or any error because of this.
<dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> </dependency>
You may want to visit More on Spring boot.
Generally, in order to identify and resolve the issue, it’s essential to check your application’s logs (usually found in the logs directory of your Spring Boot project) for specific error messages and stack traces. This information will help identify the root cause of the error, and you can then take appropriate action to fix it, such as implementing error handling, correcting configuration settings, or addressing code issues.
—-End of Whitelabel Error Page Spring Boot—