You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Amila Suriarachchi <am...@gmail.com> on 2006/04/04 13:50:34 UTC

cluster prblem

hi,
I created a tomcat cluster (using tomcat 5.5.15 and jdk 1.5.0_06 in linux)
with two nodes,
by uncommenting the existing cluster element in server.xml and changing the
tcplisten ports.

And I created a web application to test the cluster (put and entry
<distributable/> in web.xml).
Then I deployed the application in both servers and started the servers.

When I see the logs there are no errros and every things seems to be ok.

Then I access the application of one server, and see the nummber of sessions
of that application
in both servers using tomcat manager. Here I found that both nodes have
sessions and according to
my application i think that session is being replicated.

But when i check the catalina.out it has following exception.
SEVERE: TCP Worker thread in cluster caught 'java.io.IOException: Connection
reset by peer' closing channel
java.io.IOException: Connection reset by peer
        at sun.nio.ch.FileDispatcher.read0(Native Method)
        at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:21)
        at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:233)
        at sun.nio.ch.IOUtil.read(IOUtil.java:206)
        at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:207)
        at org.apache.catalina.cluster.tcp.TcpReplicationThread.drainChannel
(TcpReplicationThread.java:125)
        at org.apache.catalina.cluster.tcp.TcpReplicationThread.run(
TcpReplicationThread.java:69)

And also
In my web application I have a class which implements the
HttpSessionActivationListener, HttpSessionBindingListener and Serializable
interfaces.
and I store an instance of this class as an attribute of the httpSession.
In this case I think the sessionWillPassivate and sessionDidActivate should
be called when the session
is replicated across different jvms. But it seems this does not happens.
(i.e. it does not print my log messages)

can someone explain this,

amila.

Re: cluster prblem

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
that is a feature that is not implemented, as the session gets 
replicated in delta's (only known changes) the activation/passivation 
listeners are not invoked.

Filip

Amila Suriarachchi wrote:
> ok thankx for reply,
>
> What a about not calling methods of HttpSessionActivationListener listner.
> I set an object (of which class implements the
> HttpSessionActivationListener) as an
> attribute of the session. i think when this session being migrated conatiner
> should call
> these methods
>
> amila.
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: cluster prblem

Posted by Amila Suriarachchi <am...@gmail.com>.
ok thankx for reply,

What a about not calling methods of HttpSessionActivationListener listner.
I set an object (of which class implements the
HttpSessionActivationListener) as an
attribute of the session. i think when this session being migrated conatiner
should call
these methods

amila.

RE: cluster prblem

Posted by Tim Lucia <ti...@yahoo.com>.
I have seen the same behavior, but only under considerable load.  Changing
the replication strategy to 

          <Sender
className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
            replicationMode="fastasyncqueue"
            keepAliveTimeout="-1"/>

makes it go away.  I can confirm that application does not seem to suffer
from the 'exception' below, although it is disconcerting to some
management-types to see these exceptions in the logs.

Tim

-----Original Message-----
From: Filip Hanik - Dev Lists [mailto:devlists@hanik.com] 
Sent: Tuesday, April 04, 2006 9:25 AM
To: Tomcat Users List
Subject: Re: cluster prblem

Hi Amila, what you see below is not an actual error, although it seems to
be.
What happens is that you have keepalive set to the default value, so the
sending node will close it socket, and the receiving node will get an error
like this.
In future versions this has been reduced to info or warning, so you can
safely ignore this.

Filip

Amila Suriarachchi wrote:
> hi,
> I created a tomcat cluster (using tomcat 5.5.15 and jdk 1.5.0_06 in 
> linux) with two nodes, by uncommenting the existing cluster element in 
> server.xml and changing the tcplisten ports.
>
> And I created a web application to test the cluster (put and entry 
> <distributable/> in web.xml).
> Then I deployed the application in both servers and started the servers.
>
> When I see the logs there are no errros and every things seems to be ok.
>
> Then I access the application of one server, and see the nummber of 
> sessions of that application in both servers using tomcat manager. 
> Here I found that both nodes have sessions and according to my 
> application i think that session is being replicated.
>
> But when i check the catalina.out it has following exception.
> SEVERE: TCP Worker thread in cluster caught 'java.io.IOException: 
> Connection reset by peer' closing channel
> java.io.IOException: Connection reset by peer
>         at sun.nio.ch.FileDispatcher.read0(Native Method)
>         at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:21)
>         at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:233)
>         at sun.nio.ch.IOUtil.read(IOUtil.java:206)
>         at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:207)
>         at 
> org.apache.catalina.cluster.tcp.TcpReplicationThread.drainChannel
> (TcpReplicationThread.java:125)
>         at org.apache.catalina.cluster.tcp.TcpReplicationThread.run(
> TcpReplicationThread.java:69)
>
> And also
> In my web application I have a class which implements the 
> HttpSessionActivationListener, HttpSessionBindingListener and 
> Serializable interfaces.
> and I store an instance of this class as an attribute of the httpSession.
> In this case I think the sessionWillPassivate and sessionDidActivate 
> should be called when the session is replicated across different jvms. 
> But it seems this does not happens.
> (i.e. it does not print my log messages)
>
> can someone explain this,
>
> amila.
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: cluster prblem

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
Hi Amila, what you see below is not an actual error, although it seems 
to be.
What happens is that you have keepalive set to the default value, so the 
sending node will close it socket, and the receiving node will get an 
error like this.
In future versions this has been reduced to info or warning, so you can 
safely ignore this.

Filip

Amila Suriarachchi wrote:
> hi,
> I created a tomcat cluster (using tomcat 5.5.15 and jdk 1.5.0_06 in linux)
> with two nodes,
> by uncommenting the existing cluster element in server.xml and changing the
> tcplisten ports.
>
> And I created a web application to test the cluster (put and entry
> <distributable/> in web.xml).
> Then I deployed the application in both servers and started the servers.
>
> When I see the logs there are no errros and every things seems to be ok.
>
> Then I access the application of one server, and see the nummber of sessions
> of that application
> in both servers using tomcat manager. Here I found that both nodes have
> sessions and according to
> my application i think that session is being replicated.
>
> But when i check the catalina.out it has following exception.
> SEVERE: TCP Worker thread in cluster caught 'java.io.IOException: Connection
> reset by peer' closing channel
> java.io.IOException: Connection reset by peer
>         at sun.nio.ch.FileDispatcher.read0(Native Method)
>         at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:21)
>         at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:233)
>         at sun.nio.ch.IOUtil.read(IOUtil.java:206)
>         at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:207)
>         at org.apache.catalina.cluster.tcp.TcpReplicationThread.drainChannel
> (TcpReplicationThread.java:125)
>         at org.apache.catalina.cluster.tcp.TcpReplicationThread.run(
> TcpReplicationThread.java:69)
>
> And also
> In my web application I have a class which implements the
> HttpSessionActivationListener, HttpSessionBindingListener and Serializable
> interfaces.
> and I store an instance of this class as an attribute of the httpSession.
> In this case I think the sessionWillPassivate and sessionDidActivate should
> be called when the session
> is replicated across different jvms. But it seems this does not happens.
> (i.e. it does not print my log messages)
>
> can someone explain this,
>
> amila.
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org