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

viniciuscarvalho do-not-reply at jboss.com
Mon Jun 11 16:55:31 EDT 2007


Hello there! I'm trying to get a SFSB in a jboss 4.2.0 cluster. It's a simple example. A bean that increments a value. My bean's interface and implementation:


  | @Remote
  | public interface Contador {
  | 
  | 	public abstract int increase();
  | 
  | 	public abstract int decrease();
  | 
  | }
  | 
  | @Stateful
  | public class ContadorBean implements Contador {
  | 	private int count;
  | 	
  | 	public int increase(){
  | 		count++;
  | 		System.out.println("Contador no valor: " + count);
  | 		return count;
  | 	}
  | 	
  | 	public int decrease(){
  | 		count--;
  | 		System.out.println("Contador no valor: " + count);
  | 		return count;
  | 	}
  | 	
  | 	@Remove
  | 	public void destroy(){
  | 		
  | 	}
  | }
  | 
  | jndi properties for the client:
  | java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
  | java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
  | java.naming.provider.url=jnp://192.168.0.169:1100
  | 
  | jboss.xml:
  | <jboss>
  |   <enterprise-beans>
  |    <session>
  |       <ejb-name>ContadorBean</ejb-name>
  |       <clustered>True</clustered>
  |     </session>
  |   </enterprise-beans>
  | </jboss>
  | 
  | 

Well, I startup 2 instances, deploy the package on the farm directory. and start the client. Things are just ok :) 
So I decide to shutdown one of the nodes...
and I get this exception:


  | Exception in thread "main" java.lang.RuntimeException: cluster invocation failed, last exception was: 
  | 	at org.jboss.aspects.remoting.ClusterChooserInterceptor.invoke(ClusterChooserInterceptor.java:166)
  | 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | 	at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
  | 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | 	at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
  | 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | 	at org.jboss.ejb3.remoting.ClusteredIsLocalInterceptor.invoke(ClusteredIsLocalInterceptor.java:55)
  | 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | 	at org.jboss.ejb3.stateful.StatefulClusteredProxy.invoke(StatefulClusteredProxy.java:108)
  | 	at $Proxy2.increase(Unknown Source)
  | 	at x.x.x.jboss.client.ContadorClient.execute(ContadorClient.java:27)
  | 	at x.x.x.jboss.client.ContadorClient.main(ContadorClient.java:16)
  | Caused by: org.jboss.aop.NotFoundInDispatcherException: Object with oid: jboss.j2ee:jar=increment.jar,name=ContadorBean,service=EJB3 was not found in the Dispatcher
  | 	at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:85)
  | 	at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
  | 	at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:734)
  | 	at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:560)
  | 	at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:369)
  | 	at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:165)
  | 	at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:163)
  | 	at org.jboss.remoting.Client.invoke(Client.java:1550)
  | 	at org.jboss.remoting.Client.invoke(Client.java:530)
  | 	at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
  | 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | 	at org.jboss.aspects.remoting.ClusterChooserInterceptor.invoke(ClusterChooserInterceptor.java:77)
  | 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | 	at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
  | 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | 	at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
  | 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | 	at org.jboss.ejb3.remoting.ClusteredIsLocalInterceptor.invoke(ClusteredIsLocalInterceptor.java:55)
  | 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | 	at org.jboss.ejb3.stateful.StatefulClusteredProxy.invoke(StatefulClusteredProxy.java:108)
  | 	at $Proxy2.increase(Unknown Source)
  | 	at x.x.x.jboss.client.ContadorClient.execute(ContadorClient.java:27)
  | 	at x.x.x.jboss.client.ContadorClient.main(ContadorClient.java:16)
  | 	at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:74)
  | 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | 	at org.jboss.aspects.remoting.ClusterChooserInterceptor.invoke(ClusterChooserInterceptor.java:77)
  | 	... 11 more
  | 
  | 

Am I missing something here?

Regards

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

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



More information about the jboss-user mailing list