6 Replies Latest reply on Dec 20, 2002 9:44 AM by slaboure

    Is this a Jboss Clustering Bug??

    williams

      Hi,
      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
      java.lang.NullPointerException
      at wep.handler.DeliveryScheduleHandler.processSave(DeliveryScheduleHandler.java:84)
      at wep.handler.DeliveryScheduleHandler.doGet(DeliveryScheduleHandler.jav
      a:53)
      at wep.handler.DeliveryScheduleHandler.doPost(DeliveryScheduleHandler.ja
      va:129)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:366
      )
      at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:293)
      at org.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:216)
      at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:151)
      at wep.controller.RASController.doPost(RASController.java:135)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:366
      )
      at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicati
      onHandler.java:293)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:5
      81)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1687)
      at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplication
      Context.java:544)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1637)
      at org.mortbay.http.HttpServer.service(HttpServer.java:875)
      at org.jboss.jetty.Jetty.service(Jetty.java:543)
      at org.mortbay.http.HttpConnection.service(HttpConnection.java:806)
      at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:956)
      at org.mortbay.http.HttpConnection.handle(HttpConnection.java:823)
      at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:
      203)
      at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:290)
      at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:743)
      at java.lang.Thread.run(Thread.java:479)

      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.
      Raj

        • 1. Re: Is this a Jboss Clustering Bug??
          slaboure

          Hello,

          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:

          wep.handler.DeliveryScheduleHandler.processSave(DeliveryScheduleHandler.java:84)

          Cheers,


          sacha

          • 2. Re: Is this a Jboss Clustering Bug??
            williams

            Hi,
            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.
            Thanks,
            Raj

            • 3. Re: Is this a Jboss Clustering Bug??
              williams

              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?

              • 4. Re: Is this a Jboss Clustering Bug??
                slaboure

                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.

                Cheers,


                sacha

                • 5. Re: Is this a Jboss Clustering Bug??
                  williams

                  Hi all,
                  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
                  http://www142.nortelnetworks.com/bvdoc/alteon/webos/webos10.0/212777-A.pdf


                  Steps:

                  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.

                  Thanks,
                  Raj



                  • 6. Re: Is this a Jboss Clustering Bug??
                    slaboure

                    Thank you for posting this information.

                    cheers,


                    sacha