title: Spring Boot: Application is displaying 404 error
body: <p>I am trying to run Spring Boot REST API application, but I am getting a 404 error.</p>
  
  <pre><code>package com.spring.boot.entry;
  @SpringBootApplication
  @ComponentScan(basePackageClasses = HelloController.class)
  public class CourseApiApp {
      public static void main(String[] args) {
          SpringApplication.run(CourseApiApp.class, args);
      }
  }
  
  package com.spring.boot.entry.hello;
  @RestController
  public class HelloController {
      @RequestMapping("/hello")
      public String sayHello() {
          return "Hi First Spring boot application ";
      }
  }
  </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;io.spring.boot.quickstart&lt;/groupId&gt;
    &lt;artifactId&gt;course-api&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;name&gt;Spring Boot API&lt;/name&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.4.2.RELEASE&lt;/version&gt;
    &lt;/parent&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.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-data-solr&lt;/artifactId&gt;
      &lt;/dependency&gt;
    &lt;/dependencies&gt;
  
    &lt;properties&gt;
      &lt;java.version&gt;1.8&lt;/java.version&gt;
    &lt;/properties&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>I also tried <code>@ComponentScan(basePackageClasses = HelloController.class)</code>,
  but no luck. Could you please help to resolve this issue?</p>
  
  <p>If I hit <a href="http://localhost:8080/hello" rel="nofollow noreferrer">http://localhost:8080/hello</a> url then I am getting 404.</p>