title: Spring boot @Autowired can't initialise class
body: <p>I have following class as:-</p>
  
  <pre><code>@SpringBootApplication
  @ComponentScan("com.ma.demospringboot")
  public class DemoSpringBootApp {
     public static void main(String[] args) {
        SpringApplication.run(DemoSpringBootApp.class, args);
     }
  }
  </code></pre>
  
  <p>I have following class as:-</p>
  
  <pre><code>@Service
  public class TopicService {
      // if I comment out following autowired, then it is ok.
      @Autowired
      private TopicRepository topicRepository; 
  }
  </code></pre>
  
  <p>I have following interface as:-</p>
  
  <pre><code>public interface TopicRepository extends  CrudRepository&lt;Topic, String&gt; {
  }
  </code></pre>
  
  <p>I have following class as:-</p>
  
  <pre><code>@Entity 
  public class Topic {
      @Id
      private String id;
      private String name;
      private String description;
  
      public Topic() {
      }
  }
  </code></pre>
  
  <p>I got following error when try to execute:-</p>
  
  <hr>
  
  <p>APPLICATION FAILED TO START</p>
  
  <hr>
  
  <p>Description:</p>
  
  <blockquote>
    <p>Field topicRepository in com.ma.demospringboot.service.TopicService
    required a bean of type
    'com.ma.demospringboot.repository.TopicRepository' that could not be
    found.</p>
  </blockquote>
  
  <p>Action:</p>
  
  <blockquote>
    <p>Consider defining a bean of type
    'com.ma.demospringboot.repository.TopicRepository' in your
    configuration.</p>
  </blockquote>