Am 20.04.2011 um 19:43 schrieb Mukarram Baig:

> Thanks for the responses Thomas and Chris. To clarify, the application is
> not being defined as being distributable in my web.xml. The exceptions that
> I am seeing here are not at webapp restarts (we basically have very
> infrequent application restarts and we can afford to lose out on the user
> sessions in these scenarios) but during the normal running of the
> application. Also, the code is designed to work correctly even when the same
> user is accessing the screen via different tabs in the same window (we do
> this by keeping the key in the session unique per screen). I do not see any
> information in my catalina.out at the time this occurs. The code ranch
> information that I wanted to point out was the post from William Brogden
> (putting here for quick reference)
> 

You could implement a sessioncontext listener to be sure that you get a log 
entry when a session expires or gets closed or gets created. I still think the 
users may do something you do not expect, maybe bookmarking into your 
application while still beeing logged on or things like that.
The SessionContext Listener might help you to track down the reason for the 
NPEs. I personally have never seen that Tomcat drops or serializes sessions to 
reduce the consumed memory - reading Chris message, I think this is not 
implemented in Tomcat.

Another tool to give a try may be Tomcat probe, where you can inspect the 
session contents with a nice and handy web interface.

Regards, 


Thomas

> 
>> Nope, that is not the reason you are getting that error. 
>> Servlet<http://www.coderanch.com/forums/f-7/Servlets>containers are allowed 
>> to serialize a session to disk any time they want -
>> presumably for memory management. Thats why all objects referenced in a
>> session should be serializable.
>> Presumably your instance of Tomcat has decided to serialize sessions
>> because memory is getting tight. The simplest thing to do would be make that
>> class serializable (if possible).
>> 
> 
> Chris, you have mentioned a very interesting point that one should do
> null-checks when accessing session objects. I was not quite able to
> understand the reason why this is so?
> 
> Thanks in advance again!
> 
> P.S.: I am subscribed via the digest option and didn't know how quite to
> reply to a thread, so apologies if this opens up a new thread :) BTW, why do
> we not have a web interface for this?
> 
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
> 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to