Stack Exchange
White label error in spring boot !! May be URL doesn't reach to controller
URL: "localhost:8082/api/notebooks/all" should reach to the method of controller, but it shows the error of white label with a message of explicitly application mapping problem. Is there any problem with war package?
Controller:
    package com.savenotes.controller;

    import java.util.List;
    import java.util.UUID;

    import javax.validation.Valid;
    import javax.validation.ValidationException;

    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.validation.BindingResult;
    import org.springframework.web.bind.annotation.CrossOrigin;
    import org.springframework.web.bind.annotation.DeleteMapping;
    import org.springframework.web.bind.annotation.GetMapping;
    import org.springframework.web.bind.annotation.PathVariable;
    import org.springframework.web.bind.annotation.PostMapping;
    import org.springframework.web.bind.annotation.RequestBody;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RestController;

    import com.savenotes.model.Notebook;
    import com.savenotes.repository.NotebookRepository;
    import com.savenotes.savenotes.Mapper;
    import com.savenotes.viewmodel.NotebookViewModel;


    @RestController
    @RequestMapping("/api/notebooks")
    @CrossOrigin
    public class NoteBookController 
    {

        @Autowired
        private NotebookRepository notebookRepository;

        @Autowired
        private Mapper mapper;

        public NoteBookController(NotebookRepository notebookRepository, Mapper mapper)
        {
            this.notebookRepository = notebookRepository;
            this.mapper = mapper;
        }

        @GetMapping("/all")
        public List<Notebook> fetchAllNotebook() 
        {
            List<Notebook> listOfNotebooks = notebookRepository.findAll();
            System.out.println("Hiiiiiiii");
            return listOfNotebooks;
        }

        @PostMapping
        public Notebook save(@Valid @RequestBody NotebookViewModel notebookViewModel, 
                                    BindingResult bindingResult)
        {
            if(bindingResult.hasErrors())
            {
                throw new ValidationException();
            }
            Notebook notebook = mapper.convertToNotebookEntity(notebookViewModel);

            notebookRepository.save(notebook);
            return notebook;
        }

        @DeleteMapping("/{id}")
        public void delete(@PathVariable String id)
        {
            notebookRepository.deleteById(UUID.fromString(id));
        }
    }

A Port number has been given in the application.properties file.
Application.properties:
spring.datasource.url=jdbc:h2:file:./asdj.db
noteit.db.recreate=true

spring.mail.host=smtp.gmail.com
spring.mail.port=587
spring.mail.username=
spring.mail.password=
server.port=8082

This project has been created in war with java8 version. I think I have included all necessary dependencies
pom.xml file:
    <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.2.6.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.savenotes</groupId>
    <artifactId>savenotes</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>war</packaging>
    <name>savenotes</name>
    <description>Project to save notes</description>

    <properties>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-mail</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>


your builder is a war so you have to use  module name according to your pom file seems like final name of the builder is savenotes-0.0.1-SNAPSHOT.so you have to call the api as below 
localhost:8082/0.0.1-SNAPSHOT/api/notebooks/all 
if you change build section in pom.xml as below
<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
       <finalName>savenotes</finalName>
    </build>

you can call to api as localhost:8082/savenotes/api/notebooks/all 

Actually my main class was under package name "com.savenotes.savenote". my friend suggested me to keep the package name "com.savenote" only and now it works fine.
