title: Spring not able to locate JpaRepository
body: <p>Using JavaConfig I have a problem locating the <code>@Repository</code> Spring beans.</p>
  
  <p>The repository interface is defined like this:</p>
  
  <pre><code>@Repository
  public interface UserRepository extends JpaRepository&lt;User, Long&gt; {
  
      User findByUsername(String username);
  
  }
  </code></pre>
  
  <p>The configuration is defined like this:</p>
  
  <pre><code>@Configuration
  @ComponentScan("com.example")
  @EnableAutoConfiguration
  @EnableJpaRepositories("com.example")
  public class SampleApplication extends SpringBootServletInitializer {
  ...
  </code></pre>
  
  <p>the package structure looks like this:</p>
  
  <pre><code>com.example
       configuration
             SampleApplication
       repository
             UserRepository
  </code></pre>
  
  <p>In the log file I see that the Repository is <strong>found</strong> as a candidate for bean definition, but:</p>
  
  <pre><code>ClassPathBeanDefinitionScanner | Ignored because not a concrete top-level class:
  </code></pre>
  
  <p><strong>Interesting fact</strong></p>
  
  <p>if I move the SampleApplication class to the <code>com.example</code> package, everything starts to work.</p>
  
  <p>Any ideas what I'm missing?</p>