-
1. Re: EJB 3.0 Session Bean (Stateless) Cluster
chapata_gunner Jul 4, 2007 6:30 AM (in response to chapata_gunner)Did a little more research...
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4059988#4059988
If i put the code that I used to put in a Servlet inside a normal Java file and execute it ... Everything works properly. So it seems that in order for LoadBalancing to work properly we need to execute the calls from a separate JVM. Is that correct?
Can anyone please confirm it?
Also is there any way to move past this restriction? -
2. Re: EJB 3.0 Session Bean (Stateless) Cluster
chapata_gunner Jul 4, 2007 7:25 AM (in response to chapata_gunner)OK! Finally found a solution to my problem :)
JBoss 'all' domain comes with certain AOP interceptors for EJB3. Of these the IsLocalInterceptor and ClusteredIsLocalInterceptor were creating all this fuss. I just disabled them and everything works fine. -
3. Re: EJB 3.0 Session Bean (Stateless) Cluster
brian.stansberry Jul 4, 2007 10:38 AM (in response to chapata_gunner)You'vre done well on your hunt. :-)
Be aware, though, that you might have problems if you have a transaction running and you make an EJB call that ends up going to the in-VM bean. The TxPropagationInterceptor will not handle this well if the (Clustered)IsLocalInterceptor is bypassed. See http://jira.jboss.com/jira/browse/EJBTHREE-1005.
This will only be a problem for you if your servlet initiates transactions or your beans make calls from one to another within a tx. -
4. Re: EJB 3.0 Session Bean (Stateless) Cluster
ricott Sep 7, 2007 3:54 AM (in response to chapata_gunner)I'm trying to do the exact same thing and I also noticed that the round robin works if the client code is executed from another jvm. I see your solution is to disable IsLocalInterceptor and ClusteredIsLocalInterceptor in the ejb3-interceptors-aop.xml file. I see in the DTD that the interceptor scope can be PER_VM|PER_CLASS|PER_INSTANCE|PER_JOINPOINT|PER_CLASS_JOINPOINT and the default is PER_VM. What value should I change it to or what do you mean by disabling IsLocalInterceptor and ClusteredIsLocalInterceptor?
-
5. Re: EJB 3.0 Session Bean (Stateless) Cluster
ricott Sep 10, 2007 5:17 AM (in response to chapata_gunner)I must say that I'm a bit puzzled that this is something that you must configure in an (obscure) config file in order to get it to work. And perhaps even more that you cannot find anything about it in the documentation.
Is it an uncommon scenario that you want to have a process that runs on one node in a cluster and then spreads the load on all nodes via a clustered slsb that typically uses round robin? At least I didn?t think so before I tried it.
Anyways, I found the place in the ejb3-interceptors-aop.xml file (I think) and got it working<stack name="StatelessSessionClientInterceptors"> <!--<interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>--> <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/> <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/> <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/> </stack>
And<stack name="ClusteredStatelessSessionClientInterceptors"> <!--<interceptor-ref name="org.jboss.ejb3.remoting.ClusteredIsLocalInterceptor"/>--> <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/> <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/> <interceptor-ref name="org.jboss.aspects.remoting.ClusterChooserInterceptor"/> <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/> </stack>