#41 illegalstateException on Sessionlistener

v1.00 final
closed-fixed
None
9
2007-02-20
2007-01-24
Charles Lescot
No

a user has experienced an exception with sessionListener(see below).
we should test if SessionListener is yet needed.
=> session invalidation seems to be done always before.
or can we test session invalidation?

2007-01-18 19:02:26 StandardManager[/auth-prototype] Session event listener threw exception
java.lang.IllegalStateException: getAttribute: Session already invalidated
at org.apache.catalina.session.StandardSession.getAttribute(StandardSession.java:925)
at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessionFacade.java:124)
at net.sf.jguard.jee.listeners.SessionListener.sessionDestroyed(SessionListener.java:63)
at org.apache.catalina.session.StandardSession.expire(StandardSession.java:623)
at org.apache.catalina.session.StandardSession.expire(StandardSession.java:572)
at org.apache.catalina.session.StandardSession.invalidate(StandardSession.java:1008)
at org.apache.catalina.session.StandardSessionFacade.invalidate(StandardSessionFacade.java:164)
at net.sf.jguard.jee.authentication.http.AccessFilter.postAuthenticationProcess(AccessFilter.java:645)
at net.sf.jguard.jee.authentication.http.AccessFilter.authenticate(AccessFilter.java:585)
at net.sf.jguard.jee.authentication.http.AccessFilter.logonProcess(AccessFilter.java:440)
at net.sf.jguard.jee.authentication.http.AccessFilter.doFilter(AccessFilter.java:214)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
at cz.tmobile.filter.URIDepositorFilter.doFilter(URIDepositorFilter.java:29)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)

Discussion

  • Charles Lescot
    Charles Lescot
    2007-02-20

    • status: open --> closed-fixed
     
  • Charles Lescot
    Charles Lescot
    2007-02-20

    Logged In: YES
    user_id=824172
    Originator: YES

    the issue appears when jGuard invalidate actively the session in j2ee 1.3 application servers.
    the problem seems not to appear in j2ee 1.4 app servers, because a light change has been done in the specification.

    the problem is raised because when jguard invalidate the session, the httpsessionEvent is passed to the contextListener AFTER the session has expire; an illegalstateZxception is raised, but we catch it because it has got no side effects.

    the fix will be added to the 1.0.1 release.
    charles.