title: Required a bean of type Repository that could not be found
body: <p>I am setting up a new Spring project for some fun learning/tutorial at home and I seem to run into a fairly common issue but I have tried all possible solutions I found on here but with no luck. Basically what I have is as follows:</p>
  <p>Controller class:</p>
  <pre><code>@RestController
  @RequestMapping(value = &quot;/shop&quot;)
  public class ShopController {
  
      @Autowired
      ShopService shopService;
  
      @GetMapping(value = &quot;/{id}&quot;)
      public @ResponseBody Shop getTestData(@PathVariable String id) {
          return shopService.getShopBasedOnId(id);
      }
  
  }
  </code></pre>
  <p>Service class:</p>
  <pre><code>@Service
  public class ShopService {
  
      @Autowired
      private ShopRepository shopRepository;
  
      public ShopService(ShopRepository shopRepository){
          this.shopRepository = shopRepository;
      }
  
      public Shop getShopBasedOnId(String id) {
          return shopRepository.findByShopId(id);
      }
  }
  </code></pre>
  <p>Repository class:</p>
  <pre><code>@Repository
  public interface ShopRepository extends PagingAndSortingRepository&lt;Shop, String&gt; {
  
          Shop findByShopId(String shopId);
  }
  </code></pre>
  <p>Application class:</p>
  <pre><code>@SpringBootApplication
  @EnableJpaRepositories(&quot;com.example.reservations.repository&quot;)
  public class ReservationsApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(ReservationsApplication.class, args);
      }
  
  }
  </code></pre>
  <p>Last but not least my pom.xml with the dependencies:</p>
  <pre><code>&lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.data&lt;/groupId&gt;
              &lt;artifactId&gt;spring-data-couchbase&lt;/artifactId&gt;
              &lt;version&gt;4.0.1.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.validation&lt;/groupId&gt;
              &lt;artifactId&gt;validation-api&lt;/artifactId&gt;
              &lt;version&gt;2.0.1.Final&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
              &lt;version&gt;5.2.7.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.data&lt;/groupId&gt;
              &lt;artifactId&gt;spring-data-jpa&lt;/artifactId&gt;
              &lt;version&gt;2.3.1.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate.javax.persistence&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-jpa-2.1-api&lt;/artifactId&gt;
              &lt;version&gt;1.0.2.Final&lt;/version&gt;
          &lt;/dependency&gt;
  </code></pre>
  <p>So the error code I am getting is as follows:</p>
  <pre><code>Description:
  
  Parameter 0 of constructor in com.example.reservations.services.ShopService required a bean of type 'com.example.reservations.repository.ShopRepository' that could not be found.
  
  The injection point has the following annotations:
      - @org.springframework.beans.factory.annotation.Autowired(required=true)
  
  
  Action:
  
  Consider defining a bean of type 'com.example.reservations.repository.ShopRepository' in your configuration.
  </code></pre>
  <p>My structure of folders is:</p>
  <pre><code>main
   |_java
      |_com.example.reservations
           |_controllers
                |_ShopController.java
           |_repository
                |_ShopRepository.java
           |_services
                |_ShopService.java
           |_ReservationsApplication.java
  </code></pre>