>________________________________
> From: Dhaval Jaiswal <dhaval.jais...@via.com>
>To: Tomcat Users List <users@tomcat.apache.org>; Mark Eggers 
><its_toas...@yahoo.com> 
>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="org.apache.catalina.tribes.group.GroupChannel">
>             <Membership 
>className="org.apache.catalina.tribes.membership.McastService"
>                        address="228.0.0.4"
>                        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="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>
>             <Interceptor 
>className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor"/>
>
>           </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>
></Server>
>
>
>
>
>Below is the context.xml
>
>
><?xml version='1.0' encoding='utf-8'?>
>
><Context>
>
>    <WatchedResource>WEB-INF/web.xml</WatchedResource>
>    
>    <ResourceLink name="xyz" global="xyz" type="javax.sql.DataSource"/>
></Context>
>
>
>
>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(AbstractReplicatedMap.java:230)
>
> Failed to start BackupManager:  java.lang.IllegalArgumentException:
> Listener already
> exists:{}[org.apache.catalina.tribes.tipis.LazyReplicatedMap]


OK,

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

<Listener
  className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>

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

<!--
<Connector port="8080" protocol="HTTP/1.1" 
           connectionTimeout="20000" 
           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
   out.
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
   workers.properties 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"
   protocol="AJP/1.3"
   redirectPort="8453"
           connectionTimeout="600000"
           URIEncoding="UTF-8"/>

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.

<Membership
      className="org.apache.catalina.tribes.membership.McastService"
      address="228.0.0.4"
      port="45564"
      frequency="500"
      dropTime="10000"/>

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
$CATALINA_BASE/conf/context.xml.

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
$CATALINA_BASE/conf/Catalina/[host].

For example, if you want this in every application:

<ResourceLink
  name="xyz"
  global="xyz"
  type="javax.sql.DataSource"/>

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

<Host name="localhost"
      appBase="webapps"
      unpackWARs="true"
      autoDeploy="true"
      xmlValidation="false"
      xmlNamespaceAware="false">
</Host>

Then you would place the following context.xml.default

<?xml version="1.0" encoding="UTF-8"?>
<Context>
  <ResourceLink
    name="xyz"
    global="xyz"
    type="javax.sql.DataSource"/>
</Context>

in $CATALINA_BASE/conf/Catalina/localhost.

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

META-INF/context.xml

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

$CATALINA_BASE/conf/Catalina/localhost/appname.xml

or directly in the file above.

Please read the documentation at:

http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

In a previous message, I had recommended that you edit the default
logging.properties 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 logging.properties
file as previously posted.

TODO:

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 logging.properties 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
      application

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

http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html

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.

OTHER NOTES:

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
   message

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
complete):

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.
/mde/


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

Reply via email to