3 Replies Latest reply on Sep 7, 2010 1:09 PM by kaddy k

    JBoss Clustering, no Failover ?

    ste wer Newbie

      Hey guys.
      I have installed two JBoss 5.1 AS and startet it with th standard-all-config.
      I prepared the booking-example the of the Seam Framework for "clustering" (set distributable and changed the Information the JIRA provides).
      Next step was to deploy the example to the Farm-Folder after starting both JBoss 5.1 GA instances with the all config successfully.
      Deploying was ok, also the replication to the second node.

      So far, so good.
      Now I tried to start a http-session of the SEAM booking example by entering <IP first node>:/seam-booking and login in into an account.

      The Problem now... there is no session replication?

      I set the example to distributable, changed the annotation to "true".

      What could be the problem.
      why does replication doesn't work?

      Greetz Steppi

        • 1. Re: JBoss Clustering, no Failover ?
          kaddy k Newbie

          Did you got the solution to this problem ? I am facing exactly the same issue.

          • 2. Re: JBoss Clustering, no Failover ?
            Sarada Mohanty Newbie
            STEPS TO BE FOLLOWED:-
            Below is a typical deploy/jbossweb-cluster.sar/META-INF/jboss-service.xml file. The configuration attributes in the TomcatClusteringCache MBean are very similar to those in the JBoss AS cache configuration.
            <mbean code="org.jboss.cache.aop.TreeCacheAop"
                name="jboss.cache:service=TomcatClusteringCache">

                <depends>jboss:service=Naming</depends>
                <depends>jboss:service=TransactionManager</depends>
                <depends>jboss.aop:service=AspectDeployer</depends>

                <attribute name="TransactionManagerLookupClass">
                    org.jboss.cache.BatchModeTransactionManagerLookup
                </attribute>
               
                <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
               
                <attribute name="CacheMode">REPL_ASYNC</attribute>
               
                <attribute name="ClusterName">
                  Tomcat-${jboss.partition.name:Cluster}
                </attribute>
               
                <attribute name="UseMarshalling">false</attribute>
               
                <attribute name="InactiveOnStartup">false</attribute>
               
                <attribute name="ClusterConfig">
                    ... ...
                </attribute>
               
              
                <attribute name="LockAcquisitionTimeout">15000</attribute>
                <attribute name="SyncReplTimeout">20000</attribute>
            </mbean>
            Note that the value of the mbean element's code attribute is org.jboss.cache.aop.TreeCacheAop, which is different from the other JBoss Cache Mbeans used in JBoss AS. This is because FIELD granularity HTTP session replication (covered below) needs the added features of the TreeCacheAop (a.k.a. PojoCache) class.
            To enable clustering of your web application you must tag it as distributable in the web.xml descriptor. Here's an example:
            <?xml version="1.0"?> 
            <web-app  xmlns="http://java.sun.com/xml/ns/j2ee"
                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
                                          http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
                      version="2.4">
                <distributable/>
                <!-- ... -->
            </web-app>
            You can futher configure session replication using the replication-config element in the jboss-web.xml file. Here is an example:
            <jboss-web>
                <replication-config>
                    <replication-trigger>SET_AND_NON_PRIMITIVE_GET</replication-trigger>
                    <replication-granularity>SESSION</replication-granularity>
                    <replication-field-batch-mode>true</replication-field-batch-mode>
                </replication-config>
            </jboss-web>

            Please try the above steps.
            Hope it will help you.
            • 3. Re: JBoss Clustering, no Failover ?
              kaddy k Newbie

              Thanks Sarada for detail steps. I followed all these steps but still was not able to get session fail over. I have stateful ejb's in my EAR file that I deployed in farm folder. Does it need some special attention ?