IllegalState during invalidate a (Delta)Session.

2006-01-27 Thread [EMAIL PROTECTED]

Hi there,

I've a little cluster with 4 Tomcats 5.5.12 running.
During tests I have found that exception while I
logged out a user on this cluster.

I hope this is the right Maillist for that problem...

java.lang.IllegalStateException: Cannot find message associated with key 
standardSession.getLastAccessedTime
   at 
org.apache.catalina.cluster.session.DeltaSession.getLastAccessedTime(DeltaSession.java:437)
   at 
org.apache.catalina.authenticator.SingleSignOn.sessionEvent(SingleSignOn.java:298)
   at 
org.apache.catalina.cluster.session.DeltaSession.fireSessionEvent(DeltaSession.java:1553)
   at 
org.apache.catalina.cluster.session.DeltaSession.expire(DeltaSession.java:735)
   at 
org.apache.catalina.cluster.session.DeltaSession.expire(DeltaSession.java:674)
   at 
org.apache.catalina.cluster.session.DeltaSession.expire(DeltaSession.java:662)
   at 
org.apache.catalina.cluster.session.DeltaSession.invalidate(DeltaSession.java:1068)
   at 
org.apache.catalina.cluster.session.DeltaSessionFacade.invalidate(DeltaSessionFacade.java:150)


I've searched the source-tree and changed the corresponding method from :
---
public long getLastAccessedTime() {
   if (!isValid) {
   throw new IllegalStateException(sm
   .getString("standardSession.getLastAccessedTime"));
   }
  return (this.lastAccessedTime);
}

to (now it will call the isValid()-method instead of the isValid field)

public long getLastAccessedTime() {
   if (!isValid()) {
   throw new IllegalStateException(sm
   .getString("standardSession.getLastAccessedTime"));

   }  
   return (this.lastAccessedTime);

}
---

This fixed my logout process immediately.
The same problem was with Tomcat 5.5.15.

Is that a known bug? Has anyone fixed this problem in an offical patch?



--

regards,
   Tom Neumann / tone


"Der Heitere ist der Meister seiner Seele."

William Shakespeare (1564 - 1616)



-----
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: IllegalState during invalidate a (Delta)Session.

2006-01-29 Thread [EMAIL PROTECTED]

Hmm.
Ok, there was an old entry in my server.xml which starts the SingleSignOn.
That was an mistake by myself.

Without SingleSignOn there are no exceptions during logout.

Will make some test next days. Think that the exception is not
ok when I invalidate the session.



Peter Rossbach schrieb:


Hey,

a)DeltaSession and StandardSession has the exact same behaviour.
b)SingleSignOn valve can't detect invalidation with call isValid()
 expiring flag is true at the exipre call. It set to false after  
SessionDestroy event is called. But before the event is fired, the  
isValid flag is set to false.


--- DeltaSession and StandardSession   
public boolean isValid() {


if (this.expiring) {
return true;
}

if (!this.isValid ) {
return false;
}


Only chance seams change lastAccessedTime condition
public long getLastAccessedTime() {
if (!expiring && !isValid) {
throw new IllegalStateException(sm
.getString 
("standardSession.getLastAccessedTime.ise"));


}
return (this.lastAccessedTime);

}

or we must handle the ISE exception at SingleSignOn valve.

A testcase is very welcomed

Peter


Am 27.01.2006 um 17:00 schrieb Filip Hanik - Dev Lists:

I can't implement the change you suggest as it could result in a  
circular loop,
expire - fire event - last access -> isValid() -> expire -> fire  
event -> last access


I have added in the missing message for this event, if you are not  
happy with that solution, please provide a simple test case for me  
and I will make the adjustments


Filip


[EMAIL PROTECTED] wrote:


Hi there,

I've a little cluster with 4 Tomcats 5.5.12 running.
During tests I have found that exception while I
logged out a user on this cluster.

I hope this is the right Maillist for that problem...

java.lang.IllegalStateException: Cannot find message associated  
with key standardSession.getLastAccessedTime
   at  
org.apache.catalina.cluster.session.DeltaSession.getLastAccessedTime( 
DeltaSession.java:437)
   at  
org.apache.catalina.authenticator.SingleSignOn.sessionEvent 
(SingleSignOn.java:298)
   at  
org.apache.catalina.cluster.session.DeltaSession.fireSessionEvent 
(DeltaSession.java:1553)
   at org.apache.catalina.cluster.session.DeltaSession.expire 
(DeltaSession.java:735)
   at org.apache.catalina.cluster.session.DeltaSession.expire 
(DeltaSession.java:674)
   at org.apache.catalina.cluster.session.DeltaSession.expire 
(DeltaSession.java:662)
   at  
org.apache.catalina.cluster.session.DeltaSession.invalidate 
(DeltaSession.java:1068)
   at  
org.apache.catalina.cluster.session.DeltaSessionFacade.invalidate 
(DeltaSessionFacade.java:150)


I've searched the source-tree and changed the corresponding method  
from :

---
public long getLastAccessedTime() {
   if (!isValid) {
   throw new IllegalStateException(sm
   .getString ("standardSession.getLastAccessedTime"));
   }
  return (this.lastAccessedTime);
}

to (now it will call the isValid()-method instead of the isValid  
field)


public long getLastAccessedTime() {
   if (!isValid()) {
   throw new IllegalStateException(sm
   .getString ("standardSession.getLastAccessedTime"));

   } return (this.lastAccessedTime);
}
---

This fixed my logout process immediately.
The same problem was with Tomcat 5.5.15.

Is that a known bug? Has anyone fixed this problem in an offical  
patch?




--

regards,
   Tom Neumann / tone


"Der Heitere ist der Meister seiner Seele."

William Shakespeare (1564 - 1616)



---------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to load a static class on Tomcat startup

2007-06-01 Thread [EMAIL PROTECTED]
Hello everybody,
I want to know how I can configure Tomcat to load a Singleton class on his 
startup routine? This class implement a cache that I want to stay in memory 
until Tomcat is shutted down.

I've read about context but it seem to load the class only on a particular URL 
request..

I want the class to be loaded with Tomcat, without any request is made.

Thanks to all

Andrea


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]