AbstractRememberMeServices抛出Nullpointer异常

时间:2016-09-22 15:33:01

标签: java spring spring-mvc spring-security hybris

我正在使用 Spring-security-web-3.2.5 jar和 Java 8 以及 Spring-web-mvc 4.1.7 hybris 6平台。

我在 ApplicationFilterProxy 和类中获得了Nullpointer Exception 的 AbstractRememberMeServices

当我调试这个类时,我发现logger对象为null,当代码尝试执行以下操作时,抛出NullPointer异常

this.logger.debug("Interactive login attempt was unsuccessful.");

异常StackTrace:

   SEVERE: Servlet.service() for servlet [DispatcherServlet] in context with path [] threw exception [Error while processing internal filterchain. Exception occurred at chain position: 9 of 16. Current filter: 'FilterChainProxy[Filter Chains: [[ Ant [pattern='/_ui/**'], []], [ Ant [pattern='/checkout/**'], [org.springframework.security.web.access.channel.ChannelProcessingFilter@f6a714c, org.springframework.security.web.context.SecurityContextPersistenceFilter@3aa9c43e, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@148b51b7, org.springframework.security.web.authentication.logout.LogoutFilter@7dc977d4, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@21759930, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@55893114, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@1bc1c4fb, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@2d007780, org.springframework.security.web.access.ExceptionTranslationFilter@20b1d709, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@3c2c439a]], [ com.example.storefront.security.ExcludeUrlRequestMatcher@3a6c99ce, [org.springframework.security.web.access.channel.ChannelProcessingFilter@31cb980a, org.springframework.security.web.context.SecurityContextPersistenceFilter@3ef9fc3c, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@28aef10c, org.springframework.security.web.authentication.logout.LogoutFilter@7652af3e, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@1bb47236, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@6add7560, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@3524cfa6, org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter@566cad63, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@6ef1505a, org.springframework.security.web.access.ExceptionTranslationFilter@6f065e91, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@7ccce528]]]]'!; nested exception is java.lang.NullPointerException] with root cause
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.365 | java.lang.NullPointerException
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.366 |     at org.springframework.security.web.authentication.rememberme.AbstractRememberMeServices.loginFail(AbstractRememberMeServices.java:239)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.369 |     at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.unsuccessfulAuthentication(AbstractAuthenticationProcessingFilter.java:353)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.369 |     at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:225)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.370 |     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.371 |     at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.372 |     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.378 |     at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.379 |     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.380 |     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.383 |     at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.391 |     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.392 |     at org.springframework.security.web.access.channel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:144)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.393 |     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.393 |     at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.393 |     at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.393 |     at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:224)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.394 |     at com.example.storefront.filters.SiteMinderFilter.doFilter(SiteMinderFilter.java:119)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.394 |     at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:224)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.395 |     at com.example.storefront.filters.UrlEncoderFilter.doFilterInternal(UrlEncoderFilter.java:87)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.395 |     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.396 |     at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:224)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.396 |     at com.example.storefront.filters.StorefrontFilter.doFilter(StorefrontFilter.java:74)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.396 |     at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:224)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.397 |     at com.example.storefront.filters.cms.CMSSiteFilter.doFilterInternal(CMSSiteFilter.java:100)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.397 |     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.398 |     at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:224)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.399 |     at com.example.storefront.filters.RequestLoggerFilter.doFilter(RequestLoggerFilter.java:89)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.399 |     at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:224)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.399 |     at com.example.storefront.filters.AcceleratorAddOnFilter.doFilter(AcceleratorAddOnFilter.java:92)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.399 |     at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:224)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.406 |     at de.hybris.platform.servicelayer.web.SessionFilter.doFilter(SessionFilter.java:71)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.407 |     at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:224)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.408 |     at de.hybris.platform.servicelayer.web.Log4JFilter.doFilter(Log4JFilter.java:45)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.408 |     at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:224)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.409 |     at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain.doFilterInternal(AbstractPlatformFilterChain.java:154)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.410 |     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.410 |     at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.411 |     at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.411 |     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.412 |     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.413 |     at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.413 |     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.413 |     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.413 |     at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.414 |     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.414 |     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.415 |     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.415 |     at com.example.storefront.filters.AcceleratorAddOnFilter.doFilter(AcceleratorAddOnFilter.java:92)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.416 |     at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.416 |     at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.416 |     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.417 |     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.417 |     at de.hybris.platform.servicelayer.web.XSSFilter.processPatternsAndDoFilter(XSSFilter.java:293)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.419 |     at de.hybris.platform.servicelayer.web.XSSFilter.doFilter(XSSFilter.java:247)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.419 |     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.420 |     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.420 |     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.423 |     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.424 |     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.425 |     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.426 |     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.427 |     at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.428 |     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.428 |     at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.429 |     at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.430 |     at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.430 |     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.431 |     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.433 |     at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
INFO   | jvm 1    | main    | 2016/09/22 15:23:01.448 |     at java.lang.Thread.run(Thread.java:745)

我无法弄清楚为什么会发生这种情况,非常感谢任何帮助。

0 个答案:

没有答案