2019-01-17 14:36:57,384 - Authentication failed for token submission [org.apache.shiro.authc.UsernamePasswordToken - null, rememberMe=false (0:0:0:0:0:0:0:1)]. Possible unexpected error? (Typical or expected login exceptions should extend from AuthenticationException).
java.lang.NullPointerException: null
at com.tansuo365.test1.realm.DatabaseRealm.doGetAuthenticationInfo(DatabaseRealm.java:57)
at org.apache.shiro.realm.AuthenticatingRealm.getAuthenticationInfo(AuthenticatingRealm.java:568)
at org.apache.shiro.authc.pam.ModularRealmAuthenticator.doSingleRealmAuthentication(ModularRealmAuthenticator.java:180)
at org.apache.shiro.authc.pam.ModularRealmAuthenticator.doAuthenticate(ModularRealmAuthenticator.java:267)
at org.apache.shiro.authc.AbstractAuthenticator.authenticate(AbstractAuthenticator.java:198)
at org.apache.shiro.mgt.AuthenticatingSecurityManager.authenticate(AuthenticatingSecurityManager.java:106)
只要是记住我字段进来就出错.否则没事.
这样是没错的:
UsernamePasswordToken token = new UsernamePasswordToken(name,password);
这样就报错了:
UsernamePasswordToken token = new UsernamePasswordToken(name, password, subject.isRemembered());
或者这样也报错:
UsernamePasswordToken token = new UsernamePasswordToken(name, password, rememberMe);