title: Parameter 0 of constructor in ' ' required a bean of type ' ' that could not be found
body: <p>I am creating a <code>spring boot application</code>, wherein any client can submit the request, these request can be <code>GET</code>, <code>PUT</code>, <code>POST</code>, <code>DELETE</code>.</p>
  <p>But while creating this application, I am getting the following errors:</p>
  <pre><code>***************************
  APPLICATION FAILED TO START
  ***************************
  
  Description:
  
  Parameter 0 of constructor in com.idr.springboot.service.PersonService required a bean of type 'com.idr.springboot.dao.PersonDao' that could not be found.
  
  The following candidates were found but could not be injected:
      - User-defined bean
  
  
  Action:
  
  Consider revisiting the entries above or defining a bean of type 'com.idr.springboot.dao.PersonDao' in your configuration.
  </code></pre>
  <p>The structure of my application is:</p>
  <p><a href="https://i.stack.imgur.com/zrWiZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zrWiZ.png" alt="enter image description here" /></a></p>
  <p><strong>PersonDao.java</strong></p>
  <pre><code>package com.idr.springboot.dao;
  
  import com.idr.springboot.model.Person;
  import java.util.UUID;
  
  
  public interface PersonDao {
  
      int insertPerson(UUID id, Person person);
  
      default int insertPerson(Person person) {
          UUID id = UUID.randomUUID();
          return insertPerson(id, person);
      }
  
  
  }
  </code></pre>
  <p><strong>PersonService.java</strong></p>
  <pre><code>package com.idr.springboot.service;
  
  import com.idr.springboot.dao.PersonDao;
  import com.idr.springboot.model.Person;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.beans.factory.annotation.Qualifier;
  import org.springframework.stereotype.Service;
  
  @Service
  public class PersonService {
  
  
      private final PersonDao personDao;
  
      @Autowired
      public PersonService(@Qualifier(&quot;fake demo&quot;) PersonDao personDao) {
          this.personDao = personDao;
      }
  
  
      public int addPerson(Person person) {
          return personDao.insertPerson(person);
      }
  }
  </code></pre>
  <p>I know that many questions with the following error, are already been asked, but still I am not able to solve this.</p>
  <pre><code>Parameter 0 of constructor in com.idr.springboot.service.PersonService required a bean of type 'com.idr.springboot.dao.PersonDao' that could not be found.
  </code></pre>
  <p>I have tried to annotate <code>PersonDao.java</code> with <code>@Service</code>, <code>@Repository</code>, <code>@Component</code>, but still I am getting the same error.</p>
  <p>I have even tried solutions from these SO answers :</p>
  <p>(1) <a href="https://stackoverflow.com/questions/52841620/parameter-0-of-constructor-in-required-a-bean-of-type-java-lang-string-that-co">Parameter 0 of constructor in required a bean of type &#39;java.lang.String&#39; that could not be found</a></p>
  <p>(2) <a href="https://stackoverflow.com/questions/52180328/spring-error-parameter-0-of-constructor-in-service-required-a-bean-of-type-con">Spring - Error Parameter 0 of constructor in Service required a bean of type Configuration that could not be found</a></p>
  <p>(3) <a href="https://stackoverflow.com/questions/50412208/parameter-0-of-constructor-in-spring-boot">Parameter 0 of constructor in ..... Spring Boot</a></p>
  <p>But still I am not able to resolve my issue.</p>