title: Using @RestController to fetch data but getting Whitelabel Error Page
body: <p>I am unable to fetch data from my database as json format. Getting <code>Whitelabel Error Page</code>.</p>
  <p>Not sure where I am going wrong...can some one pls help to resolve the isuue. I am getting Whitelabel Error Page in chrome and in postman</p>
  <pre class="lang-json prettyprint-override"><code> {
      &quot;timestamp&quot;: &quot;2020-12-16T23:10:02.716+00:00&quot;,
      &quot;status&quot;: 404,
      &quot;error&quot;: &quot;Not Found&quot;,
      &quot;message&quot;: &quot;No message available&quot;,
      &quot;path&quot;: &quot;/api/customers&quot;
  }
  
  </code></pre>
  <p><strong>Entity Class</strong></p>
  <pre class="lang-java prettyprint-override"><code>@Entity
  @Table(name=&quot;employee&quot;)
  public class Employee {
      
      @Id
      @GeneratedValue(strategy=GenerationType.IDENTITY)
      @Column(name=&quot;id&quot;)
      private int id;
      
      @Column(name=&quot;first_name&quot;)
      private String firstName;
      
      @Column(name=&quot;last_name&quot;)
      private String lastName;
      
      @Column(name=&quot;email&quot;)
      private String email;
      
      
      public Employee(){
          
      }
      
  
      public Employee(int id, String firstName, String lastName, String email) {
          super();
          this.id = id;
          this.firstName = firstName;
          this.lastName = lastName;
          this.email = email;
      }
      
      
      public Employee(String firstName, String lastName, String email) {
          this.firstName = firstName;
          this.lastName = lastName;
          this.email = email;
      }
      
      //getters &amp; setters
  
  }
  </code></pre>
  <p><strong>Service</strong></p>
  <pre class="lang-java prettyprint-override"><code>public interface RestCurdoService {
      
      public List&lt;Employee&gt; findAll();
  
  }
  </code></pre>
  <p><strong>ServiceImpl</strong></p>
  <pre class="lang-java prettyprint-override"><code>@Service
  public class RestCurdoServiceImpl implements RestCurdoService{
  
      @Autowired
      private RestCurdRepo restCurdRepo;
      
      public List&lt;Employee&gt; findAll() {
          
          return restCurdRepo.findAll();
      }
  
  }
  
  </code></pre>
  <p><strong>Controller</strong></p>
  <pre class="lang-java prettyprint-override"><code>@RestController
  @RequestMapping(&quot;/api&quot;)
  public class RestCurdoController {
      
      @Autowired
      private RestCurdoService restCurdoService;
      
      @GetMapping(&quot;/customers&quot;)
      public List&lt;Employee&gt; findAll() {
          
          List&lt;Employee&gt; theEmployees = restCurdoService.findAll();
          
          return theEmployees;
      }
  }
  </code></pre>
  <p><strong>application.properties</strong></p>
  <pre><code>spring.datasource.url=jdbc:mysql://localhost:3306/employee_directory?useSSL=false&amp;serverTimezone=UTC
  spring.datasource.username=root
  spring.datasource.password=Ronak@123
  server.port=8086
  </code></pre>
  <p><strong>pom.xml</strong></p>
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
      xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&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.4.1&lt;/version&gt;
          &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
      &lt;groupId&gt;com.IRonak&lt;/groupId&gt;
      &lt;artifactId&gt;RestCurdo&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;RestCurdo&lt;/name&gt;
      &lt;description&gt;Demo project for Spring Boot&lt;/description&gt;
  
      &lt;properties&gt;
          &lt;java.version&gt;11&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;/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.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-devtools&lt;/artifactId&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
              &lt;optional&gt;true&lt;/optional&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
              &lt;scope&gt;runtime&lt;/scope&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;/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><strong>Repository</strong></p>
  <pre class="lang-java prettyprint-override"><code>public interface RestCurdRepo extends JpaRepository&lt;Employee, Integer&gt;{
  
  }
  
  </code></pre>