使用shiro框架进行用户登录认证报错(HTTP Status 500 - Authentication failed for token submission )解决

报错:

root cause

java.lang.NullPointerException
	org.apache.shiro.authc.credential.SimpleCredentialsMatcher.equals(SimpleCredentialsMatcher.java:95

HTTP Status 500 - Authentication failed for token submission [org.apache.shiro.authc.UsernamePasswordToken - rose, rememberMe=false]. Possible unexpected error? (Typical or expected login exceptions should extend from AuthenticationException).

type Exception report

message Authentication failed for token submission [org.apache.shiro.authc.UsernamePasswordToken - rose, rememberMe=false]. Possible unexpected error? (Typical or expected login exceptions should extend from AuthenticationException).

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.apache.shiro.authc.AuthenticationException: Authentication failed for token submission [org.apache.shiro.authc.UsernamePasswordToken - rose, rememberMe=false].  Possible unexpected error? (Typical or expected login exceptions should extend from AuthenticationException).
	org.apache.shiro.authc.AbstractAuthenticator.authenticate(AbstractAuthenticator.java:214)
	org.apache.shiro.mgt.AuthenticatingSecurityManager.authenticate(AuthenticatingSecurityManager.java:106)
	org.apache.shiro.mgt.DefaultSecurityManager.login(DefaultSecurityManager.java:270)
	org.apache.shiro.subject.support.DelegatingSubject.login(DelegatingSubject.java:256)
原因:传递到realm中的usernamePasswordToken 的password值为null;

你可能感兴趣的:(个人经验)