3 Replies Latest reply on Oct 11, 2012 10:20 AM by sourav bairagi

    Jboss AS 7.1.1.Final and Apache Http server 2.2 clustering problem..

    sourav bairagi Newbie

      I trying to understand standalone mode clustering of Jboss in windows xp using APACHE  2.2 and HTTPD 2.2 and Jboss AS 7.1.1.Final and it was successful with the application shown below,





      public class ClusteredStatelessBean {

          private final static Logger LOG =


          public String getNodeName() {

              LOG.info("invoke getNodeName()");

              try {

                  String jbossNodeName =


                  return jbossNodeName != null ? jbossNodeName :


              } catch (UnknownHostException e) {

                  throw new RuntimeException(e);









      public class ClusteredStatefulBean {

          private final static Logger LOG =


          private int counter;

          public int getCounterValue() {

              LOG.info("invoke getCounter()");

              return counter++;



          public void passivate() {

              LOG.info("passivate ejb component: " + this);



          public void activate() {

              LOG.info("activate ejb component: " + this);




      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"


      <html xmlns="http://www.w3.org/1999/xhtml"




                   <title>Cluster example</title>

                   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

                            <link rel="shortcut icon"


                                              type="image/x-icon" />



                          <h1>JBoss AS 7 - cluster demo</h1>

                            <p>Node: #{clusteredStatelessBean.nodeName}</p>

                          <p>Replicated counter: #{clusteredStatefulBean.counterValue}</p>





      The example stateful session bean is a CDI component associated to the HTTP session. The bean has a counter which is increased every time it is read by the getter-method getCounterValue(). With the counter you can track how often the bean was invoked during the session.



      in the apche httpd.config i have done the following

      added this following modules,

      LoadModule proxy_module modules/mod_proxy.so

      LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

      LoadModule slotmem_module modules/mod_slotmem.so

      LoadModule manager_module modules/mod_manager.so

      LoadModule proxy_cluster_module modules/mod_proxy_cluster.so

      LoadModule advertise_module modules/mod_advertise.so



      also added the following


      # Adjust to you hostname and subnet.


      <IfModule manager_module>


        ManagerBalancerName mycluster


          <Location />

            Order deny,allow

            Deny from all

            Allow from 127.0.0.


          KeepAliveTimeout 300

          MaxKeepAliveRequests 0

          #ServerAdvertise on http://@IP@:6666

          AdvertiseFrequency 5

          #AdvertiseSecurityKey secret 

          #AdvertiseGroup @ADVIP@:23364


          <Location /mod_cluster_manager>

            SetHandler mod_cluster-manager

            Order deny,allow

            Deny from all

            Allow from 127.0.0.






      But when i went on further and deployed my own application which uses javax.persistence, richfaces and hibernate along with JSF. while we are running a single node jboss standalone cluster the application runs fine and smooth using apache httpd url  ie



      but when running more then one standalone jboss node of jboss, when ever i access the above url in jboss server node i see lots of error trace which i am unable to debug. attaching the jboss server log.



      Can you plz suggest me an way out of this ...



      thanks in advance