[jboss-user] [Clustering/JBoss] - Re: RoundRobin, new cluster member & SFSB == NPE
ben.wang@jboss.com
do-not-reply at jboss.com
Tue Nov 7 03:47:32 EST 2006
No, I can't reproduce from my system. I have tried both RoundRobin and FirstAvailable. They failover just fine. I use two node cluster to restart one.
Here is my bean code snippet:
| @Stateful(name="GangDispute")
| @Clustered(loadBalancePolicy= org.jboss.ha.framework.interfaces.FirstAvailable.class)
| //@Clustered
| @Remote(GangDispute.class)
| public class GangDisputeBean implements java.io.Serializable, GangDispute
| {
| private long arrestedGuys = 0;
|
| public long newGuysArrested(long newArrests)
| {
| arrestedGuys+=newArrests;
| System.out.println("Total arrested guys: " + arrestedGuys + "( +" + newArrests + " arrests)");
| return arrestedGuys;
| }
|
| public long getNbArrestedGuys ()
| {
| return arrestedGuys;
| }
|
and client
| Client () throws Exception
| {
| //Get JNDI context
| Context naming = new InitialContext ();
| ClassLoader loader = Thread.currentThread().getContextClassLoader();
| Enumeration rsrcs = loader.getResources("jndi.properties");
| while( rsrcs.hasMoreElements() )
| {
| System.out.println(rsrcs.nextElement());
| }
| System.out.println("JNDI.env: "+naming.getEnvironment());
| System.out.println("Looking up GangDispute/remote");
| //Look up the Remote
| gd = (GangDispute)naming.lookup ("GangDispute/remote");
| }
|
| public void test ()
| {
|
| try
| {
| while (true)
| {
| long total = gd.newGuysArrested (1);
| System.out.println("Total number of arrested guys: " + total);
|
| try
| {
| synchronized (this)
| {
| this.wait (1000);
|
| ...
|
and jndi.prperties:
| java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
| java.naming.provider.url=jnp://localhost:1100
| java.naming.factory.url.pkgs=org.jboss.naming
|
I am now using exactly 4.0.5.GA as well. How do you run yours?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983664#3983664
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983664
More information about the jboss-user
mailing list