5 Replies Latest reply on Jan 31, 2012 9:53 AM by Radoslav Husar

    5.1 not load-balancing ...Please Help!

    Joseph Fouts Novice

      I have 3 JBOSS servers clustered.  I see all three on the console say that they joined the cluster partition.

      Only 1 server is always called.  I have round-robin set and was expecting to see all 3 servers getting hit.



      Here is a brief overview:


      Running JBoss.5.1.0.GA

      Windows 7 64 Bit Pro on all 3 computers



      SessionBean1 - not clustered

      SessionBean2 - clustered


      Server 1

      Server 2

      Server 3


      All servers are started with -c <nodeName> -u -b <ip> -g clusterPartition1 -Djboss.messaging.



      Once all servers are started I see that all 3 servers have attached to the cluster.


      Program Flow


      Java client calls SessionBean1
      SessionBean1 calls java program


      java program creates initialContext -  


      Properties p = new Properties();  
      p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
      String partitionName = System.getProperty("jboss.partition.name", "clusterPartition1");
      p.put("jnp.partitionName", partitionName);         
           ctx = new InitialContext(p); 
      catch (Exception e)


      java programs calls a java program2 in a new thread


      New thread - java program 2 does a lookup of SessionBean2 using the passed initialContext


            bean = (BackgroundTranSessionRemoteINF) ctx.lookup(s);


      Why with this setup does SessionBean2 always run on Server1?




      Tried removing SessionBean2 from Server1's jar file.
      With this setup SessionBean2 now only runs on Server2.


      If I shutdown(failsafe) Server2 I then see  SessionBean2 only run on Server3.


      Can you explain why it happens this way? 
      I am trying to get SessionBean2 to run on all of the servers but I can't.




      I have been researching this for over a month and I can't seem to find the answer to my problem.

      Any help that you might be able to assist me with will be greatly appreciated.