title: SEVERE: jdbcrealm.invaliduserreason WEB9102: Web Login Failed
body: <p>I'm trying to get my login form to with a MySQL Database and keep on getting the following error:</p>
  
  <p>[update] --> I made some modification today this is what I'm getting right now:</p>
  
  <pre><code>SEVERE: jdbcrealm.invaliduserreason
  WARNING: WEB9102: Web Login Failed: com.sun.enterprise.security.auth.login.common.LoginException: Login failed: Security Exception
  WARNING: WEB9102: Web Login Failed: com.sun.enterprise.security.auth.login.common.LoginException: Login failed: Security Exception
  WARNING: WEB9102: Web Login Failed: com.sun.enterprise.security.auth.login.common.LoginException: Login failed: Security Exception
  </code></pre>
  
  <p>That's all I get from the stack trace. I'm following this tutorial: <a href="http://blog.eisele.net/2011/01/jdbc-security-realm-and-form-based.html" rel="nofollow noreferrer">http://blog.eisele.net/2011/01/jdbc-security-realm-and-form-based.html</a></p>
  
  <p>This is my mapping on glassfish-web.xml:</p>
  
  <pre><code>  &lt;security-role-mapping&gt;
      &lt;role-name&gt;user&lt;/role-name&gt;
      &lt;group-name&gt;user&lt;/group-name&gt;
    &lt;/security-role-mapping&gt;
  </code></pre>
  
  <p>This is my web.xml:</p>
  
  <pre><code>&lt;security-constraint&gt;
      &lt;display-name&gt;user&lt;/display-name&gt;
      &lt;web-resource-collection&gt;
          &lt;web-resource-name&gt;Users Area&lt;/web-resource-name&gt;
          &lt;description&gt;Protected Users Area&lt;/description&gt;
          &lt;url-pattern&gt;/user/*&lt;/url-pattern&gt;
          &lt;http-method&gt;GET&lt;/http-method&gt;
          &lt;http-method&gt;PUT&lt;/http-method&gt;
          &lt;http-method&gt;HEAD&lt;/http-method&gt;
          &lt;http-method&gt;POST&lt;/http-method&gt;
          &lt;http-method&gt;OPTIONS&lt;/http-method&gt;
          &lt;http-method&gt;TRACE&lt;/http-method&gt;
          &lt;http-method&gt;DELETE&lt;/http-method&gt;
      &lt;/web-resource-collection&gt;
      &lt;auth-constraint&gt;
          &lt;description/&gt;
          &lt;role-name&gt;user&lt;/role-name&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;jdbcRealm&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;/login-error.jsp&lt;/form-error-page&gt;
      &lt;/form-login-config&gt;
  &lt;/login-config&gt;
  &lt;security-role&gt;
      &lt;description&gt;user security role&lt;/description&gt;
      &lt;role-name&gt;user&lt;/role-name&gt;
  &lt;/security-role&gt;
  </code></pre>
  
  <p>This is my login form:</p>
  
  <pre><code>    &lt;form action="j_security_check" class="form" method="post"&gt;
  
              &lt;p class="email"&gt;
                      &lt;input type="text" name="j_username" id="j_username"/&gt;
                      &lt;label for="j_username"&gt;E-mail / Username&lt;/label&gt;
              &lt;/p&gt;
  
              &lt;p class="pwd"&gt;
                      &lt;input type="password" name="j_password" id="j_password" /&gt;
                      &lt;label for="j_password"&gt;Password&lt;/label&gt;
              &lt;/p&gt;
  
              &lt;p class="submit"&gt;
                      &lt;input name="login" type="submit" value="Login" /&gt; 
                      &lt;input name="reset_pwd" type="submit" value="Reset Password"&gt;                                                                                                                              
              &lt;/p&gt;
  
      &lt;/form&gt;
  </code></pre>
  
  <p>This a screenshot of my realm setup in the server. I didn't use encryption to simplify things for the moment:
  <img src="https://i.stack.imgur.com/2WijQ.png" alt="Realm"></p>
  
  <p>Since I have nothing else in the stack but what I posted above. I'm really not sure what's wrong. I would appreciate if anyone can me a push in the right direction.</p>