title: HTTP Status 403 error from glassfish 3 when trying to reach an implemented login page
body: <p>I have created a login page using a nice guide that I found about Java EE6 and GlassFish3 using netbeans.
  After deploying the project when I try to reach the login page I get 'HTTP Status 403 - Access to the requested resource has been denied' from GlassFish3 server.</p>
  
  <p>The url I am using is : <a href="http://localhost:9999/simplewebapp/admin/admin.jsp" rel="noreferrer">http://localhost:9999/simplewebapp/admin/admin.jsp</a>
  The guide says that I should automatically be redirected to the login page I have created.</p>
  
  <p>Instead I am receiving the above error.
  Looking at the glassfish3 log I am getting these two lines when I am entering the above url.</p>
  
  <p>INFO: JACC Policy Provider:Failed Permission Check: context (" simplewebapp/simplewebapp ") , permission (" (javax.security.jacc.WebUserDataPermission /admin/login.jsp GET) ") 
  INFO: JACC Policy Provider:Failed Permission Check: context (" simplewebapp/simplewebapp ") , permission (" (javax.security.jacc.WebUserDataPermission /admin/login.jsp GET:CONFIDENTIAL) ")</p>
  
  <p>Some more details :</p>
  
  <p>web.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"&gt;
      &lt;session-config&gt;
          &lt;session-timeout&gt;
              30
          &lt;/session-timeout&gt;
      &lt;/session-config&gt;
      &lt;security-constraint&gt;
          &lt;display-name&gt;Admin Pages&lt;/display-name&gt;
          &lt;web-resource-collection&gt;
              &lt;web-resource-name&gt;Administrative Pages&lt;/web-resource-name&gt;
              &lt;description/&gt;
              &lt;url-pattern&gt;/admin/*&lt;/url-pattern&gt;
          &lt;/web-resource-collection&gt;
          &lt;auth-constraint&gt;
              &lt;description&gt;admin&lt;/description&gt;
          &lt;/auth-constraint&gt;
      &lt;/security-constraint&gt;
      &lt;login-config&gt;
          &lt;auth-method&gt;FORM&lt;/auth-method&gt;
          &lt;realm-name&gt;file&lt;/realm-name&gt;
          &lt;form-login-config&gt;
              &lt;form-login-page&gt;/login.jsp&lt;/form-login-page&gt;
              &lt;form-error-page&gt;/loginerror.jsp&lt;/form-error-page&gt;
          &lt;/form-login-config&gt;
      &lt;/login-config&gt;
      &lt;security-role&gt;
          &lt;description&gt;Administrators&lt;/description&gt;
          &lt;role-name&gt;admin&lt;/role-name&gt;
      &lt;/security-role&gt;
      &lt;security-role&gt;
          &lt;description&gt;Users&lt;/description&gt;
          &lt;role-name&gt;user&lt;/role-name&gt;
      &lt;/security-role&gt;
  &lt;/web-app&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 error-url=""&gt;
    &lt;security-role-mapping&gt;
      &lt;role-name&gt;admin&lt;/role-name&gt;
      &lt;group-name&gt;appadmin&lt;/group-name&gt;
    &lt;/security-role-mapping&gt;
    &lt;class-loader delegate="true"/&gt;
    &lt;jsp-config&gt;
      &lt;property name="keepgenerated" value="true"&gt;
        &lt;description&gt;Keep a copy of the generated servlet class' java code.&lt;/description&gt;
      &lt;/property&gt;
    &lt;/jsp-config&gt;
  &lt;/glassfish-web-app&gt;
  </code></pre>
  
  <p>What am I doing wrong here?
  Thank you.</p>