apbbbbb
旋转的钢笔
2017-02-22 01:50

退出登录,session不知道怎么失效了,获取不到session里面的值?

  • web
  • session
  • servlet
  • 验证码

登录页面我弄了一个验证码,存放到session中,刷新页面第一次登录可以验证,
但是退出登录后,再次登录session里面的值获取不到了,报空指针,为什么?我调试
发现退出登录的时候,session中也存放值了,为什么就是获取不到呢?

 09:25:06.144 [5200279@qtp-16921957-13 - /servlet/captchaServlet?method=getJPGCodeServlet] DEBUG org.mortbay.log - RESPONSE /servlet/captchaServlet  200
09:25:10.228 [5200279@qtp-16921957-13] DEBUG org.mortbay.log - EOF
09:25:19.968 [5200279@qtp-16921957-13 - /training_security_check] DEBUG org.mortbay.log - REQUEST /training_security_check on org.mortbay.jetty.HttpConnection@1be372a
09:25:19.968 [5200279@qtp-16921957-13 - /training_security_check] DEBUG org.mortbay.log - Got Session ID 13ke4zpaqcz65188p4bhmhpnre from cookie
09:25:19.968 [5200279@qtp-16921957-13 - /training_security_check] DEBUG org.mortbay.log - sessionManager=org.mortbay.jetty.servlet.HashSessionManager@6c8a0c
09:25:19.968 [5200279@qtp-16921957-13 - /training_security_check] DEBUG org.mortbay.log - session=null
09:25:19.968 [5200279@qtp-16921957-13 - /training_security_check] DEBUG org.mortbay.log - servlet=default
09:25:19.968 [5200279@qtp-16921957-13 - /training_security_check] DEBUG org.mortbay.log - chain=Set Character Encoding->springSecurityFilterChain->default
09:25:19.968 [5200279@qtp-16921957-13 - /training_security_check] DEBUG org.mortbay.log - servlet holder=default
09:25:19.968 [5200279@qtp-16921957-13 - /training_security_check] DEBUG org.mortbay.log - call filter Set Character Encoding
09:25:19.968 [5200279@qtp-16921957-13 - /training_security_check] DEBUG org.mortbay.log - call filter springSecurityFilterChain
09:25:19.968 [5200279@qtp-16921957-13 - /training_security_check] DEBUG o.s.s.w.u.m.AntPathRequestMatcher - Checking match of request : '/training_security_check'; against '/js/**'
09:25:19.969 [5200279@qtp-16921957-13 - /training_security_check] DEBUG o.s.s.w.u.m.AntPathRequestMatcher - Checking match of request : '/training_security_check'; against '/image/**'
09:25:19.969 [5200279@qtp-16921957-13 - /training_security_check] DEBUG o.s.s.w.u.m.AntPathRequestMatcher - Checking match of request : '/training_security_check'; against '/css/**'
09:25:19.969 [5200279@qtp-16921957-13 - /training_security_check] DEBUG o.s.s.w.u.m.AntPathRequestMatcher - Checking match of request : '/training_security_check'; against '/img/**'
09:25:19.969 [5200279@qtp-16921957-13 - /training_security_check] DEBUG o.s.s.w.u.m.AntPathRequestMatcher - Checking match of request : '/training_security_check'; against '/check-**'
09:25:19.969 [5200279@qtp-16921957-13 - /training_security_check] DEBUG o.s.security.web.FilterChainProxy - /training_security_check at position 1 of 5 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'
09:25:19.969 [5200279@qtp-16921957-13 - /training_security_check] DEBUG o.s.s.w.c.HttpSessionSecurityContextRepository - No HttpSession currently exists
09:25:19.969 [5200279@qtp-16921957-13 - /training_security_check] DEBUG o.s.s.w.c.HttpSessionSecurityContextRepository - No SecurityContext was available from the HttpSession: null. A new one will be created.
09:25:19.969 [5200279@qtp-16921957-13 - /training_security_check] DEBUG o.s.security.web.FilterChainProxy - /training_security_check at position 2 of 5 in additional filter chain; firing Filter: 'LogoutFilter'
09:25:19.969 [5200279@qtp-16921957-13 - /training_security_check] DEBUG o.s.security.web.FilterChainProxy - /training_security_check at position 3 of 5 in additional filter chain; firing Filter: 'CspUsernamePasswordAuthenticationFilter'
09:25:19.969 [5200279@qtp-16921957-13 - /training_security_check] DEBUG c.a.v.s.w.a.CspUsernamePasswordAuthenticationFilter - Request is to process authentication
09:25:24.804 [5200279@qtp-16921957-13 - /training_security_check] DEBUG o.s.s.w.s.HttpSessionEventPublisher - Publishing event: org.springframework.security.web.session.HttpSessionCreatedEvent[source=org.mortbay.jetty.servlet.HashSessionManager$Session:1j6zr4li8qb2m10zam8dqsmj1y@15216624]
09:29:26.160 [5200279@qtp-16921957-13 - /training_security_check] DEBUG o.s.s.w.c.HttpSessionSecurityContextRepository - SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.
09:29:29.129 [5200279@qtp-16921957-13 - /training_security_check] DEBUG o.s.s.w.c.SecurityContextPersistenceFilter - SecurityContextHolder now cleared, as request processing completed
09:29:39.700 [5200279@qtp-16921957-13 - /training_security_check] ERROR org.mortbay.log - /training_security_check
java.lang.NullPointerException: null
    at com.auchan.via.security.web.authentication.CspUsernamePasswordAuthenticationFilter.attemptAuthentication(CspUsernamePasswordAuthenticationFilter.java:113) ~[classes/:na]
    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:211) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
    at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344) ~[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE]
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261) ~[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE]
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212) ~[jetty-6.1.26.jar:6.1.26]
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) ~[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE]
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212) ~[jetty-6.1.26.jar:6.1.26]
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399) ~[jetty-6.1.26.jar:6.1.26]
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) [jetty-6.1.26.jar:6.1.26]
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) [jetty-6.1.26.jar:6.1.26]
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766) [jetty-6.1.26.jar:6.1.26]
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450) [jetty-6.1.26.jar:6.1.26]
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) [jetty-6.1.26.jar:6.1.26]
    at org.mortbay.jetty.Server.handle(Server.java:322) [jetty-6.1.26.jar:6.1.26]
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) [jetty-6.1.26.jar:6.1.26]
    at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945) [jetty-6.1.26.jar:6.1.26]
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) [jetty-6.1.26.jar:6.1.26]
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) [jetty-6.1.26.jar:6.1.26]
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) [jetty-6.1.26.jar:6.1.26]
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410) [jetty-6.1.26.jar:6.1.26]
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) [jetty-util-6.1.26.jar:6.1.26]
09:29:39.911 [5200279@qtp-16921957-13 - /training_security_check] DEBUG org.mortbay.log - POST /training_security_check HTTP/1.1
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

4条回答

为你推荐

换一换