title: Spring Boot WhiteLabel Error Page (Spring 4.0)
body: <p>Pretty much the same question that's been asked for a few years now but with no avail, I figured it was time to ask here.</p>
  
  <p>Why is my group seeing this Whilelabel error page? -->
  (<a href="https://i.imgur.com/hGd61Qr.png" rel="nofollow noreferrer">https://i.imgur.com/hGd61Qr.png</a>)</p>
  
  <p>File Structure Image 1: <a href="https://i.imgur.com/x5Jn4gP.png" rel="nofollow noreferrer">https://i.imgur.com/x5Jn4gP.png</a></p>
  
  <p>File Structure Image 2: <a href="https://i.imgur.com/K8gP59y.png" rel="nofollow noreferrer">https://i.imgur.com/K8gP59y.png</a></p>
  
  <p>File Structure Image 3: <a href="https://i.imgur.com/JFFEidy.png" rel="nofollow noreferrer">https://i.imgur.com/JFFEidy.png</a></p>
  
  <p>It seems we have the general structure that Spring likes, with the main app being above all the other controllers and such.</p>
  
  <p>MainApp Class:
      package com.example;</p>
  
  <pre><code>import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  import org.springframework.context.annotation.ComponentScan;
  
  
  @SpringBootApplication(scanBasePackages = {"com.example.demo", 
  "com.example.demo.domain", "com.example.demo.dao", 
  "com.example.demo.service"})
  @ComponentScan("com.example.demo.domain.Book_CopiesMapper")
  public class MySpringBootApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(MySpringBootApplication.class, args);
      }
  }
  </code></pre>
  
  <p>We have to have that ComponentScan otherwise we get this error: 
  <a href="https://i.imgur.com/BKDwHyn.png" rel="nofollow noreferrer">https://i.imgur.com/BKDwHyn.png</a></p>
  
  <p>Controller Class: </p>
  
  <pre><code>package com.example.demo;
  
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.stereotype.Controller;
  import org.springframework.ui.Model;
  import org.springframework.ui.Model;
  import org.springframework.web.bind.annotation.GetMapping;
  import org.springframework.web.bind.annotation.RequestParam;
  import org.springframework.web.bind.annotation.ModelAttribute;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  import org.springframework.web.bind.annotation.RestController;
  
  import com.example.demo.domain.Borrower;
  import com.example.demo.domain.Employee;
  import com.example.demo.service.BorrowerService;
  
  
  @RestController
  public class LoginController {
  
      @Autowired
      BorrowerService borrowerService;
  
      @GetMapping("/login")
      public String login() {
          System.out.println("hello from LoginController");
          return "login";
      }
  
      @GetMapping("/signup")
      public String signup() {
          return "signup";
      }
  
      @RequestMapping(value = "/registerUser", method = RequestMethod.POST)
      public String registerUser(@ModelAttribute Borrower borrower, Model model) {
  
          borrowerService.insertBorrower(borrower);
          model.addAttribute("message", "Success! You may now login with Card Number: " + borrower.getcardNo());
  
          return "registerUser";
      }
  }
  </code></pre>
  
  <p>Where login is a simple login page, signup is a form that allows a user to signup to our Library, and registerUser is meant to connect to our Oracle SQL database and insert a user into the respective table (of which we assume this is the correct way of doing this)</p>
  
  <p>pom.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;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 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.example&lt;/groupId&gt;
      &lt;artifactId&gt;MySpringBoot&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
  
      &lt;name&gt;MySpringBoot&lt;/name&gt;
      &lt;description&gt;Demo project for Spring Boot&lt;/description&gt;
  
      &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;2.1.0.RELEASE&lt;/version&gt;
          &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
          &lt;java.version&gt;1.8&lt;/java.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-jdbc&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-thymeleaf&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.mybatis.spring.boot&lt;/groupId&gt;
              &lt;artifactId&gt;mybatis-spring-boot-starter&lt;/artifactId&gt;
              &lt;version&gt;1.3.2&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-devtools&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.oracle&lt;/groupId&gt;
              &lt;artifactId&gt;ojdbc6&lt;/artifactId&gt;
              &lt;version&gt;11.2.0.3&lt;/version&gt;
          &lt;/dependency&gt;
  
  
      &lt;/dependencies&gt;
  
    &lt;repositories&gt;
          &lt;repository&gt;
              &lt;id&gt;codelds&lt;/id&gt;
              &lt;url&gt;https://code.lds.org/nexus/content/groups/main-repo&lt;/url&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
  
  
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  
  &lt;/project&gt;
  </code></pre>
  
  <p>application.properties:</p>
  
  <pre><code>#spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
  spring.thymeleaf.cache = false
  
  #mybatis
  mybatis.type-aliases-package=com.example.demo.domain
  
  spring.datasource.url = jdbc:oracle:thin:@dataserv.mscs.mu.edu:1521:orcl
  spring.datasource.username = 
  spring.datasource.password = 
  spring.datasource.driver-class-name = oracle.jdbc.driver.OracleDriver
  </code></pre>
  
  <p>with the username and password for our database omitted for obvious reasons.</p>
  
  <p>If anyone could provide any feedback, we would greatly appreciate it! Comment if people would like me to post additional pictures or files.</p>
  
  <p>Thank you!</p>
  
  <p>EDIT: the path we are using is localhost:8080/login or localhost:8080/signup. For now it seems that any path we take leads to this error</p>
  
  <p>Also, all of our DAO classes use the @Autowired tag for any service that we use and similarly we @Autowire anything else we need in different classes such as DAO in the Service package and so on. Sorry that this sentence is kinda vague</p>