File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Session timeout problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Session timeout problem" Watch "Session timeout problem" New topic

Session timeout problem

Gul Khan
Ranch Hand

Joined: Sep 03, 2003
Posts: 173
I am getting a session timeout problem on weblogic 6.1- Sometimes it expires even after a few minutes of login. I have the following tag in my web.xml

Advice plz on why the timeout is unpredictable!

Mark Vedder
Ranch Hand

Joined: Dec 17, 2003
Posts: 624

One possibility is where are you putting that setting in your web.xml file? The order of placement of elements in the deployment descriptor (i.e. the web.xml file) is critical. Is the session-config element placed in the correct order (as defined in the DTD) in your web.xml? The version 2.3 DTD defines the order of elements as being:

Verify that your session-config is in the correct order as compared to the other elements of the web.xml file. Since I do not use it, I'm not sure how Weblogic handles an invalid deployment descriptor - it may just ignore an out of place element rather then generating an error. Then again it may be putting an error message in your logs.
[ June 03, 2004: Message edited by: Mark Vedder ]
Gul Khan
Ranch Hand

Joined: Sep 03, 2003
Posts: 173

The descriptor looks ok to me.. It is more troublesome coz it does not happen all the time and all i see in the log is the session is null/invalid/timeout.
I will appreciate any kind of help.
Thanks for replying

Mark Vedder
Ranch Hand

Joined: Dec 17, 2003
Posts: 624

Sorry then, for I am out of ideas. The only other thing I can suggest is to see if you can increase the verbosity of your logs. Again, I am not familiar with Weblogic since I use Sun ONE servers. But with most servers you can increase the log verbosity.(It's just a matter of finding where that config setting is.) Maybe doing such will give you some more information that will help. If I can think of any other ideas, I'll be sure to come back and post them. Hopefully someone else will have an idea. Good luck.
Rishi Tandon

Joined: Oct 23, 2002
Posts: 17
session timeout specified in web.xml is treated in minutes by the container. so logically session should expire after 500 minutes(According to your configuration).

besides session configuration in web.xml, are you using Session.invalidate() method on some conditions ?

Rishi Tandon<br />SCJP 1.2<br />SCBCD
Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1211

You might want to check whether a call to session.setMaxInactiveInterval() is being made anywhere. Also, you could use session.getMaxInactiveInterval() on suspicious pages to get the session time out set for that page.

The future is here. It's just not evenly distributed yet. - William Gibson
Sonny Gill LinkedIn
I agree. Here's the link:
subject: Session timeout problem
It's not a secret anymore!