Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
JSP - A mailing list about Java Server Pages specification and reference
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
Tomcat clustering broken - Unable to send message through cluster sender

Tomcat clustering broken - Unable to send message through cluster sender

2006-12-18       - By Spurlock, Robert J

 Back
Reply:     1     2  

All,
We've had Tomcat clustering working in test and production for months.
We run on HP UX 11.11.
We recently upgraded the OS and I think Tomcat clustering quit working
at that point.
I'm not sure of the OS connection but the session data is not being
replicated throughout the cluster.

We are running Tomcat 5.0.28.

Apparently clustering is failing at
ReplicationTransmitter.sendMessageData() on a null sender.

My question is what are the likely causes of the sender not being
available?  Is there a way to pickup additional logging that might
indicate why the sender is not available?

Are there any known Tomcat clustering bugs or problems related to HP UX
11.11 versions?

How should I debug this problem?

Some things I've tried:
1. Completely rebuilt the Tomcat environment in test and still got the
same SEVERE error.
2. Changed all the multicast port and TCP port stuff and it still did
not work.
3. Switched from using the
org.apache.catalina.cluster.session.SimpleTcpReplicationManager Source code of org.apache.catalina.cluster.session.SimpleTcpReplicationManager to
org.apache.catalina.cluster.session.DeltaManager Source code of org.apache.catalina.cluster.session.DeltaManager but that didn't help
either.

Thanks,
Jack



Reference

problem:
Dec 16, 2006 12:52:22 PM
org.apache.catalina.cluster.tcp.SimpleTcpCluster Source code of org.apache.catalina.cluster.tcp.SimpleTcpCluster send
SEVERE: Unable to send message through cluster sender.
java.io.IOException Source code of java.io.IOException: Sender not available. Make sure sender information
is available to the ReplicationTransmitter.
       at
org.apache.catalina.cluster.tcp.ReplicationTransmitter Source code of org.apache.catalina.cluster.tcp.ReplicationTransmitter(R
eplicationTransmitter.java:112)
       at
org.apache.catalina.cluster.tcp.ReplicationTransmitter Source code of org.apache.catalina.cluster.tcp.ReplicationTransmitter(Repli
cationTransmitter.java:136)
       at
org.apache.catalina.cluster.tcp.SimpleTcpCluster Source code of org.apache.catalina.cluster.tcp.SimpleTcpCluster(SimpleTcpCluster.j
ava:457)
       at
org.apache.catalina.cluster.session.SimpleTcpReplicationManager Source code of org.apache.catalina.cluster.session.SimpleTcpReplicationManager
eceived(SimpleTcpReplicationManager.java:539)
       at
org.apache.catalina.cluster.session.SimpleTcpReplicationManager Source code of org.apache.catalina.cluster.session.SimpleTcpReplicationManager
ataReceived(SimpleTcpReplicationManager.java:593)
       at
org.apache.catalina.cluster.tcp.SimpleTcpCluster Source code of org.apache.catalina.cluster.tcp.SimpleTcpCluster(Sim
pleTcpCluster.java:576)
       at
org.apache.catalina.cluster.io.ObjectReader Source code of org.apache.catalina.cluster.io.ObjectReader(ObjectReader.java:70
)
       at
org.apache.catalina.cluster.tcp.TcpReplicationThread Source code of org.apache.catalina.cluster.tcp.TcpReplicationThread(TcpRep
licationThread.java:129)
       at
org.apache.catalina.cluster.tcp.TcpReplicationThread Source code of org.apache.catalina.cluster.tcp.TcpReplicationThread(TcpReplicationT
hread.java:67)
Dec 16, 2006 12:54:11 PM
org.apache.catalina.cluster.tcp.SimpleTcpCluster Source code of org.apache.catalina.cluster.tcp.SimpleTcpCluster memberAdded
INFO: Replication member
added:org.apache.catalina.cluster.mcast.McastMember[tcp://192.54.4.16:40
09,192.54.4.16,4009, alive5220]

Here's the Tomcat 5.0.28 code from ReplicationTransmitter.java -
sendMessageData - line 112 = if ( sender == null ) throw ....

protected void sendMessageData(String sessionId, byte[] data,
IDataSender sender) throws java.io.IOException Source code of java.io.IOException  {
       if ( sender == null ) throw new java.io.IOException Source code of java.io.IOException("Sender not
available. Make sure sender information is available to the
ReplicationTransmitter.");
       try
       {
           if (!sender.isConnected())
               sender.connect();
           sender.sendMessage(sessionId,data);
           sender.setSuspect(false);
           addStats(data.length);
       }catch ( Exception x)
       {
           if ( !sender.getSuspect() ) {
               log.warn("Unable to send replicated message, is server
down?", x);
           }
           sender.setSuspect(true);

       }

Here's the Tomcat 5.0.28 code from ReplicationTransmitter.java -
sendMessageData - line 136 = sendMessageData()

public void sendMessage(String sessionId, byte[] indata, Member member)
throws java.io.IOException Source code of java.io.IOException
   {
       byte[] data = XByteBuffer.createDataPackage(indata);
       String key = member.getHost()+":"+member.getPort();
       IDataSender sender = (IDataSender)map.get(key);  << sender is
apparently null at this point
       sendMessageData(sessionId,data,sender);
   }

Also get an error like the following when the second server in the
cluster is starting:
  2006-12-17 11:18:26,259 ERROR (DeltaManager.java:663) -
Manager[/toolbox/tasks], No session state received, timing out.

Example cluster configuration from server.xml

Using SimpleTcpReplicationManager in production

       <Cluster
className="org.apache.catalina.cluster.tcp.SimpleTcpCluster Source code of org.apache.catalina.cluster.tcp.SimpleTcpCluster"

managerClassName="org.apache.catalina.cluster.session.SimpleTcpReplicati
onManager"
                expireSessionsOnShutdown="false"
                name="clusterProd"
                useDirtyFlag="false">

           <Membership

className="org.apache.catalina.cluster.mcast.McastService Source code of org.apache.catalina.cluster.mcast.McastService"
               mcastAddr="228.0.0.5"
               mcastPort="45565"
               mcastFrequency="500"
               mcastDropTime="3000"/>

           <Receiver

className="org.apache.catalina.cluster.tcp.ReplicationListener Source code of org.apache.catalina.cluster.tcp.ReplicationListener"
               tcpListenAddress="auto"
               tcpListenPort="4005"
               tcpSelectorTimeout="100"
               tcpThreadCount="6"/>

           <Sender

className="org.apache.catalina.cluster.tcp.ReplicationTransmitter Source code of org.apache.catalina.cluster.tcp.ReplicationTransmitter"
               replicationMode="asynchronous"/>

           <Valve
className="org.apache.catalina.cluster.tcp.ReplicationValve Source code of org.apache.catalina.cluster.tcp.ReplicationValve"

filter=".*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"/>

           <Deployer
className="org.apache.catalina.cluster.deploy.FarmWarDeployer Source code of org.apache.catalina.cluster.deploy.FarmWarDeployer"
                     tempDir="/tmp/war-temp/"
                     deployDir="/tmp/war-deploy/"
                     watchDir="/tmp/war-listen/"
                     watchEnabled="false"/>
       </Cluster>



OR - using DeltaManager in test

       <Cluster
className="org.apache.catalina.cluster.tcp.SimpleTcpCluster Source code of org.apache.catalina.cluster.tcp.SimpleTcpCluster"

managerClassName="org.apache.catalina.cluster.session.DeltaManager Source code of org.apache.catalina.cluster.session.DeltaManager"
                expireSessionsOnShutdown="false"
                useDirtyFlag="true">

           <Membership

className="org.apache.catalina.cluster.mcast.McastService Source code of org.apache.catalina.cluster.mcast.McastService"
               mcastAddr="228.0.1.9"
               mcastPort="45579"
               mcastFrequency="500"
               mcastDropTime="3000"/>

           <Receiver

className="org.apache.catalina.cluster.tcp.ReplicationListener Source code of org.apache.catalina.cluster.tcp.ReplicationListener"
               tcpListenAddress="auto"
               tcpListenPort="4109"
               tcpSelectorTimeout="100"
               tcpThreadCount="6"/>

           <Sender

className="org.apache.catalina.cluster.tcp.ReplicationTransmitter Source code of org.apache.catalina.cluster.tcp.ReplicationTransmitter"
               replicationMode="asynchronous"/>

           <Valve
className="org.apache.catalina.cluster.tcp.ReplicationValve Source code of org.apache.catalina.cluster.tcp.ReplicationValve"

filter=".*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"/>

           <Deployer
className="org.apache.catalina.cluster.deploy.FarmWarDeployer Source code of org.apache.catalina.cluster.deploy.FarmWarDeployer"
                     tempDir="/tmp/war-temp/"
                     deployDir="/tmp/war-deploy/"
                     watchDir="/tmp/war-listen/"
                     watchEnabled="false"/>
       </Cluster>


-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To start a new topic, e-mail: users@(protected)
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.