-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Felipe,
On 7/22/14, 10:36 AM, Felipe Jaekel wrote: > I have a simple authentication logic in my applications, where I > store the current user in the session and check with a filter if > the current user value is not null. > > Eventually I see some null pointer exceptions in my Tomcat 7.0.47 > that happened in JSF managed beans because the current user value > was null. > > The problem is that the stackTrace shows that login filter was > executed correctly, so I guess the session timed out right after > the getAttribute() call in the filter, which would explain why > there still was value in the filter but not in the managed bean. Is your session timeout so low that a session could time out during the execution of a single request? > After some research I found this: > http://tomcat.apache.org/tomcat-7.0-doc/config/systemprops.html#Sessions > > Would org.apache.catalina.session.StandardSession.ACTIVITY_CHECK > solve this problem? If the problem is that your requests are taking longer than the session timeout (default: 30 minutes), then yes, this will help. > What about > org.apache.catalina.core.StandardHostValve.ACCESS_SESSION Perhaps. Do you have lots of requests whose code doesn't actually call request.getSession()? > and > org.apache.catalina.session.StandardSession.LAST_ACCESS_AT_START? Perhaps, depending on whether you really have requests that run so long that the session can time-out during their execution. What is your session timeout value (in minutes)? How long does a typical request/response transaction take? How often do they occur? - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTzs0qAAoJEBzwKT+lPKRYyroQAIP0DikrED8AWbu0WuB7pDnv icK82YnEHVEZwHWeiKl03PV7vZsTkPzG6v+aDP+Yb+DaCuxlCpHN3hGvyT2a8x4x oDe82O47B/6cMTzCv/JubK06EWYJOfOGtXEYLRHKSye82+v2wHrkwVdFe3JINu0N ka7CKHFuSPIsAN0HPxrvI0lWEOCJeBffLrb8+mFjixLmQHaA09NEthT9Xr6ohWrq ZuugHFAo/D+2zW6UGmuYuwU+BkT6HQ13ZuBkyfAl/N/ZylovIde53fxKgWrSMSa3 ao/9ZMIr9Ig64U9cUyB62RFiJ/kg2piJmq3TCL2UC9zzEmAc0/SpbazO/yAUID8y +txrwpOfzxYIMZy0iH7aW5FH7gqdSpv/LKbVumPZlcVleBdr9J0AdBncNedoAw9Y 3T6N2A4KiQDVHU2/f1NBmW+HOWu9r2a9mJN3rQrM+4Lf12NTFk3p6oyyZDkJuVNm 8SPvZR90xws413TEAWt3IJTVoG8diUl873GZzHzj4HdvE39mp5gAzN+Nnhi2Meqs ro2Rf6/qfdkEM/R0yvAJVFyeyFSjQvFpSphTvAzDxu1IIiJqQ/GvLKQ6eVgOLOM/ vsPrksjTJ93KPx4iWHjSm6PgvyLc9R5RZVn1MLcROKpidNLwxJEp6wDO27cYj+GL 8NOX+YMukTJnFebPtrIW =cqiq -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org