title: CDI dependency injection fails on classes implementing interface
body: <p>Let's have this example:</p>
  
  <pre><code>public interface MyInterface {
      public void foo();
  }
  </code></pre>
  
  <p>and implementing class:</p>
  
  <pre><code>public class MyInterfaceImpl implements MyInterface {
      @Override
      public void foo() {...}
  }
  </code></pre>
  
  <p>When I try to inject dependent class MyResource into MyInterfaceImpl nothing happens without any error or warning however the MyResource is not injected so the code fails with NullPointerException:</p>
  
  <pre><code>public class MyInterfaceImpl implements MyInterface {
      @Inject
      private MyResource resource;
  
      @Override
      public void foo() {
          resource.doAnything() &lt;-- will throw NullPointerException
      }
  }
  </code></pre>
  
  <p>I packaged this in .war archive and deployed on Glassfish v4 with a simple Jersey application. I also tried to put beans.xml to WEB-INF and META-INF. </p>
  
  <p>After removing the "implements MyInterface" from MyInterfaceImpl class the injection works. Why is the dependency injection not working on classes implementing an interface?</p>