6 Replies Latest reply on Sep 25, 2002 1:09 PM by Julian Gosnell

    HttpSession clustering - failover problems

    Marcin Newbie

      Hi!

      Finally i got working clustering: discovering, farming and httpsession clustering.

      But not everything works appropriate. I wrote very simple servlet which writes to session some attributes. And when i test it on the 2 nodes:

      - on the server1 i add attributes to session, when i look at logs the sessions seems to replicate
      - when i down the server1 my loadbalancer redirects the request to server2 and what happens: while HttpSession.setAttribute(...) is called the exception is raised.

      What to do?

      My configuration is:
      server1 - linux redhat 7.2, java sun 1.3.1, JBoss 3.0.2
      server2 - linux redhat 7.2, java sun 1.3.1, JBoss 3.0.2

      I have deployed jbossha-httpsession.sar.

      Marcin

      Below is a stack trace which is logged.

      13:05:45,338 ERROR [MarshallingInterceptor] could not get Attribute: azzz
      java.io.StreamCorruptedException: InputStream does not contain a serialized object
      at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:849)
      at java.io.ObjectInputStream.(ObjectInputStream.java:168)
      at org.mortbay.j2ee.session.MarshallingInterceptor$ObjectInputStream.(MarshallingInterceptor.java:43)
      at org.mortbay.j2ee.session.MarshallingInterceptor.demarshal(MarshallingInterceptor.java:83)
      at org.mortbay.j2ee.session.MarshallingInterceptor.getAttribute(MarshallingInterceptor.java:93)
      at org.mortbay.j2ee.session.StateInterceptor.getAttribute(StateInterceptor.java:43)
      at org.mortbay.j2ee.session.StateInterceptor.getAttribute(StateInterceptor.java:43)
      at org.mortbay.j2ee.session.TypeCheckingInterceptor.getAttribute(TypeCheckingInterceptor.java:90)
      at org.mortbay.j2ee.session.StateAdaptor.getAttribute(StateAdaptor.java:204)
      at servlet_test.SessionTest.doGet(SessionTest.java:36)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:344)
      at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:313)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:554)
      at org.mortbay.jetty.servlet.WebApplicationHandler.handle(WebApplicationHandler.java:199)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1572)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1522)
      at org.mortbay.http.HttpServer.service(HttpServer.java:795)
      at org.jboss.jetty.Jetty.service(Jetty.java:531)
      at org.mortbay.http.HttpConnection.service(HttpConnection.java:784)
      at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:941)
      at org.mortbay.http.HttpConnection.handle(HttpConnection.java:799)
      at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:186)
      at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:322)
      at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:716)
      at java.lang.Thread.run(Thread.java:484)
      13:05:45,360 WARN [jbossweb] WARNING: Exception for /test/sessiontest?name=123213&value=12321321&go=Prze%B6lij+kwerend%EA
      java.lang.IllegalArgumentException: could not get Attribute
      at org.mortbay.j2ee.session.MarshallingInterceptor.getAttribute(MarshallingInterceptor.java:102)
      at org.mortbay.j2ee.session.StateInterceptor.getAttribute(StateInterceptor.java:43)
      at org.mortbay.j2ee.session.StateInterceptor.getAttribute(StateInterceptor.java:43)
      at org.mortbay.j2ee.session.TypeCheckingInterceptor.getAttribute(TypeCheckingInterceptor.java:90)
      at org.mortbay.j2ee.session.StateAdaptor.getAttribute(StateAdaptor.java:204)
      at servlet_test.SessionTest.doGet(SessionTest.java:36)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:344)
      at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:313)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:554)
      at org.mortbay.jetty.servlet.WebApplicationHandler.handle(WebApplicationHandler.java:199)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1572)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1522)
      at org.mortbay.http.HttpServer.service(HttpServer.java:795)
      at org.jboss.jetty.Jetty.service(Jetty.java:531)
      at org.mortbay.http.HttpConnection.service(HttpConnection.java:784)
      at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:941)
      at org.mortbay.http.HttpConnection.handle(HttpConnection.java:799)
      at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:186)
      at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:322)
      at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:716)
      at java.lang.Thread.run(Thread.java:484)