title: CDI will not work with implicit @Dependent scope, unsatisfied injection point compile time error
body: <p>The container is Glassfish 4.1</p>
  
  <p>I am having a very weird issue with CDI right now. If I don't annotate my <code>NumberGenerator</code> services <code>@Dependent</code>, then I keep getting unsatisfied injection point error when I run the app. But if I explicitly annotate my <code>NumberGenerator</code> implementations, then everything will work. In one word, if I want dependency injection with the <code>@Dependent</code> which is the default scope, I must specify it explicitly.</p>
  
  <pre><code> public interface NumberGenerator {
      String generateNumber();  
   }
  </code></pre>
  
  <p>The first implementation of <code>NumberGenerator</code></p>
  
  <pre><code>import java.util.Random;
  import java.util.logging.Level;
  import java.util.logging.Logger;
  import javax.enterprise.context.Dependent;
  import javax.inject.Inject;
  
  @ThirteenDigits
  @Dependent
  public class IsbnGenerator implements NumberGenerator {
  
      @Inject
      private Logger logger;
  
      @Override
      public String generateNumber() {
          String isbn = "13-84356-" + Math.abs(new Random().nextInt());
          logger.log(Level.INFO, "Generated ISBN : {0}", isbn);
          return isbn;
      }
  
  }
  </code></pre>
  
  <p>The second implementation of <code>NumberGenerator</code></p>
  
  <pre><code>import java.util.Random;
  import java.util.logging.Logger;
  import javax.enterprise.context.Dependent;
  import javax.inject.Inject;
  
  @EightDigits
  @Dependent
  public class IssnGenerator implements NumberGenerator {
  
      @Inject
      private Logger logger;
  
      @Override
      public String generateNumber() {
          String issn = "8-" + Math.abs(new Random().nextInt());
          logger.info("Generated ISSN : " + issn);
          return issn;
      }
  
  }
  </code></pre>
  
  <p>This is where the <code>NumberGenerator</code> will be injected</p>
  
  <pre><code>import javax.enterprise.context.Dependent;
  import javax.inject.Inject;
  import javax.interceptor.Interceptors;
  
  
  @Dependent
  public class BookService {
  
      @Inject 
      @EightDigits
      private NumberGenerator numberGenerator;
  
      public Book createBook(String title, float price, String description) {
          Book book = new Book(title, price, description);
          book.setNumber(numberGenerator.generateNumber());
          return book;
      }
  
  }
  </code></pre>
  
  <p>Finally, the <code>BookService</code> is injected into this JSF managed bean to create a <code>Book</code> instance.</p>
  
  <pre><code>import javax.enterprise.context.Dependent;
  import javax.inject.Inject;
  import javax.inject.Named;
  
  
  @Named
  @Dependent /* if I leave this out, then this bean will not display 
                the book instance properties on the JSF page, I just see
                a blank screen, but when I add this @Dependent annotation
                the JSF page displays the dummy content below.
             */
  public class MyBean {
  
      @Inject
      private BookService bookService;
  
      public Book getBook() {
      return bookService.createBook("Dummy Title", 21.05f, "Dummy Description");
      }
  
  }
  </code></pre>
  
  <p>As you can see, I have to use <code>@Dependent</code> for the default scope every time I want DI. Right now, I am injecting the <code>IssnGenerator</code> with the qualifier <code>@EightDigits</code> into the <code>BookService</code> class, and if I remove the <code>@Dependent</code> from the <code>IssnGenerator</code>, I receive this compile error.</p>
  
  <pre><code> Unsatisfied dependencies for type NumberGenerator with qualifiers @EightDigits at injection point [BackedAnnotatedField] @Inject @EightDigits private BookService.numberGenerator
  </code></pre>
  
  <p>Thank you for any suggestion.</p>