title: Spring @Qualifier isn't working without @Primary
body: <p>So, I am trying to learn my way with Spring Boot. I tried @Qualifier and @Autowired but it gives me the following error:</p>
  
  <blockquote>
    <p>Parameter 0 of constructor in io.cptpackage.springboot.bootdemo.BinarySearch required a single bean, but 2 were found:</p>
  </blockquote>
  
  <p>Even tho I have provided the right @Qualifier it doesn't work until one of the dependencies has a @Primary annotation, also the name reference doesn't work I to use @Primary or @Qualifier and you know that I am having the issue with the @Qualifier thing. The code is simple and as following.</p>
  
  <pre><code>@Component 
  public class BinarySearch {
  
  // Sort, Search, Return the result!
  @Autowired
  @Qualifier("quick")
  Sorter sorter;
  
  public BinarySearch(Sorter sorter) {
      super();
      this.sorter = sorter;
  }
  
  public int search(int[] numbersToSearchIn, int targetNumber) {
      sorter.sort(numbersToSearchIn);
      return targetNumber;
   } 
  }
  </code></pre>
  
  <p>The first dependency:</p>
  
  <pre><code>@Component
  @Qualifier("bubble")
  public class BubbleSort implements Sorter {
  
      @Override
      public int[] sort(int[] targetArray) {
          System.out.println("Bubble sort!");
          return targetArray;
      }
  
  }
  </code></pre>
  
  <p>The second dependency:</p>
  
  <pre><code>@Component
  @Qualifier("quick")
  public class QuickSort implements Sorter {
  
      @Override
      public int[] sort(int[] targetArray) {
          System.out.println("Quick Sort!");
          return targetArray;
      }
  
  }
  </code></pre>
  
  <p>Also why is autowiring by name isnot working?</p>