PDA

View Full Version : Resin seems to drop sessions


bregnvig
03-01-2010, 02:53 PM
I'm running a Resin server 3.1.9.

I get a lot IllegalStateExceptions, because the session is no longer valid.

java.lang.IllegalStateException: SessionImpl[abcNXQT1WSrpP56X1uACs,]: "can't call getAttribute() when session is no longer valid"

I catch the exception and examine the session. To help me with that, I have installed a HttpSessionListener to listen to the sessions life cycle. I can see all session that throw this exception has the same behaviour.

Session info: Created 2010-03-01 16:26:12. Destroyed: null null. Last accessed: 2010-03-01 16:28:10

The HttpSessionListener never registers that the session has been destroyed. And all the sessions that throws the IllegalStateException only lives for a short period.

It is not all sessions that are effected. I.e I have sessions that continues to exist after these session are destroyed.

Any help would really be appreciated.

Regards,
Flemming

emil
03-03-2010, 07:14 PM
Hi bregnvig,

Can you post the stack trace of the exception?

Thanks,
Emil

bregnvig
03-08-2010, 02:09 PM
I can :-) (Sorry but I couldn't adjust the font. Gave me a http response 500)

java.lang.IllegalStateException: SessionImpl[abcsSLn60t-Od5LEWp_Cs,]: can't call getAttribute() when session is no longer valid. at com.caucho.server.session.SessionImpl.getAttribute (SessionImpl.java:283) at com.caucho.server.session.SessionImpl.getValue(Ses sionImpl.java:416) at com.caucho.jsp.PageContextImpl.getAttribute(PageCo ntextImpl.java:444) at com.caucho.jsp.el.PageContextAttributeMap.get(Page ContextAttributeMap.java:56) at javax.el.MapELResolver.getValue(MapELResolver.java :133) at com.caucho.jsp.el.PageContextELResolver.getValue(P ageContextELResolver.java:167) at com.caucho.el.ArrayResolverExpr.getValue(ArrayReso lverExpr.java:148) at com.caucho.el.PathExpr.getValue(PathExpr.java:142) at com.caucho.el.Expr.print(Expr.java:416) at _jsp._WEB_22dINF._tiles._layout__jsp$_CauchoFragme nt._jsp_fragment_1(_layout__jsp.java:561) at _jsp._WEB_22dINF._tiles._layout__jsp$_CauchoFragme nt._jsp_invoke(_layout__jsp.java:594) at com.caucho.jsp.JspFragmentSupport.invoke(JspFragme ntSupport.java:92) at net.codeweasels.miniclub.web.taglib.PerformanceTag .doLoggingTag(PerformanceTag.java:37) at net.codeweasels.miniclub.web.taglib.AbstractIPorta lTag.doTag(AbstractIPortalTag.java:34) at _jsp._WEB_22dINF._tiles._layout__jsp._jspService(_ layout__jsp.java:57) at com.caucho.jsp.JavaPage.service(JavaPage.java:61) at com.caucho.jsp.Page.pageservice(Page.java:578) at com.caucho.server.dispatch.PageFilterChain.doFilte r(PageFilterChain.java:195) at com.caucho.server.webapp.DispatchFilterChain.doFil ter(DispatchFilterChain.java:97) at com.caucho.server.dispatch.ServletInvocation.servi ce(ServletInvocation.java:265) at com.caucho.server.webapp.RequestDispatcherImpl.for ward(RequestDispatcherImpl.java:293) at com.caucho.server.webapp.RequestDispatcherImpl.for ward(RequestDispatcherImpl.java:111) at org.apache.struts.action.RequestProcessor.doForwar d(RequestProcessor.java:1056) at org.apache.struts.tiles.TilesRequestProcessor.doFo rward(TilesRequestProcessor.java:261) at org.apache.struts.tiles.TilesRequestProcessor.proc essTilesDefinition(TilesRequestProcessor.java:237) at org.apache.struts.tiles.TilesRequestProcessor.proc essForwardConfig(TilesRequestProcessor.java:300) at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:231) at org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1164) at org.apache.struts.action.ActionServlet.doGet(Actio nServlet.java:397) at javax.servlet.http.HttpServlet.service(HttpServlet .java:114) at javax.servlet.http.HttpServlet.service(HttpServlet .java:91) at com.caucho.server.dispatch.ServletFilterChain.doFi lter(ServletFilterChain.java:103) at net.codeweasels.miniclub.web.util.filter.MenuIdFil ter.doFilter(MenuIdFilter.java:30) at com.caucho.server.dispatch.FilterFilterChain.doFil ter(FilterFilterChain.java:87) at net.codeweasels.miniclub.web.util.filter.RequestFi lter.doFilter(RequestFilter.java:53) at com.caucho.server.dispatch.FilterFilterChain.doFil ter(FilterFilterChain.java:87) at net.codeweasels.miniclub.web.util.filter.LastLogin Filter.doFilter(LastLoginFilter.java:84) at com.caucho.server.dispatch.FilterFilterChain.doFil ter(FilterFilterChain.java:87) at net.codeweasels.miniclub.web.util.filter.IPortalFi lter.doFilter(IPortalFilter.java:68) at com.caucho.server.dispatch.FilterFilterChain.doFil ter(FilterFilterChain.java:87) at com.caucho.server.security.SecurityFilterChain.doF ilter(SecurityFilterChain.java:134) at com.caucho.server.webapp.WebAppFilterChain.doFilte r(WebAppFilterChain.java:187) at com.caucho.server.dispatch.ServletInvocation.servi ce(ServletInvocation.java:265) at com.caucho.server.hmux.HmuxRequest.handleRequest(H muxRequest.java:436) at com.caucho.server.port.TcpConnection.run(TcpConnec tion.java:682) at com.caucho.util.ThreadPool$Item.runTasks(ThreadPoo l.java:743) at com.caucho.util.ThreadPool$Item.run(ThreadPool.jav a:662) at java.lang.Thread.run(Thread.java:619)

emil
03-10-2010, 05:17 PM
Hi bregnvig,

Any chance your sessions are over 4MB? There was a recent fix in Resin 3.1.10 that addressed problems related to large sessions. Even if your sessions are smaller, it might be worth a try.

If upgrading doesn't help, I can file a bug for the issue. I don't see anything strange in your stack trace - just a normal session request - so we'll need to dig deeper to find the real problem.

Thanks,
Emil

bregnvig
03-11-2010, 06:45 AM
Hi Emil,

I hope I don't have sessions of 4MB:)

But as you said it might be worth a try, so I'll be upgrading to 3.1.10 today. I'll let you know if the problem is still there after upgrading.

btw - thank you.

Regards,
Flemming

bregnvig
03-12-2010, 01:53 PM
Hi,

I updated the version to 3.1.10 but I'm still experiencing the same problem.

Is there information I can give you that might help?

I can say that this problem only occurs during peak hour. I would guess that no more than 400 - 800 sessions exists at that time.

Regards,
Flemming

emil
03-12-2010, 06:58 PM
Hi Flemming,

I've filed a bug for this here:

http://bugs.caucho.com/view.php?id=3942

We just created a new stress test environment that should make this easier for us to reproduce, so hopefully we'll be able to fix it soon.

You might also try upgrading to 4.0.5 when it comes out next week. There were a few fixes that may have hit the bug you're seeing.

Thanks again,
Emil