Annotations on Interfaces in Spring
<p>I have problems autowiring beans which are derived from interfaces with annotations.</p>

<pre><code>@Component
@EnableAsync
public interface Calculator {
  @Async
  public Future&lt;String&gt; calculate();
}

public interface SpecificCalculator extends Calculator {
}

public class ConcreteSpecificCalculator implements SpecificCalculator {

  @Override
  public Future&lt;String&gt; calculate() {
    // do calculation here
    return new AsyncResult&lt;String&gt;("hello");
  }

}
</code></pre>

<p>From what I understood from: <a href="https://stackoverflow.com/questions/146391/annotations-on-interfaces">Annotations on Interfaces?</a> the @Component Annotation should also apply to all subclasses. Now I have a Mapper class returning all types that are derived from SpecificCalculator.</p>

<pre><code>@Component
public class CalculatorMapper {

@Autowired
private List&lt;SpecificCalculator&gt; specificCalculators;

public List&lt;Calculator&gt; retrieveCalculatorsByModuleId(Integer moduleId) {
  if(moduleId==...){
    return specificCalculators;
  }else{
  ...
  }
}
</code></pre>

<p>This is not working. Spring does not find the ConcreteSpecificCalculator and is not injecting it. If I Annotate ConcreteSpecificCalculator with @Component again, it is working. Can anybody explain this to me? </p>