严重:jdbcrealm.invaliduserreason WEB9102:Web登录失败 [英] SEVERE: jdbcrealm.invaliduserreason WEB9102: Web Login Failed
问题描述
我正在尝试使用MySQL数据库获取登录表单,并继续出现以下错误:
I'm trying to get my login form to with a MySQL Database and keep on getting the following error:
[更新]->我今天做了一些修改,这就是我现在得到的:
[update] --> I made some modification today this is what I'm getting right now:
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
这就是我从堆栈跟踪中得到的全部.我正在按照本教程进行操作: http://blog.eisele.net/2011/01/jdbc-security-realm-and-form-based.html
That's all I get from the stack trace. I'm following this tutorial: http://blog.eisele.net/2011/01/jdbc-security-realm-and-form-based.html
这是我在glassfish-web.xml上的映射:
This is my mapping on glassfish-web.xml:
<security-role-mapping>
<role-name>user</role-name>
<group-name>user</group-name>
</security-role-mapping>
这是我的web.xml:
This is my 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>
这是服务器中我的领域设置的屏幕截图.我暂时没有使用加密来简化事情:
This a screenshot of my realm setup in the server. I didn't use encryption to simplify things for the moment:
因为我除了栈中没有别的东西了,所以上面已经发布了.我真的不知道怎么了.如果有人可以向正确的方向推动,我将不胜感激.
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.
推荐答案
在Glassfish的jdbcRealm设置中,请确保在算法中写"none"(而不是SHA-256或其他任何东西).如果您将该字段留空,它将无法正常工作.
In your jdbcRealm setup in Glassfish, be sure to write "none" in the Algorithm (instead of SHA-256 or anything else). If you leave the field blank, it won't work.
希望这对您有帮助...
Hope this helps...
这篇关于严重:jdbcrealm.invaliduserreason WEB9102:Web登录失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!