title: Spring Boot | localhost: 8080 404 error page displayed
body: <p>I created a Spring Boot Maven project, however my RequestMapping, as well as localhost:8080 return a 404 error page. I think the issue is with how my packages are setup, but I've tried solutions in multiple questions, and I still cant get around the error page. Could you guys point me in the right direction as to how to resolve this issue? Perhaps I need to add the Component annotation above my Main class? But I've tried this solution, and the error still persists.</p>
  
  <p>Here is my package structure:</p>
  
  <pre><code> /src/main/java
        ControllerLayer
             UsersController.java
        DataAccessLayer
             UsersDAL.java
        ServiceLayer
             UsersService.java
        Main
             Main.java
  </code></pre>
  
  <p>Main.java:</p>
  
  <pre><code>  @SpringBootApplication(scanBasePackages = { 
    "/src/main/java/ControllerLayer", "/src/main/java/DataAccessLayer", 
    "/src/main/java/ServiceLayer" })
    public class Main {
  
         public static void main(String[] args) {
         SpringApplication.run(Main.class, args);
       }
    }
  </code></pre>
  
  <p>UsersController.java:</p>
  
  <pre><code> import Entities.Users;
   import ServiceLayer.UsersService;
  
   @RestController
   @RequestMapping("/users")
   public class UsersController {
  
        @Autowired
        private UsersService usersService;
  
        @RequestMapping(value = 
        "/create/{userId}/{userPassword}/{userAge}/{userEmail}"
        + "/{userFirstName}/{userlastName}", method = 
        RequestMethod.POST)
  
        public void createUser(@PathVariable("userId")String userId, 
        @PathVariable("userPassword")String userPassword, 
        @PathVariable("userAge")int userAge, 
        @PathVariable("userEmail")String userEmail,
        @PathVariable("userFirstName")String userFirstName, 
        @PathVariable("userLastName")String userLastName) {
  
             usersService.createUser(new Users(userId, userPassword, 
             userAge, userEmail, userFirstName, userLastName));
        }
     }
  </code></pre>
  
  <p>UserService.java</p>
  
  <pre><code> import DataAccessLayer.UsersDAL;
   import Entities.Users;
  
   @Service
   public class UsersService {
  
      @Autowired
      private UsersDAL usersDAL;
  
      public void createUser(Users user) {
           usersDAL.createUser(user);
      }
   }
  </code></pre>
  
  <p>pom.xml:</p>
  
  <pre><code> &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;xProjectAlpha&lt;/groupId&gt;
        &lt;artifactId&gt;org.htech.xProjectAlpha&lt;/artifactId&gt;
        &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
        &lt;packaging&gt;jar&lt;/packaging&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;1.5.2.RELEASE&lt;/version&gt;
        &lt;/parent&gt;
  
        &lt;properties&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-web&lt;/artifactId&gt;
             &lt;/dependency&gt;
  
             &lt;dependency&gt;
                  &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
                  &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
                  &lt;version&gt;5.2.9.Final&lt;/version&gt;&lt;!--$NO-MVN-MAN-VER$--&gt;
             &lt;/dependency&gt;
        &lt;/dependencies&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>