title: Field ** in com.** required a bean of type 'com.**' that could not be found
body: <p>I'm following <a href="http://www.thejavageek.com/2017/06/16/crud-application-using-angular-4-spring-rest-web-services-spring-data-jpa/" rel="nofollow noreferrer">this tutorial</a> and I'm having some trouble starting my application.</p>
  
  <p>When I run <code>mvn spring-boot:run</code> in the backend folder I get the following error:</p>
  
  <blockquote>
    <p>Field movieRepository in com.movieseat.services.impl.MovieServiceImpl required a bean of type 'com.movieseat.repositories.MovieRepository' that could not be found.</p>
  </blockquote>
  
  <p>MovieServiceIml.java</p>
  
  <pre><code>package com.movieseat.services.impl;
  
  // Java imports
  import java.util.ArrayList;
  import java.util.Iterator;
  import java.util.List;
  
  // Spring imports
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.stereotype.Service;
  
  // Project imports
  import com.movieseat.models.Movie;
  import com.movieseat.services.MovieService;
  import com.movieseat.repositories.MovieRepository;
  
  @Service
  public class MovieServiceImpl implements MovieService {
  
      @Autowired private MovieRepository movieRepository;
  
      @Override public List&lt;Movie&gt; getAllmovies() {
          List&lt;Movie&gt; movies = new ArrayList&lt;Movie&gt;();
          Iterator&lt;Movie&gt; iterator = movieRepository.findAll().iterator();
          while (iterator.hasNext()) {
              movies.add(iterator.next());
          }
  
          return movies;
      }
  
  }
  </code></pre>
  
  <p>MovieRepository.java</p>
  
  <pre><code>package com.movieseat.repositories;
  
  // Java imports
  import java.io.Serializable;
  
  // Spring imports
  import org.springframework.data.repository.CrudRepository;
  import org.springframework.stereotype.Repository;
  
  // Project imports
  import com.movieseat.models.Movie;
  
  @Repository
  public interface MovieRepository extends CrudRepository&lt;Movie, Serializable&gt; {}
  </code></pre>
  
  <p>The following structure is used:</p>
  
  <ul>
  <li>com
  
  <ul>
  <li>movieseat
  
  <ul>
  <li>Application.java</li>
  <li>controllers
  
  <ul>
  <li>MovieController.java</li>
  </ul></li>
  <li>models
  
  <ul>
  <li>MovieModel.java</li>
  </ul></li>
  <li>repositories
  
  <ul>
  <li>MovieRepository.java</li>
  </ul></li>
  <li>services
  
  <ul>
  <li>impl
  
  <ul>
  <li>MovieServiceImpl.java</li>
  </ul></li>
  <li>MovieService.java</li>
  </ul></li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>And this is my Application.java:</p>
  
  <pre><code>package com.movieseat;
  
  // Spring importss
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  import org.springframework.boot.web.support.SpringBootServletInitializer;
  import org.springframework.context.annotation.ComponentScan;
  import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
  
  @SpringBootApplication
  @ComponentScan({"com.movieseat.*"})
  @EnableJpaRepositories("com.movieseat.repositories.*")
  public class Application extends SpringBootServletInitializer {
      public static void main(String[] args) {
          SpringApplication.run(Application.class, args);
      }
  }
  </code></pre>
  
  <p>My thought is that using <code>@EnableJpaRepositories("com.movieseat.repositories.*")</code> would make all repositories accessible. But I'm doing something wrong.</p>