14 Replies Latest reply on May 20, 2003 12:04 AM by robin_rusli

    HTTP session replication

    jesse_beaumont

      Hi,

      I am trying to get http session replication working. It throws a ClassNotFoundException when serializing the session because we have our own classes in there. I found a bug report (#697713) about this, but looking into it I can't see anything in CVS that looks like it would implement a fix for this.

      I'm currently using jboss 3.0.4 and tomcat 4.1.12 on jdk 1.4.1_01.

      Does anyone know how I would go about implementing above mentioned fix for my version of JBoss. I have downloaded the newest version (3.2) and used the jbossha-httpsession.sar from there but it just throws a NullPointerException when I start JBoss up.

      Thanks in advance for any pointers,

      Jesse

        • 1. Re: HTTP session replication

          3.0.7 should fix that. As for 3.2.0, give us the stacktrace, otherwise we cannot help you

          • 2. Re: HTTP session replication
            jesse_beaumont

            Thanks for the reply.

            I couldn't get the classloader to correctly get stuff out of the ear/war file, but if I put the jar file in the deploy directory it seems to work okay.

            The next problem is that when I enable http session clustering, the session gets created on both clustered machines but I then continually get an Exception written to the cluster.log (after enabling the log4j appender):

            2003-04-25 13:48:14,430 ERROR [org.javagroups.DefaultPartition] [Fri Apr 25 13:48:14 BST 2003] [ERROR] UDP.handleIncomingUdpPacket(): exception=java.io.StreamCorruptedException: invalid stream header
            at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:737)
            at java.io.ObjectInputStream.(ObjectInputStream.java:253)
            at org.javagroups.protocols.UDP.handleIncomingUdpPacket(UDP.java:479)
            at org.javagroups.protocols.UDP.run(UDP.java:200)
            at java.lang.Thread.run(Thread.java:536)

            Any help would be much appreciated.

            Jesse

            • 3. Re: HTTP session replication
              belaban

              Do you have 2 different versions of JBoss running on the different nodes ? If you upgrade to the latest version of JavaGroups, the error message will be more explicit, because we check for version mismatches.

              However, the message can also mean that you have another partition running on the same subnet and using the same IP multicast address and port. In that case, the messages are simply discarded.
              Bela

              > The next problem is that when I enable http session
              > clustering, the session gets created on both
              > clustered machines but I then continually get an
              > Exception written to the cluster.log (after enabling
              > the log4j appender):
              >
              > 2003-04-25 13:48:14,430 ERROR
              > [org.javagroups.DefaultPartition] [Fri Apr 25
              > 13:48:14 BST 2003] [ERROR]
              > UDP.handleIncomingUdpPacket():
              > exception=java.io.StreamCorruptedException: invalid
              > stream header


              • 4. Re: HTTP session replication
                jesse_beaumont

                I tried chaning the multicast port and that didn't help (same error)

                I also tried the newest version of javagroups (2.0.6) and now get the following error with the same frequency as the previous one

                2003-04-25 15:41:22,972 ERROR [org.javagroups.DefaultPartition] [Fri Apr 25 15:41:22 BST 2003] [ERROR] UDP.handleIncomingUdpPacket(): exception=java.io.EOFException

                That is the only error in the log as far as I can see.

                I appreciate the help.

                Jesse

                • 5. Re: HTTP session replication
                  jesse_beaumont

                  Just thought I would close this up. I did get it working in the end and it had to do with a number of things. The first was that I had JavaGroups in use as part of the application (separate from JBoss).

                  The other problem was with the security JAAS integration which has a bug in it so even when I got the clustering working it appeared not to be working.

                  In summary though, the session replication works just fine (as if you didn't know that :) )

                  Thanks for the help though

                  Jesse

                  • 6. Re: HTTP session replication
                    robin_rusli

                    hi jesse_beaumont, can you share your experience when setting http session replication?
                    I try jboss-3.0.7_tomcat-4.1.24 but fail :(
                    Can you help me by explain your steps :)?
                    thanks advance

                    • 7. Re: HTTP session replication
                      robin_rusli

                      hi jesse_beaumont, can you share your experience when setting http session replication?
                      I try jboss-3.0.7_tomcat-4.1.24 but fail :(
                      Can you help me by explain your steps :)?
                      thanks advance

                      • 8. Re: HTTP session replication
                        jesse_beaumont

                        Robin,

                        It is really fairly straight forward:

                        1. start jboss in the "all" configuration (which contains the clustering out of the box)

                        2. Add the tag to your web.xml file to indicate that the web application is to be distributed

                        3. deploy the application.

                        Things to note are that clustering will obviously only work if you have serializable items in your session object (which is generally a good idea anyway).

                        Hope that helps. Let me know if you have specific problems.

                        Jesse

                        • 9. Re: HTTP session replication
                          robin_rusli

                          Hi, jesse
                          I did all your suggestion, but I received this error.
                          2003-05-05 05:04:57,259 ERROR [org.jboss.ejb.plugins.LogInterceptor] EJBException:
                          javax.ejb.EJBException: No entry exists (any more?) with this id: 0eTEE8xcPbhh6TM2KTerMg**
                          at org.jboss.ejb.plugins.CMPClusteredInMemoryPersistenceManager.loadEntity(CMPClusteredInMemoryPersistenceManager.java:354)
                          at org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity(CMPPersistenceManager.java:410)
                          at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:252)
                          at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:174)
                          at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:107)
                          at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:208)
                          at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493)
                          at org.jboss.ejb.Container.invoke(Container.java:738)
                          at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1058)
                          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
                          at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:99)
                          at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:102)
                          at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
                          at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:189)
                          at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
                          at $Proxy17.remove(Unknown Source)
                          at org.jboss.ha.httpsession.server.ClusteredHTTPSessionService.removeHttpSession(ClusteredHTTPSessionService.java:153)
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                          at java.lang.reflect.Method.invoke(Method.java:324)
                          at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
                          at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                          at $Proxy27.removeHttpSession(Unknown Source)
                          at org.jboss.web.catalina.session.ClusterManager.removeSession(ClusterManager.java:538)
                          at org.jboss.web.catalina.session.ClusterManager.remove(ClusterManager.java:315)
                          at org.jboss.web.catalina.session.ClusteredSession.expire(ClusteredSession.java:568)
                          at org.jboss.web.catalina.session.ClusteredSession.invalidate(ClusteredSession.java:900)
                          at org.apache.catalina.session.StandardSessionFacade.invalidate(StandardSessionFacade.java:211)
                          at org.apache.catalina.session.StandardSessionFacade.invalidate(StandardSessionFacade.java:211)
                          at web.WLogin.toHtml(WLogin.java:82)
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                          at java.lang.reflect.Method.invoke(Method.java:324)
                          at web.CWServlet.getHTML(CWServlet.java:299)
                          at web.CWServlet.service(CWServlet.java:243)
                          at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
                          at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:466)
                          at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
                          at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
                          at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
                          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
                          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
                          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
                          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
                          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
                          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
                          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
                          at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
                          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                          at org.jboss.web.catalina.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:78)
                          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
                          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
                          at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
                          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
                          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
                          at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
                          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
                          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509)
                          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
                          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
                          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
                          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
                          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
                          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
                          at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
                          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
                          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
                          at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
                          at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
                          at java.lang.Thread.run(Thread.java:536)

                          What do you think?

                          • 10. Re: HTTP session replication
                            jesse_beaumont

                            Sorry, never seen that before. One thing you might try is to enable the clustering logs to get more detail. If you look in the conf directory for the server instance you are running (server/default/conf or server/all/conf) there should be a log4j.xml file which contains a CLUSTER configuration. Remove the comments which are commenting that out and set the log level to debug or trace. It will create a file called cluster.log which should hopefully give you more of a clue as to where things are going wrong.

                            Hope that helps a bit.

                            Jesse

                            • 11. Re: HTTP session replication
                              robin_rusli

                              Thanks for your participation jesse
                              I start 2 servers and I can't see the same sessions in my cluster.log. Do you know my fault?
                              I use McastReceiver and McastSender class from javagroups to test my multicast, and multicast works well.
                              Any idea?

                              • 12. Re: HTTP session replication
                                jesse_beaumont

                                Dummy post, because I can't see reply 11 in the thread. Just testing whether it is a problem with the message or a problem with the forum

                                Jesse

                                • 13. Re: HTTP session replication
                                  slaboure

                                  strange indeed. We are missing one piece I guess.

                                  If you have time, try the jetty setup maybe. Are you sure that ipchains/iptables/whateverFW is not enabled?

                                  Cheers,


                                  sacha

                                  • 14. Re: HTTP session replication
                                    robin_rusli

                                    Hi sacha,
                                    I don't use any FW in my box. Do you have any idea with my problem?