0

I'm currently using an image stacksimplify/Kube-frontend-nginx:1.0.0 to make it available for end-users. For the same reason, I'm deploying 2 services (1 for front-end & 1 for back-end) as much as 1 cluster for back-end and 1 load balancer.

The problem that I have is that as soon as I got the public IP Address from my front-end service, I'm getting the following message:

Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.

Mon Aug 23 21:11:14 GMT 2021
There was an unexpected error (type=Not Found, status=404).
No message available

So, I'm pretty new to azure and kubernetes. To start troubleshooting this type of issues, what is the stuff that I have to do?

Hvaandres
  • 755
  • 2
  • 12
  • 39

1 Answers1

0

The issue occurs because of the spring boot application.

Please check if your source code have any error If the source code does not have error, please check your spring boot’s file structure.

Correct Spring Boot Application Project Files Structure :

  1. As we know every spring boot application has a main application class that will be executed to initialize the spring boot application.

  2. And this spring boot application main class should be annotated with @SpringBootApplication annotation.

  3. The @SpringBootApplication annotation is the combination of the annotations @Configuration, @ComponentScan and @EnableAutoConfiguration.

  4. @ComponentScan can configure the base package to scan the spring components and@EnableAutoConfiguration annotation can enable bean auto-configure in the application.

  5. If there are more classes like the JPA class placed in a different(child) package than the spring boot main class package, so when you use the@SpringBootApplicationannotation, you can not specify the base package value.

  6. So if you use @SpringBootApplication annotation in your spring boot main class, you must place the main class in root package as bellow to avoid Whitelabel error page.

  7. To avoid the Whitelabel error page, save the main class file in the root package.

  8. If you do not want to place the spring boot main class in the spring boot app root package, you can use @Configuration, @ComponentScan and @EnableAutoConfiguration annotation to replace the @SpringBootApplication annotation, and then specify the base package in the @ComponentScan annotation.

Reference :

https://www.dev2qa.com/spring-boot-resolve-whitelabel-error-page-example/

RamaraoAdapa
  • 2,837
  • 2
  • 5
  • 11