title: Can CDI inject standard library POJOs into an EJB?
body: <p>I can inject my own POJO into a managed object like this:</p>
  
  <pre><code>import javax.ejb.Stateless;
  import javax.inject.Inject;
  @Stateless
  public class SomeEjb {
      @Inject
      private SomePojo somePojo;
  }
  </code></pre>
  
  <p>And I have this POJO:</p>
  
  <pre><code>// No annotations
  public class SomePojo {   
  }
  </code></pre>
  
  <p>This works fine. If I inject the EJB into a JSF backing-bean, I can see that the value of <code>somePojo</code> is non-null value, as expected.</p>
  
  <p>However, if I try to inject a <code>java.util.Date</code> into <code>SomeEjb</code>, I get the following exception on deployment:</p>
  
  <pre><code>Severe: Exception while loading the app : WELD-001408 Unsatisfied dependencies for type [Date] with qualifiers [@Default] at injection point [[field] @Inject private SomeEjb.date]
  org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [Date] with qualifiers [@Default] at injection point [[field] @Inject private SomeEjb.date]
      at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:311)
  </code></pre>
  
  <p>SomeEjb now:</p>
  
  <pre><code>// No annotations
  public class SomeEjb {
      @Inject
      private Date date;    
  }
  </code></pre>
  
  <p>Date has a public, no-argument constructor, and I thought that's all CDI would need to "satisfy the dependency". I'm sure this behaviour is "to spec", but clearly there's a big hole in my understanding of CDI.</p>
  
  <p>Can someone explain why this doesn't work? What's the difference between <code>SomePojo</code> and <code>java.util.Date</code> from a CDI perspective?</p>
  
  <p>Context:</p>
  
  <ul>
  <li>Java EE 6</li>
  <li>GlassFish 3.1.2.2</li>
  <li>I don't have a use-case for this. I know that I can just specify <code>new Date()</code>.</li>
  </ul>