[jboss-user] [Clustering/JBoss] - Stateful Session replication not working......

fmarchioni do-not-reply at jboss.com
Wed Aug 20 05:20:08 EDT 2008


Hello,
I'm trying a basic Cluster SFSB which autoincrements a fields....

@Stateful
  | @Clustered
  | public class HelloBean implements HelloBeanItf,Serializable {
  | int counter = 0;
  | public void doSomething() {
  | 	counter++;
  | 	System.out.println("Value of counter is " + counter);
  | 
  | }

The code is recalled by a JSP

<%!
  | HelloBeanItf ejb = null;
  | 
  | public void jspInit () {
  | try {
  |  
  |  
  | InitialContext ctx = new InitialContext();
  | 
  | ejb = (HelloBeanItf) ctx.lookup("cluster/HelloBean/local");
  | }
  | catch (Exception exc) { exc.printStackTrace();
  | }
  | }
  | 
  |  
  | %>
  | 
  | <%
  | ejb.doSomething();
  |  %>
  |  
Unfortunately when I invoke the JSP the session seems not to replicate...in other words I can see the server is load balancing the calls between nodes but the value stays the same when moves from one node to the other

Node 1: 11:03:42,859 INFO  [STDOUT] Value of counter is 11 
  | Node 2: 11:03:42,859 INFO  [STDOUT] Value of counter is 11 
  | Node 1: 11:03:42,859 INFO  [STDOUT] Value of counter is 12 
  | Node 2: 11:03:42,859 INFO  [STDOUT] Value of counter is 12 

The cluster works fine on the HTTP side (I have seen the HTTP session gets replicated) so the problem is only on SFSB.

Do I need any additional configuration besides the @Clustered notation ?
I'm using JBoss 4.2.0 version.
Thanks a lot
Francis


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

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



More information about the jboss-user mailing list