title: JavaEE on NetBeans 7.4 GlassFish 4 not deployed
body: <p>I create a JavaEE project its name EnterpriseApplication6
  I create a New SessionBean in EnterpriseApplication6-ejb its name NewSessionBean and its Session type stateless with local interface
  I creaet a New Servlet in EnterpriseApplication6-war its name NewServlet
  The problem occure when I declare the NewSessionBean in NewServlet then this error will appear :
  1- NewServlet will run like this[]:(<a href="https://www.dropbox.com/s/rssmhvtu5kzor05/Untitled.png" rel="nofollow">https://www.dropbox.com/s/rssmhvtu5kzor05/Untitled.png</a>)
  2- and this error appear
  This is the error
  C:\Users\AdminPC\Documents\NetBeansProjects\EnterpriseApplication6\nbproject\build-impl.xml:307: The module has not been deployed.
  See the server log for details.</p>
  
  <p>when I delete the declaration the project will be Ok
  How can I solve this problem?</p>
  
  <p>NewServlet code:</p>
  
  <pre><code>    /*
   * To change this license header, choose License Headers in Project Properties.
   * To change this template file, choose Tools | Templates
   * and open the template in the editor.
   */
  
  package b;
  
  import bbb.NewSessionBean;
  import bbb.NewSessionBeanLocal;
  import java.io.IOException;
  import java.io.PrintWriter;
  import javax.ejb.EJB;
  
  import javax.servlet.ServletException;
  import javax.servlet.annotation.WebServlet;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  /**
   *
   * @author AdminPC
   */
  
  
  @WebServlet(name = "NewServlet", urlPatterns = {"/NewServlet"})
  public class NewServlet extends HttpServlet {
  
      /**
       * Processes requests for both HTTP &lt;code&gt;GET&lt;/code&gt; and &lt;code&gt;POST&lt;/code&gt;
       * methods.
       *
       * @param request servlet request
       * @param response servlet response
       * @throws ServletException if a servlet-specific error occurs
       * @throws IOException if an I/O error occurs
       */
      @EJB
      NewSessionBeanLocal g;
      protected void processRequest(HttpServletRequest request, HttpServletResponse response)
              throws ServletException, IOException {
          response.setContentType("text/html;charset=UTF-8");
          try (PrintWriter out = response.getWriter()) {
              /* TODO output your page here. You may use following sample code. */
              out.println("&lt;!DOCTYPE html&gt;");
              out.println("&lt;html&gt;");
              out.println("&lt;head&gt;");
              out.println("&lt;title&gt;Servlet NewServlet&lt;/title&gt;");            
              out.println("&lt;/head&gt;");
              out.println("&lt;body&gt;");
              out.println("&lt;h1&gt;Servlet NewServlet at " + g.show() + "&lt;/h1&gt;");
              out.println("&lt;/body&gt;");
              out.println("&lt;/html&gt;");
          }
      }
  
      // &lt;editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."&gt;
      /**
       * Handles the HTTP &lt;code&gt;GET&lt;/code&gt; method.
       *
       * @param request servlet request
       * @param response servlet response
       * @throws ServletException if a servlet-specific error occurs
       * @throws IOException if an I/O error occurs
       */
      @Override
      protected void doGet(HttpServletRequest request, HttpServletResponse response)
              throws ServletException, IOException {
          processRequest(request, response);
      }
  
      /**
       * Handles the HTTP &lt;code&gt;POST&lt;/code&gt; method.
       *
       * @param request servlet request
       * @param response servlet response
       * @throws ServletException if a servlet-specific error occurs
       * @throws IOException if an I/O error occurs
       */
      @Override
      protected void doPost(HttpServletRequest request, HttpServletResponse response)
              throws ServletException, IOException {
          processRequest(request, response);
      }
  
      /**
       * Returns a short description of the servlet.
       *
       * @return a String containing servlet description
       */
      @Override
      public String getServletInfo() {
          return "Short description";
      }// &lt;/editor-fold&gt;
  
  }
  </code></pre>