[jboss-user] [EJB 3.0] - Re: Cluster Stateful EJB 3.0 problems

viniciuscarvalho do-not-reply at jboss.com
Tue Jun 12 13:10:46 EDT 2007


Well here's the code for the client:

  | public void execute(){
  | 		Contador contador = obterContador();
  | 		int total = 0;
  | 		for(int i=0;i<repeat;i++){
  | 			total = contador.increase();
  | 			System.out.println("O total é:" + total);
  | 			try {
  | 				Thread.sleep(5000);
  | 			} catch (InterruptedException e) {
  | 				e.printStackTrace();
  | 			}
  | 		}
  | 	}
  | 	
  | 	public Contador obterContador(){
  | 		Contador contador = null;
  | 		try {
  | 			Properties p = new Properties();
  | 			p.put(Context.INITIAL_CONTEXT_FACTORY,
  | 			      "org.jnp.interfaces.NamingContextFactory");
  | 			p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
  | 			p.put(Context.PROVIDER_URL, "192.168.0.39:1100"); // HA-JNDI port.
  | 
  | 			InitialContext ctx = new InitialContext(p);
  | 			contador = (Contador) ctx.lookup("ContadorBean/remote");
  | 		} catch (NamingException e) {
  | 			e.printStackTrace();
  | 		}
  | 		return contador;
  | 	}
  | 
Yeah, pretty much what you've described :

After a few calls and during the sleep of the client, I shutdown the server that is responding to the calls. I was hopping that the second node would answer the calls. 

PS: I've ran the JGroups tests for receiver and sender, the draw example, and both works ok.

Best regards

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4053674#4053674

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4053674




More information about the jboss-user mailing list