Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Two strange behavior of my http Session

 
Estillan Xu
Greenhorn
Posts: 12
Java Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends!

I use "setMaxInactiveInterval" to set time out period as 60 seconds. Client is sending heart beat request to server every 20 seconds. Server will invalidate the session if it lost 3~4 heartbeats.

Here is my debugging infor:

this session has started: 7C698D0C333CF5E378A4A571C3B0E4E2 @ 2011-04-05 17:25:44
session started

Apr 5, 2011 5:25:56 PM org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load java.lang.Runtime. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1273)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at CheckLiveness.restartEngineServer(CheckLiveness.java:144)
at CheckLiveness.run(CheckLiveness.java:113)
at java.lang.Thread.run(Thread.java:619)
Problem 1: this except keep popping up once in a while and it is not regular. By the way, it only happens after I implemented the SessionBindingListener.

renew file @ 2011-04-05 17:26:04
server receives heart beat successfully

renew file @ 2011-04-05 17:26:24
server receives heart beat successfully

renew file @ 2011-04-05 17:26:44
server receives heart beat successfully

renew file @ 2011-04-05 17:27:04
server receives heart beat successfully

this session has ended: 7C698D0C333CF5E378A4A571C3B0E4E2 @ 2011-04-05 17:27:18
BANG! Session End... Problem 2: strange... what does "inactive" mean? I thought receiving heart beat from client means that client is active.


Estillan


 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13077
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Exactly what happens in a "heart beat" request? Do you request the session for every heart beat request?

Bill
 
Estillan Xu
Greenhorn
Posts: 12
Java Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William Brogden wrote:Exactly what happens in a "heart beat" request? Do you request the session for every heart beat request?

Bill


I didn't request the session for the heart beat.... is this the problem?
The server just reply "OK" once it receives "heart beat" request.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13077
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is hardly what I meant by "exactly what happens" - I meant, what method gets called and what does it do.

If this was my problem I would have whatever method handles the request use getSession( false ) to exercise the session mechanism.

Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic