title: Glassfish 4, simple example in CDI fails with WELD-001408 Unsatisfied dependencies
body: <p>I am a very newbie in CDI. This is my FIRST example and I am trying to run it. Having searched the internet I wrote the following code:
  Class that I want to be injected</p>
  
  <pre><code>public class Temp {
  
  public Temp(){
  
  }
  
  public String getMe(){
      return "something";
  }
  }
  </code></pre>
  
  <p>Servlet</p>
  
  <pre><code>@WebServlet(name = "NewServlet", urlPatterns = {"/NewServlet"})
  public class NewServlet extends HttpServlet {
  
  @Inject
  public Temp temp;
  
  protected void processRequest(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
      response.setContentType("text/html;charset=UTF-8");
      try (PrintWriter out = response.getWriter()) {
          out.println("&lt;body&gt;");
          out.println("&lt;h1&gt; Here it is"+temp.getMe()+ "&lt;/h1&gt;");
          out.println("&lt;/body&gt;");
      }
  }
  ...
  </code></pre>
  
  <p>But I have to following error in glassfish 4:</p>
  
  <blockquote>
    <p>org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied
    dependencies for type [Temp] with qualifiers [@Default] at injection
    point [[BackedAnnotatedField] @Inject private
    xxx.example.NewServlet.temp]</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>