title: The requested resource is not available Glassfish 4
body: <p>I have recently started working on web applications and was trying to set up a practise project to try out different things. But I am stuck at a very initial stage and I googled a lot but could not find the solution to my problem. I have associated the project with an EAR project and the ear is deployed on the server.</p>
  
  <p>This is the project setup I am facing problems with :</p>
  
  <p>web.xml</p>
  
  <pre><code>   &lt;?xml version="1.0" encoding="UTF-8"?&gt;
     &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns="http://xmlns.jcp.org/xml/ns/javaee"
      xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
      id="WebApp_ID" version="3.1"&gt;
          &lt;display-name&gt;College Administration&lt;/display-name&gt;
          &lt;servlet&gt;
              &lt;servlet-name&gt;loginServlet&lt;/servlet-name&gt;
              &lt;servlet-class&gt;kumar.suraj.college.administration.login.LoginServlet&lt;/servlet-class&gt;
          &lt;/servlet&gt;
          &lt;servlet-mapping&gt;
              &lt;servlet-name&gt;loginServlet&lt;/servlet-name&gt;
              &lt;url-pattern&gt;/login&lt;/url-pattern&gt;
          &lt;/servlet-mapping&gt;
     &lt;/web-app&gt;
  </code></pre>
  
  <p>application.xml</p>
  
  <pre><code>  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
    &lt;application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee"   xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/application_7.xsd" id="Application_ID"   version="7"&gt;
    &lt;display-name&gt;web-college-administrationEar&lt;/display-name&gt;
    &lt;module&gt;
         &lt;web&gt;
             &lt;web-uri&gt;web-college-administration.war&lt;/web-uri&gt;
             &lt;context-root&gt;web-college-administration&lt;/context-root&gt;
         &lt;/web&gt;
    &lt;/module&gt;
    &lt;/application&gt;
  </code></pre>
  
  <p>glassfish-web.xml</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
   &lt;!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish  Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish- web-app_3_0-1.dtd"&gt;
   &lt;glassfish-web-app&gt;
        &lt;context-root&gt;web-college-administration&lt;/context-root&gt;
   &lt;/glassfish-web-app&gt;
  </code></pre>
  
  <p>login.jsp</p>
  
  <pre><code>    &lt;!DOCTYPE html&gt;
      &lt;html&gt;
      &lt;head&gt;
           &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
           &lt;title&gt;Login Page&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;form name="login" action="login" method="post" accept-charset="utf-8"&gt;
               &lt;label for="usermail  "&gt;Email&lt;/label&gt; 
               &lt;input type="email" name="usermail" placeholder="yourname@email.com" required&gt;
               &lt;br/&gt; 
               &lt;label for="password  "&gt;Password&lt;/label&gt; 
               &lt;input type="password" name="password" placeholder="password" required&gt; 
               &lt;br/&gt;      
               &lt;input type="submit" value="Login"&gt;
           &lt;/form&gt;
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>LoginServlet.java</p>
  
  <pre><code>package kumar.suraj.college.administration.login;
  
  import java.io.IOException;
  import javax.servlet.ServletException;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  /**
  * Servlet implementation class LoginServlet
  */
  public class LoginServlet extends HttpServlet {
      private static final long serialVersionUID = 1L;
  
  /**
   * @see HttpServlet#HttpServlet()
   */
  public LoginServlet() {
      super();
      // TODO Auto-generated constructor stub
  }
  
  /**
   * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
   *      response)
   */
  @Override
  protected void doGet(final HttpServletRequest request, final HttpServletResponse response)
          throws ServletException, IOException {
      // TODO Auto-generated method stub
      response.getWriter().append("Served at: ").append(request.getContextPath());
      response.getWriter().append("Hello Suraj");
  }
  
  /**
   * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
   *      response)
   */
  @Override
  protected void doPost(final HttpServletRequest request, final HttpServletResponse response)
          throws ServletException, IOException {
      // TODO Auto-generated method stub
      this.doGet(request, response);
    }
  
  }
  </code></pre>
  
  <p>The login.jsp is placed in WebContent/WEB-INF folder of my project.</p>
  
  <p>When I hit the url <a href="http://localhost:53809/web-college-administration/login" rel="nofollow">http://localhost:53809/web-college-administration/login</a></p>
  
  <p>I get the following out put "Served at: /web-college-administrationHello Suraj" as per the doGet method of LoginServlet.java.</p>
  
  <p>But when I hit the url <a href="http://localhost:53809/web-college-administration/login.jsp" rel="nofollow">http://localhost:53809/web-college-administration/login.jsp</a> I get the following error :</p>
  
  <pre><code>   HTTP STATUS 404 - NOT FOUND
     type status report
     message Not Found
     description The requested resource is not available.
  </code></pre>
  
  <p>And in eclipse console I get the following message : </p>
  
  <pre><code>   2016-07-03T16:34:18.969+0530|Severe: PWC6117: File "null" not found.
  </code></pre>
  
  <p>Could someone please tell me what is wrong with my setup ?</p>