title: Im geting the error Parameter 0 of constructor required a single bean, but 2 were found but one of the beans "found" has been deleted by me
body: <p>Im trying to set up a h2 database using jpa/jdbc, after creating an implemntation for a query interface using jpa as opposed to jdbc i am now getting the error:</p>
  
  <p>Parameter 0 of constructor in com.nsa.charitystarter.service.CharityQueries required a single bean, but 2 were found:
      - charityRepoJDBC: defined in file [C:\Users\V La Roche\Desktop\assessment-1-starter\out\production\classes\com\nsa\charitystarter\data\CharityRepoJDBC.class]
      - charityRepoJPA: defined in null</p>
  
  <p>Im unsure as to what has gone wrong and am not really sure where to go from here, i havent been able to find many people with a similar issue to me online.</p>
  
  <p>My implementation using jdbc</p>
  
  <pre class="lang-java prettyprint-override"><code>@Repository
  public class CharityRepoJDBC implements CharityRepository {
  
      private JdbcTemplate jdbc;
      private RowMapper&lt;Charity&gt; charityMapper;
  
      @Autowired
      public CharityRepoJDBC(JdbcTemplate aTemplate) {
          jdbc = aTemplate;
  
  
          charityMapper = (rs, i) -&gt; new Charity(
                  rs.getLong("id"),
                  rs.getString("name"),
                  rs.getString("registration_id"),
                  rs.getString("acronym"),
                  rs.getString("purpose")
          );
      }
  
      @Override
      public List&lt;Charity&gt; findCharityBySearch(String searchTerm) {
  
          String likeSearch = "%" + searchTerm + "%";
  
          return jdbc.query(
                  "select id, acronym, name, purpose, logo_file_name, registration_id  " +
                          "from charity " +
                          "where concat(name, acronym, purpose, registration_id) like ?",
                  new Object[]{likeSearch},
                  charityMapper);
      }
  
      @Override
      public Optional&lt;Charity&gt; findById(Long id) {
          return Optional.of(
                  jdbc.queryForObject(
                          "select id, acronym, name, purpose, logo_file_name, registration_id  from charity where id=?",
                          new Object[]{id},
                          charityMapper)
          );
      }
  }
  </code></pre>
  
  <p>Charity finder implementation:</p>
  
  <pre class="lang-java prettyprint-override"><code>@Service
  public class CharityQueries implements CharityFinder {
      private CharityRepository charityRepository;
  
  
      public CharityQueries(CharityRepository repo) {
          charityRepository = repo;
      }
  
      public Optional&lt;Charity&gt; findCharityByIndex(Integer index) {
          return charityRepository.findById(index.longValue());
      }
  
      public List&lt;Charity&gt; findCharityBySearch(String searchTerm) {
  
          return charityRepository.findCharityBySearch(searchTerm);
      }
  }
  </code></pre>
  
  <p>CharityFinder interface</p>
  
  <pre class="lang-java prettyprint-override"><code>public interface CharityFinder {
  
      public Optional&lt;Charity&gt; findCharityByIndex(Integer index);
  
      public List&lt;Charity&gt; findCharityBySearch(String searchTerm);
  
  }
  </code></pre>
  
  <p>error log :</p>
  
  <pre><code>***************************
  APPLICATION FAILED TO START
  ***************************
  
  Description:
  
  Parameter 0 of constructor in com.nsa.charitystarter.service.CharityQueries required a single bean, but 2 were found:
      - charityRepoJDBC: defined in file [C:\Users\V La Roche\Desktop\assessment-1-starter\out\production\classes\com\nsa\charitystarter\data\CharityRepoJDBC.class]
      - charityRepoJPA: defined in null
  
  
  Action:
  
  Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed
  
  
  Process finished with exit code 0
  </code></pre>