thanks for the very diligent email,
open a bug, and I will address this issue shortly.

thank you for helping us make better software

Filip

-----Original Message-----
From: Aadi Deshpande [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 25, 2004 10:36 PM
To: Tomcat Users List
Subject: Re: Cluster error when starting up web application


Upon further research, it seems that DeltaSession.setId() fires the
sessionCreated events to registered listeners, but this happens before a
session is declared valid ( i.e. setValid(true) has not been called ).

so when a  registered listener tries to utilize ( what it seems to
believe is ) a newly created session, the setAttribute method throws the
IllegalStateException..

Now I don't know too much about how the actual workings of the
HttpSession should go, but in my opinion, the sessionCreated events
should not be fired unless a valid session has been created.  which
seems to imply that maybe setValid() should doing the firing...

However, that doesn't sit well with me since it doesn't make sense for a
session to be truly valid unless it has a sessionId, which either
forces there to be an implict order between setId() and setValid() which
is no good, requiring that either/or check to see if the other has been
truly satisfied, and setting up some sort of implicit sequence coupling.

the alternative, as I see it, is move the tellNew() invocation to the
DeltaManager ( it's declared public, so it's already exposed ).

I tried that, by patching up the TC5 sources and it seemed to resolve
the issue.

Again, as I know little to nothing of how sessions should work and what
other implications this refactoring may have, what should be my next
course of action?

Should I contact the webwork people? Is this not correct use of sessions
and session listeners?

Should I open up a bug and/or propose my patch?

Thanks in advance for reading and/or responding,

-a





Aadi Deshpande wrote:

> Hi,
>
> I just got Tomcat 5.0.19 and after setting up the new delta based
> cluster manager, i get this during the startup my application :
>
> SEVERE: Session event listener threw exception
> java.lang.IllegalStateException: setAttribute: Session already
> invalidated
>        at
>
org.apache.catalina.cluster.session.DeltaSession.setAttribute(DeltaSession.j
ava:1306)
>
>        at
>
org.apache.catalina.cluster.session.DeltaSession.setAttribute(DeltaSession.j
ava:1283)
>
>        at
>
org.apache.catalina.cluster.session.DeltaSessionFacade.setAttribute(DeltaSes
sionFacade.java:17
>
> 7)
>        at
>
com.opensymphony.webwork.lifecycle.SessionLifecycleListener.sessionCreated(S
essionLifecycleLis
>
> tener.java:50)
>        at
>
org.apache.catalina.cluster.session.DeltaSession.tellNew(DeltaSession.java:4
59)
>
>        at
>
org.apache.catalina.cluster.session.DeltaSession.setId(DeltaSession.java:431
)
>
>        at
>
org.apache.catalina.cluster.session.DeltaManager.createSession(DeltaManager.
java:377)
>
>        at
>
org.apache.catalina.cluster.session.DeltaManager.messageReceived(DeltaManage
r.java:895)
>
>        at
>
org.apache.catalina.cluster.session.DeltaManager.messageDataReceived(DeltaMa
nager.java:794)
>
>        at
>
org.apache.catalina.cluster.tcp.SimpleTcpCluster.messageDataReceived(SimpleT
cpCluster.java:561
>
> )
>        at
> org.apache.catalina.cluster.io.ObjectReader.execute(ObjectReader.java:117)
>
>        at
>
org.apache.catalina.cluster.tcp.TcpReplicationThread.drainChannel(TcpReplica
tionThread.java:17
>
> 6)
>        at
>
org.apache.catalina.cluster.tcp.TcpReplicationThread.run(TcpReplicationThrea
d.java:114)
>
>
>
>
> As far as I can tell, it's happening when I request a page that has
> the webwork2 RequestLifecycleFilter set for that url pattern.  The
> doFilter function creates a HttpSession if none exists, which I assume
> calls the SessionLifecycleListener.sessionCreated(), but for some
> reason, it seems like the session is being invalidated prematurely..
>
>
> Here's the relevant piece from my web.xml :
>    <filter>
>        <filter-name>container</filter-name>
>        <filter-class>
>
> com.opensymphony.webwork.lifecycle.RequestLifecycleFilter</filter-class>
>    </filter>
>    <filter-mapping>
>        <filter-name>container</filter-name>
>        <url-pattern>/*</url-pattern>
>        <!-- modify appropriately -->
>    </filter-mapping>
>    <listener>
>        <listener-class>
>
>
com.opensymphony.webwork.lifecycle.SessionLifecycleListener</listener-class>
>
>    </listener>
>    <listener>
>        <listener-class>
>
>
com.opensymphony.webwork.lifecycle.ApplicationLifecycleListener</listener-cl
ass>
>
>    </listener>
>
> and from my server.xml file, taken pretty much verbatim from the
> default server.xml:
>
>    <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
>
> managerClassName="org.apache.catalina.cluster.session.DeltaManager"
>                 expireSessionsOnShutdown="false"
>                 useDirtyFlag="true">
>
>            <Membership
>                className="org.apache.catalina.cluster.mcast.McastService"
>                mcastAddr="224.64.64.128"
>                mcastPort="45600"
>                mcastFrequency="500"
>                mcastDropTime="3000"/>
>
>     <Receiver
>
> className="org.apache.catalina.cluster.tcp.ReplicationListener"
>                tcpListenAddress="auto"
>                tcpListenPort="4060"
>                tcpSelectorTimeout="100"
>                tcpThreadCount="3"/>
>
>            <Sender
>
> className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
>                replicationMode="pooled"/>
>
>
>         <Valve
> className="org.apache.catalina.cluster.tcp.ReplicationValve"
>               filter=".*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"/>
>
>        </Cluster>
>
> Anyone know what's going on? Or can provide some insight into what I
> may be missing?
>
> Thanks for any info.
>
> -a
>
>
> ---------------------------------------------------------------------
> 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]
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.594 / Virus Database: 377 - Release Date: 2/24/2004

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.594 / Virus Database: 377 - Release Date: 2/24/2004


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

Reply via email to