tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Eggers <>
Subject Re: SEVERE: Unable to start cluster.
Date Sat, 07 Apr 2012 16:34:49 GMT
> From: Dhaval Jaiswal <>
>To: Tomcat Users List <>; Mark Eggers <>

>Sent: Friday, April 6, 2012 4:29 AM
>Subject: Re: SEVERE: Unable to start cluster.
>Yes we have <distributable/> in web.xml
>Below is the full server.xml for all the tomcats.
><?xml version='1.0' encoding='utf-8'?>
><Server port="8005" shutdown="SHUTDOWN">
>  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on"
>  <Listener className="org.apache.catalina.core.JasperListener" />
>  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
>  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
>  <GlobalNamingResources>
>    <Resource name="UserDatabase" auth="Container"
>              type="org.apache.catalina.UserDatabase"
>              description="User database that can be updated and saved"
>              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
>              pathname="conf/tomcat-users.xml" />
>    <Resource name="xyz" auth="Container" type="javax.sql.DataSource"
>        driverClassName="xyz.Driver" url="jdbc url"
>        username="xyz" password="xyz"
>        maxActive="150" maxIdle="10" maxWait="30000"
>        removeAbandoned="true" removeAbandonedTimeout="120" logAbandoned="true"
>  </GlobalNamingResources>
>  <Service name="Catalina">
>    <Connector port="8080" protocol="HTTP/1.1" 
>               connectionTimeout="20000" 
>               redirectPort="8443" />
>    <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
>               maxThreads="150" scheme="https" secure="true"
>               clientAuth="false" sslProtocol="TLS" />
>    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" backlog="100"
maxThreads="40000" />
>    <Engine name="Catalina" defaultHost="localhost" jvmRoute="t5">
>      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster" channelSendOptions="6">
>        <Manager className="org.apache.catalina.ha.session.BackupManager" expireSessionsOnShutdown="false"
>                   notifyListenersOnReplication="true" mapSendOptions="6"/>
>            <Channel className="">
>             <Membership className="org.apache.catalina.tribes.membership.McastService"
>                        address=""
>                        port="45564"
>                        frequency="500"
>                        dropTime="30000"/>
>             <Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"
>                      address="auto"
>                      port="4000"
>                      selectorTimeout="5000"
>                      timeout="60000"
>                      maxThreads="6"/>
>             <Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
>                  <Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"
timeout="60000" keepAliveCount="0"/>
>             </Sender>
>             <Interceptor className=""/>
>             <Interceptor className=""/>
>           </Channel>
>         <Valve className="org.apache.catalina.ha.tcp.ReplicationValve"
>                 filter=".*\.gif|.*\.js|.*\.jpeg|.*\.jpg|.*\.png|.*\.htm|.*\.html|.*\.css|.*\.txt"/>
>         <Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>
>       <ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/>

>       <ClusterListener className="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener"/>
>     </Cluster> 
>      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>             resourceName="UserDatabase"/> 
>      <Host name="localhost"  appBase="webapps"
>            unpackWARs="true" autoDeploy="true"
>            xmlValidation="false" xmlNamespaceAware="false">
>      </Host>
>    </Engine>
>  </Service>
>Below is the context.xml
><?xml version='1.0' encoding='utf-8'?>
>    <WatchedResource>WEB-INF/web.xml</WatchedResource>
>    <ResourceLink name="xyz" global="xyz" type="javax.sql.DataSource"/>
>still it is throwing error while deploying apps. 
>WARNING: Unable to send map start message.
> Apr 5, 2012 1:37:12 PM org.apache.catalina.ha.session.BackupManager start
> SEVERE: Unable to start BackupManager
> java.lang.RuntimeException: Unable to start replicated map.
>        at
> org.apache.catalina.tribes.tipis.AbstractReplicatedMap.init(
> Failed to start BackupManager:  java.lang.IllegalArgumentException:
> Listener already
> exists:{}[org.apache.catalina.tribes.tipis.LazyReplicatedMap]


Let's go through this again. I've deleted my last response since none of that
seems to have made it into your current configuration.

1. Add the leak prevention listener back to your server.xml


2. If you are not using the HTTP/1.1 connector, comment it out.

<Connector port="8080" protocol="HTTP/1.1" 
           redirectPort="8443" />

3. If you are not using the SSL connector, comment it out.

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
           maxThreads="150" scheme="https" secure="true"
           clientAuth="false" sslProtocol="TLS" />

4. Fix your AJP connector by:

a) Reducing the number of threads. You currently have 40,000 threads
   per AJP connector times 10 Tomcats. These threads will never time
b) Add URIEncoding="UTF-8" to your connector
c) Set a reasonable connectionTimeout value in milliseconds and match
   that with connection_pool_timeout in seconds in your file. Otherwise the connection between Apache
   HTTD and Tomcat will never close even when idle.

<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009"

The time above (600 seconds, 10 minutes) was taken from the example
connector settings found in the latest Tomcat connectors source. It's
a good default set by knowledgeable people.

5. Fix your drop time in your Membership element to be something
   reasonable and/or improve your network infrastructure.


10 seconds should be reasonable.

Now, on to the other information:

The context.xml that you posted looks a lot like the context.xml from

First of all, in general do NOT edit this file. If you want a default
resource for every application on a particular Tomcat host, then add
that information to a context.xml.default file in

For example, if you want this in every application:


And you only have the following host defined in server.xml:

<Host name="localhost"

Then you would place the following context.xml.default

<?xml version="1.0" encoding="UTF-8"?>

in $CATALINA_BASE/conf/Catalina/localhost.

This is NOT the normal place for ResourceLink definitions. The normal
place is either:


of the web application (which will then be copied to the following)


or directly in the file above.

Please read the documentation at:

In a previous message, I had recommended that you edit the default file so that you could track cluster messages
separately from the rest of catalina.out.

If you have not done this, then please modify the
file as previously posted.


1. Please clean up the server.xml file as noted above
2. Please clean up the context.xml file as noted above
3. Please modify the file as noted previously
4. Please post the following inline
   a) complete context.xml from your web application with sensitive
      information removed
   b) complete web.xml from your web application with sensitive
      information removed
   c) contents of the cluster.[date].log file before adding your

As Mark Thomas pointed out in another thread, simply taking the
default cluster configuration from:

and replacing DeltaManager with BackupManager works. I have done this
as well on a small (4 node) cluster. This works fine with my random
pet generator test application.


These notes are important if you wish to continue to receive responses
from volunteers on the mailing list (at least in my opinion).

1. Do not CC the person who replied to your question unless
   specifically asked to.

2. Do not post HTML mail.

3. Do not top post, since this makes it very difficult to follow the
   thread of the conversation. Having to scroll up and down the mail
   message to figure out the context of a complex discussion is one
   sure way to reduce participation by many on the mailing list.

4. Do not hijack threads. If you have a new question, start a new mail

5. Do not start multiple threads on the same topic. The answer will
   not be generated any faster.

6. Post the final resolution to the mailing list so we can point
   people to the archives the next time this comes up. Consider
   writing a Wiki article if there is consensus on the mailing list.

7. Thank the people for their help. I do this on a volunteer basis (as
   I suspect most others here do). Thanks for the effort is nice.

8. Put in at least as much effort as the people on the mailing list.

This last one is really important. This means (and the list is not

a. Read the documentation
b. Ask specific questions
c. Provide complete details
d. When someone asks for information, please supply it

I'm not a mind reader, I don't know your environment, and I don't know
your application. When I ask for information it's because I am
interested in helping, and interested in the answer. Without this
information I am essentially blind. OK, sometimes with the
information, I am essentially blind, but that's why there are lots of
eyes in this mailing list. Someone will at least have an idea.

. . . just my (long) 2 cents.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message