title: Spring : Unsatisfied dependency expressed through field, CrudRepository extended interface
body: <p>I have extended <code>CrudRepository&lt;ClassName, Id&gt;</code> in user defined Interface, but while trying to inject using <code>@Autowired</code> i am getting following given below error :</p>
  
  <blockquote>
    <p>creating bean with name 'helloController': Unsatisfied dependency
    expressed through field 'danCorePrivateRepository'; nested exception
    is org.springframework.beans.factory.NoSuchBeanDefinitionException: No
    qualifying bean of type
    'com.sgcorp.repository.DanCorePrivateRepository' available: expected
    at least 1 bean which qualifies as autowire candidate.</p>
  </blockquote>
  
  <p>HelloController.java</p>
  
  <pre><code>@RestController
  @RequestMapping("/hello")
  public class HelloController {
      @Autowired
      private DanCorePrivateRepository danCorePrivateRepository;
  
      @RequestMapping(value = "/service", method= RequestMethod.GET)
      public String selectService(){  
          String result = "&lt;html&gt;";   
          result += "&lt;div&gt;"+danCorePrivateRepository.findAll()+"&lt;/div&gt;";
          return result+ "&lt;/html&gt;";
      }
  }
  </code></pre>
  
  <p>DanCorePrivateRepository.java (user defined interface)</p>
  
  <pre><code>public interface DanCorePrivateRepository extends CrudRepository&lt;DanaModel, String&gt; {
  
  }
  </code></pre>
  
  <p>Kindly suggest why its not @Autowired properly?</p>
  
  <p><em>Note: with some other project it was working.</em></p>