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)
as long as you remember my field, you will make a mistake. Otherwise, it"s fine.
this is the right thing to do:
UsernamePasswordToken token = new UsernamePasswordToken(name,password);
this makes a mistake:
UsernamePasswordToken token = new UsernamePasswordToken(name, password, subject.isRemembered());
or this may also report an error:
UsernamePasswordToken token = new UsernamePasswordToken(name, password, rememberMe);