users@glassfish.java.net

Re: Q: Can I define a Web Application with an indefinite session timeout in Glassfish 2.1?

From: Ed Hillmann <ed.hillmann_at_gmail.com>
Date: Fri, 11 Sep 2009 08:29:14 +1000

On Fri, Sep 11, 2009 at 2:44 AM, Jan Luehe <Jan.Luehe_at_sun.com> wrote:

> Can you declare an HttpSessionListener in your web.xml, whose
> sessionDestroyed
> method prints the session id of the session that is being destroyed, along
> with
> a stack dump (Thread.currentThread().dumpStack())?
>
> You may want to add similar logic to the sessionCreated method, so that the
> sessions
> being created and destroyed can be correlated.
>
> The stack dump should tell us who is destroying the session.
>
> Thanks!
>
> Jan
>
> Hi Jan. I added an HttpSessionListener, then changed my session-timeout in
my web.xml to 0. This is what I output to my server.log...

sessionCreated => 5f84d9578bf083e702290cef171a
java.lang.Exception: Stack trace
        at java.lang.Thread.dumpStack(Thread.java:1206)
        at
com.intecbilling.peweb.servlet.WebSessionListener.sessionCreated(WebSessionListener.java:20)
        at
org.apache.catalina.session.StandardSession.tellNew(StandardSession.java:470)
        at
org.apache.catalina.session.StandardSession.setId(StandardSession.java:419)
        at
org.apache.catalina.session.ManagerBase.createSession(ManagerBase.java:872)
        at
org.apache.catalina.session.StandardManager.createSession(StandardManager.java:336)
        at
org.apache.coyote.tomcat5.CoyoteRequest.doGetSession(CoyoteRequest.java:2882)
        at
org.apache.coyote.tomcat5.CoyoteRequest.getSession(CoyoteRequest.java:2609)
        at
org.apache.coyote.tomcat5.CoyoteRequestFacade.getSession(CoyoteRequestFacade.java:912)
        at
org.apache.coyote.tomcat5.CoyoteRequestFacade.getSession(CoyoteRequestFacade.java:923)
        at
org.apache.jasper.runtime.PageContextImpl._initialize(PageContextImpl.java:196)
        at
org.apache.jasper.runtime.PageContextImpl.initialize(PageContextImpl.java:172)
        at
org.apache.jasper.runtime.JspFactoryImpl.internalGetPageContext(JspFactoryImpl.java:162)
        at
org.apache.jasper.runtime.JspFactoryImpl.getPageContext(JspFactoryImpl.java:110)
        at org.apache.jsp.index_jsp._jspService(index_jsp.java from :35)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:109)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
        at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:486)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:380)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
        at
org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:427)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:315)
        at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
        at
com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
        at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:288)
        at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:647)
        at
com.sun.enterprise.web.connector.grizzly.comet.CometEngine.executeServlet(CometEngine.java:609)
        at
com.sun.enterprise.web.connector.grizzly.comet.CometEngine.handle(CometEngine.java:356)
        at
com.sun.enterprise.web.connector.grizzly.comet.CometAsyncFilter.doFilter(CometAsyncFilter.java:84)
        at
com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:175)
        at
com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:153)
        at
com.sun.enterprise.web.connector.grizzly.async.AsyncProcessorTask.doTask(AsyncProcessorTask.java:92)
        at
com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
        at
com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:116)
INFO : Blocking Request Handler: "auto-detect" -
com.icesoft.faces.webapp.http.servlet.MainServlet
WARN : Push Server not found - the Push Server must be deployed to support
multiple asynchronous applications. -
com.icesoft.faces.webapp.http.servlet.MainServlet
INFO : Adapting to Push environment. -
com.icesoft.faces.webapp.http.servlet.MainServlet
sessionDestroyed => 5f84d9578bf083e702290cef171a
java.lang.Exception: Stack trace
        at java.lang.Thread.dumpStack(Thread.java:1206)
        at
com.intecbilling.peweb.servlet.WebSessionListener.sessionDestroyed(WebSessionListener.java:26)
        at
org.apache.catalina.session.StandardSession.expire(StandardSession.java:816)
        at
org.apache.catalina.session.StandardSession.expire(StandardSession.java:774)
        at
org.apache.catalina.session.StandardSession.expire(StandardSession.java:762)
        at
org.apache.catalina.session.StandardSession.invalidate(StandardSession.java:1407)
        at
org.apache.catalina.session.StandardSessionFacade.invalidate(StandardSessionFacade.java:199)
        at
com.icesoft.faces.webapp.http.servlet.SessionDispatcher$Monitor.shutdown(SessionDispatcher.java:320)
        at
com.icesoft.faces.webapp.http.servlet.SessionDispatcher$Monitor.shutdownIfExpired(SessionDispatcher.java:328)
        at
com.icesoft.faces.webapp.http.servlet.SessionDispatcher$Listener$1.run(SessionDispatcher.java:224)


From the user's point of view, I entered the URL of my application and got
my login page. Then, without doing anything else, I was told my session was
invalidated (as part of ICEfaces' Javascript bridge, it sends a notification
when the session is no longer valid).

However, it is showing that the ICEfaces code is kicking this off. They
have a Monitor class that monitors the state of HttpSessions. I've looked
at the code, and I think it is not catering for negative values. I will
have a play with that and report back my findings. If I have to hazard a
guess, though, I think it might be ICEfaces code and not Glassfish code.

Thanks for the help in tracking this down.

Ed