Java 严重:jdbcrealm.invaliduserreason WEB9102:Web登录失败

Java 严重:jdbcrealm.invaliduserreason WEB9102:Web登录失败,java,forms-authentication,security,jdbcrealm,Java,Forms Authentication,Security,Jdbcrealm,我正在尝试使用MySQL数据库将我的登录表单设置为,并不断出现以下错误: [更新]->我今天做了一些修改,这是我现在得到的: SEVERE: jdbcrealm.invaliduserreason WARNING: WEB9102: Web Login Failed: com.sun.enterprise.security.auth.login.common.LoginException: Login failed: Security Exception WARNING: WEB9102: We

我正在尝试使用MySQL数据库将我的登录表单设置为,并不断出现以下错误:

[更新]->我今天做了一些修改,这是我现在得到的:

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
这就是我从堆栈跟踪中得到的所有信息。我将遵循本教程:

这是我在glassfish-web.xml上的映射:

  <security-role-mapping>
    <role-name>user</role-name>
    <group-name>user</group-name>
  </security-role-mapping>
这是我的web.xml:

<security-constraint>
    <display-name>user</display-name>
    <web-resource-collection>
        <web-resource-name>Users Area</web-resource-name>
        <description>Protected Users Area</description>
        <url-pattern>/user/*</url-pattern>
        <http-method>GET</http-method>
        <http-method>PUT</http-method>
        <http-method>HEAD</http-method>
        <http-method>POST</http-method>
        <http-method>OPTIONS</http-method>
        <http-method>TRACE</http-method>
        <http-method>DELETE</http-method>
    </web-resource-collection>
    <auth-constraint>
        <description/>
        <role-name>user</role-name>
    </auth-constraint>
</security-constraint>
<login-config>
    <auth-method>FORM</auth-method>
    <realm-name>jdbcRealm</realm-name>
    <form-login-config>
        <form-login-page>/login.jsp</form-login-page>
        <form-error-page>/login-error.jsp</form-error-page>
    </form-login-config>
</login-config>
<security-role>
    <description>user security role</description>
    <role-name>user</role-name>
</security-role>
这是我的登录表单:

    <form action="j_security_check" class="form" method="post">

            <p class="email">
                    <input type="text" name="j_username" id="j_username"/>
                    <label for="j_username">E-mail / Username</label>
            </p>

            <p class="pwd">
                    <input type="password" name="j_password" id="j_password" />
                    <label for="j_password">Password</label>
            </p>

            <p class="submit">
                    <input name="login" type="submit" value="Login" /> 
                    <input name="reset_pwd" type="submit" value="Reset Password">                                                                                                                              
            </p>

    </form>
这是服务器中我的领域设置的屏幕截图。我暂时没有使用加密来简化事情:


因为除了上面贴的东西,我没有其他东西。我真的不知道怎么了。如果有人能给我一个正确的方向,我将不胜感激。

在Glassfish中的jdbcRealm设置中,请确保在算法中不写入任何内容,而不是SHA-256或其他任何内容。如果您将该字段留空,它将无法工作


希望这有助于…

在Glassfish中的jdbcRealm设置中,确保在算法中不写入任何内容,而不是SHA-256或其他任何内容。如果您将该字段留空,它将无法工作


希望这有助于…

为我修好它的愚蠢而整洁的东西;领域是小写字母,尤其是在表名和列名中,它们在我的mysql数据库中是大写字母。记住在你的领域检查你的表的大小写敏感度

为我修好的愚蠢而整洁的东西;领域是小写字母,尤其是在表名和列名中,它们在我的mysql数据库中是大写字母。记住在你的领域检查你的表的大小写敏感度

如果您使用的是Glassfish 4,则需要填写数据库用户和数据库密码字段,该字段出现在设置->服务器配置->安全->领域->jdbcRealm中


如果您使用的是Glassfish 4,则需要填写字段Database User和Database Password,该字段出现在设置->服务器配置->安全->领域->jdbcRealm中


你找到解决办法了吗?我的问题几乎和你一样,但皮埃尔的回答对我不起作用。我按照皮埃尔C.在这篇文章的回答中的建议做了。此外,我重复了两次教程,在算法字段中使用了None,我能够找到答案?我的问题几乎和你一样,但皮埃尔的回答对我不起作用。我按照皮埃尔C.在这篇文章的回答中的建议做了。另外,我重复了两次教程,并在算法字段中使用了None,我能够找到答案。到教程的链接是:我相信这只与MySQL相关,因为表名也是存储数据的文件名。这对于区分大小写的文件系统很重要。不确定这在Windows中是否也是一个问题。如果是的话,那么MySQL会以区分大小写的方式查找表文件。我认为这只与MySQL有关,因为表名也是存储数据的文件名。这对于区分大小写的文件系统很重要。不确定这在Windows中是否也是一个问题。如果是,那么MySQL将以区分大小写的方式查找表文件。我必须将MD5放入密码加密算法和摘要算法中。我必须将MD5放入密码加密算法和摘要算法中。