title: 'No qualifying bean of type' in a web application Spring Boot
body: <p>I'm building a web application in spring boot  and I am facing this error it can't find the bean 'MedecinDao' nevertheless I added @component in MedecinDao
  and for medecinDao it's an interface
  can anyone helps me ?  </p>
  
  <pre><code>    Exception in thread "main" org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'dreamHospital.Dao.MedecinRepository' available
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:351)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:342)
      at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1126)
      at com.DreamHospital.DreamHospital.DreamHospitalApplication.main(DreamHospitalApplication.java:23
  </code></pre>
  
  <pre><code>@SpringBootApplication
  public class DreamHospitalApplication {
  
      public static void main(String[] args) {
          ConfigurableApplicationContext context= SpringApplication.run(DreamHospitalApplication.class, args);
  
  
          MedecinDao MD  = context.getBean(MedecinDao.class);
          medecin M1 = new medecin("Azzedine RIHANE","Dermatologiste");
          medecin M2 = new medecin("Riadh Bouftira","Médecin de famille");
          medecin M3 = new medecin("Khaled Machraoui","Médecin de famille");
          medecin M4 = new medecin("Mohamed Moalla","Rhumatologue");
          medecin M5 = new medecin("Abderrazek Mnif","Urologue");
          medecin M6 = new medecin("ghezel slim","Dermatologiste");
          medecin M7 = new medecin("Mounir Makni","Gynécologue");
  </code></pre>
  
  <pre><code>@Component
  public interface MedecinDao extends JpaRepository&lt;medecin, UUID&gt;{
  
      List&lt;medecin&gt; findAll();
      List&lt;medecin&gt; findBySpecialite(String specialite);
  
      List&lt;medecin&gt; findByPatients(patient patient);
  
      @Override
      default Optional&lt;medecin&gt; findById(UUID id) {
          // TODO Auto-generated method stub
          return null;
      }
  
      @Query("select patients from medecin m where m.idM like : x")
      List&lt;patient&gt; findPatients(@Param("x")UUID idM);
  
      @Override
      default void deleteById(UUID id) {
          // TODO Auto-generated method stub  
      }
  }
  
  </code></pre>