title: can't mapping the rest controller
body: <p>I tried to test Spring Boot with MongoDB but when I run mvn, the server run just fine but can't find the mapping in the RestController</p>
  
  <pre><code>@RestController
  @RequestMapping("/mongotest")
  public class UserController {
  
      @Autowired
      private UserService service;
  
      @RequestMapping(value = "/getallusers" , method = RequestMethod.GET)
      public List&lt;User&gt; getAllUser(){
          return service.findAll();
      }
      @RequestMapping(value = "/saveuser" , method = RequestMethod.POST)
      public void saveUser(@RequestBody User user){
          service.createUser(user);
      }
      @GetMapping(value = "/hello")
      public String test(){
          return "hello world";
      }
  
  }
  </code></pre>
  
  <pre><code>@Repository
  public interface UserDAO extends MongoRepository&lt;User,String&gt;{
      List&lt;User&gt; findByName(String name);
      List&lt;User&gt; findByDepartment(String department);
  }
  </code></pre>
  
  <pre><code>@Entity
  @Getter @Setter @NoArgsConstructor @ToString @AllArgsConstructor
  @Document(collection = "users")
  public class User{
      @Id
      private Long id;
  
      @Field(value = "name")
      private String name;
  
      @Field(value = "age")
      private Integer age;
  
      @Field(value = "department")
      private String department;
  
  }
  </code></pre>
  
  <pre><code>spring.data.mongodb.database= test_mongo
  </code></pre>
  
  <pre><code>@SpringBootApplication
  @EnableAutoConfiguration(exclude = DataSourceAutoConfiguration.class)
  public class DemoApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(DemoApplication.class, args);
          System.out.println("Deploy successful");
      }
  
  }
  </code></pre>
  
  <p>Update the service class</p>
  
  <pre><code>@Service
  public class UserService{
      @Autowired
      private UserDAO userDAO;
  
      public User createUser(User u){
          return userDAO.save(u);
      }
  
      public List&lt;User&gt; findByName(String name){
          return userDAO.findByName(name);
      }
  
      public List&lt;User&gt; findByDepartment(String department){
          return userDAO.findByDepartment(department);
      }
  
      public List&lt;User&gt; findAll(){
          return userDAO.findAll();
      }
  }
  </code></pre>
  
  <p>Update 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;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.8.RELEASE&lt;/version&gt;
          &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
      &lt;groupId&gt;com.example.demo&lt;/groupId&gt;
      &lt;artifactId&gt;demo&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;demo&lt;/name&gt;
      &lt;description&gt;Demo project for Spring Boot&lt;/description&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-data-jpa&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-data-mongodb&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.projectlombok&lt;/groupId&gt;
              &lt;artifactId&gt;lombok&lt;/artifactId&gt;
              &lt;optional&gt;true&lt;/optional&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>
  
  <p>The program run just fine but in the log can't find the part mapping with the RequestMapping i have in the UserController
  And when i run the mapped link return 404</p>
  
  <pre><code>```Project struct
  src
     main
         java
             com
                example
                       demo
                           controller
                                     UserController.java
                           demo
                                     DemoApplication.java
                           entity
                                     User.java
                           repository
                                     UserDAO.java
                           service
                                     UserService.java
         resources
             application.properties
  pom.xml
  </code></pre>
  
  <pre><code>2019-09-09 22:42:05.856  INFO 19036 --- [           main] com.example.demo.demo.DemoApplication    : Starting DemoApplication on DESKTOP-UNR6TSG with PID 19036 (E:\demo\target\classes started by MemeLord in E:\demo)
  2019-09-09 22:42:05.861  INFO 19036 --- [           main] com.example.demo.demo.DemoApplication    : No active profile set, falling back to default profiles: default
  2019-09-09 22:42:06.782  INFO 19036 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
  2019-09-09 22:42:06.784  INFO 19036 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
  2019-09-09 22:42:06.806  INFO 19036 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 17ms. Found 0 repository interfaces.
  2019-09-09 22:42:07.549  INFO 19036 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
  2019-09-09 22:42:07.588  INFO 19036 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
  2019-09-09 22:42:07.588  INFO 19036 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.24]
  2019-09-09 22:42:07.707  INFO 19036 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
  2019-09-09 22:42:07.708  INFO 19036 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1790 ms
  2019-09-09 22:42:08.053  INFO 19036 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
  2019-09-09 22:42:09.060  INFO 19036 --- [           main] org.mongodb.driver.cluster               : Cluster created with settings {hosts=[localhost:27017], mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500}
  2019-09-09 22:42:09.138  INFO 19036 --- [localhost:27017] org.mongodb.driver.connection            : Opened connection [connectionId{localValue:1, serverValue:2}]
  to localhost:27017
  2019-09-09 22:42:09.144  INFO 19036 --- [localhost:27017] org.mongodb.driver.cluster               : Monitor thread successfully connected to server with description ServerDescription{address=localhost:27017, type=STANDALONE, state=CONNECTED, ok=true, version=ServerVersion{versionList=[4, 2, 0]}, minWireVersion=0, maxWireVersion=8, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=3475900}
  2019-09-09 22:42:09.401  INFO 19036 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
  2019-09-09 22:42:09.404  INFO 19036 --- [           main] com.example.demo.demo.DemoApplication    : Started DemoApplication in 4.07 seconds (JVM running for 8.531)
  Deploy successful
  </code></pre>