title: @Inject Warning Eclipse JBoss DS; injecting interface - no concrete class
body: <p>I'm using Spring 4.2.4 and MyFaces 2.2.9, Java 1.8.</p>
  
  <p>I've created a Factory Pattern following this example; <a href="http://kh-yiu.blogspot.in/2013/04/spring-implementing-factory-pattern.html" rel="nofollow">Spring: implementing the Factory pattern</a></p>
  
  <p>We have the <strong>Interface</strong>;</p>
  
  <pre><code>package com.jsf2.strategy;
  
  public interface PrintStrategyFactory {         
      IPrintStrategy getStrategy(String strategyName); 
  }
  </code></pre>
  
  <p>And in <strong>applicationContext.xml</strong>;</p>
  
  <pre><code>&lt;bean id="printStrategyFactory" class="org.springframework.beans.factory.config.ServiceLocatorFactoryBean"&gt;
      &lt;property name="serviceLocatorInterface" value="com.jsf2.strategy.PrintStrategyFactory" /&gt;
  &lt;/bean&gt;
  
  &lt;alias name="A4Portrait" alias="A4P" /&gt;
  &lt;alias name="A4Landscape" alias="A4L" /&gt;
  &lt;alias name="A5Portrait" alias="A5P" /&gt;
  &lt;alias name="A5Landscape" alias="A5L" /&gt;
  &lt;alias name="A4Portrait" alias="DEFAULT" /&gt;
  </code></pre>
  
  <p>So there is <strong>no concrete class</strong> of PrintStrategyFactory, only the Interface.</p>
  
  <p>I'm trying to use CDI syntax to inject the interface;</p>
  
  <pre><code>@Component
  @Scope("singleton")
  public class TestBean {
  
  @Inject  // I get warning here
  @Autowired // NO WARNING
  private PrintStrategyFactory printStrategyFactory;
  
  @PostConstruct
  private void init() {
  . . . . . .
  </code></pre>
  
  <p>The @Autowired; <em>displays no warning</em>.</p>
  
  <p>Using @Inject displays; </p>
  
  <blockquote>
    <p>No bean is eligible for injection to the injection point [JSR-299 §5.2.1]</p>
  </blockquote>
  
  <p>At run-time, both ways work but I'm attempting to use CDI syntax.</p>
  
  <p>If I add a Concrete class implementing the interface, the warning goes away.</p>
  
  <p>Should I just suppress the warning or is there an alternative resolution?</p>