I am trying to get clustering going with JBoss 3.0.4. I have Jboss server instance (with all option) running on two different machines. They are part of the same multicast group and when I deploy my application .ear file in the /server/all/deploy directory, everything looks fine. I am using the default Jboss setting for clustering. My application .ear file contains only one stateless session EJB and I have made the tag true in the jboss.xml file. I am not using session failover, and hence not using the tag in the web.xml file. I deploy the ear file in the two servers and they recognize they are part of a cluster - works great. When I start my browser and access my application, one of the server (say server 1) picks up the request. The next few requests from the browser is handled by server 1.
However, all on a sudden, the request gets transferred to the other server (say server 2), and everything fails. My application throws the following error message (Price Request Model is a variable stored in session):
18:30:43,941 INFO [STDOUT] Price Request Model is null
18:30:43,951 WARN [jbossweb] WARNING: Exception for /RASController
As far as I understand, server 1 should keep serving the the browser/client until it dies - why does the other server suddenly kick in? When a client/browser opens a session, it should be served by the same server until and unless the server dies - am I wrong in my understanding?
If the request gets transferred to the other server (server 2), it will fail because its session tracking does not contain the session variables of server 1. So, is this a bug in Jboss? I tried looking at javagroups.com or jboss clustering forum to see if I need to do anything special, but did not get much information on this error. Can anyone please help?
Thanks a lot.
If I correctly understand your architecture, you never directly access your SLSB from a java client but instead always access it from your web application (servlet, etc.). If that is the case, then you don't need to set the tag to true for your SLSB: the servlet will always use the local SLSB and will never failover to the remote.
Then, you say that server2 suddently pops in and handles the requests. Why? How do *you* route the http requests between nodes?
Third, if you failover to the other node, it should fail as the session does not exist (you don't use http clustering).
Fourth, the NPE exception seems to occur in *your* code:
Thanks for the reply - from what we understand, this seems to be a hardware load balancer problem - the request from the client is going to both the servers. We use an altion load balancer, and my guess is it is not configured right.
We are working on it, and hopefully things will work out. If we face issues/problems, we will ping you folks.
Follow up - We are still trying to get load balancing working.
We use Alteon Load balancer for our two servers. As explained in the previous discussion, we thought the alteon load balancer was malfunctioning (the reason for both the Jboss servers in the cluster to receive the request). We ran a test using weblogic 6.1 servers with the same alteon settings. Everything worked fine. The Weblogic servers did not both receive the request. Only 1 server received and processed the request.
We then start up the 2 JBoss servers functioning under the same Alteon settings and both servers receive and process the requests (according to the [DATE].request.log)
Is there some Jboss setting we have to set to prevent this behavior?
No but I would strongly suggest that you check your config I know for sure that JBoss servlet engines will *not* forward requests to another node (there is no code that does that!)
Maybe weblogic has some specific alteon driver deployed that solved this particular issue.
We got our clustering to work by changing the Alteon settings. The way weblogic asks you to setup Alteon will not work in JBOSS. I am including the settings that will work for JBOSS. We got the information from
Enter insert|passive|rewrite cookie persistence mode [i/p/r]: p (same as before)
Enter cookie name: JSESSIONID (same as before)
Enter starting point of cookie value [1-64]: 1 (new)
Enter number of bytes to extract [0-64]: 24 (new)
Look for cookie in URI [e|d]: d (same as before)
Set multiple response count [1-16]: 1
Hope that helps anyone else working with Alteon Load balancer.
Thank you for posting this information.