8 Replies Latest reply on May 27, 2011 9:35 AM by galder.zamarreno

    Help ! Web Session cache clustering not working JBoss 6

    dphan3003

      Hi guys,

       

      Basically, I am trying to achieve Http Web Session clustering, does not matter distribute or syn but never make it work. I got some light today but still the same. Here are what I tried.

       

      2 JBoss instance join the cluster, working fine. They see each other in the same partition.

       

      I create simple JSP to set value to session and one JSP to display it, deploy to 2 servers.

       

      In the web.xml, I put :

           <distributable/>

       

      In the jbossweb.xml:

       

      <?xml version="1.0" encoding="UTF-8"?>

       

      <jboss-web>

       

      <replication-config> 

               <cache-name>web/sync</cache-name>

       

        </replication-config>

       

       

       

      </jboss-web>

       

      I tried to put <replication-mode>...but it comes with exception.

       

      Starting 2 clusters, I got message saying "Start //localhost/myapp cache in web container". Something not right and it does not work.

       

      Then I try to add that name Cache to infinispan-configs.xml. Got better, when setting session, the node comes with message cache //localhost/myapp does not exist in cache manager.

       

      <namedCache name="//localhost/HttpCluster">

              <clustering mode="replication">

                <stateRetrieval timeout="60000" fetchInMemoryState="true"/>

                <sync/>

              </clustering>

              <loaders passivation="true">

                <loader class="org.infinispan.loaders.file.FileCacheStore" fetchPersistentState="true" purgeOnStartup="true">

                  <properties>

                    <property name="location" value="${jboss.server.data.dir}${/}web"/>

                  </properties>

                </loader>

              </loaders>

            </namedCache>

       

       

      Just copy from sync and rename.

       

      I spent weeks on this matter, getting clearer with Infinitispan but could not find the solutions. I really dont know what else should I do.

       

      Thank a lot

        • 1. Help ! Web Session cache clustering not working JBoss 6
          dphan3003

          Any help plzz ?

           

          Has anybody achieve clustering with JBoss 6 yet ?

          • 2. Help ! Web Session cache clustering not working JBoss 6
            galder.zamarreno

            None of the stuff you tried is really needed to get http session replication, except adding <distributable /> to your web.xml - You should start only with that - if you wanna tweak it further, see detailed instructions in http://community.jboss.org/docs/DOC-16180

            • 3. Help ! Web Session cache clustering not working JBoss 6
              dphan3003

              @ Galder: Thank Galder for your response. What can I say ? "Your word has magic" . Seriously, the link you posted I read millions times and tried step by step until today, download brand new server and it work like magic.

               

              By the way, it seems work fine with mod_jk , tmr I will try with mod_cluster to see the result but very positive about that. Will let you know.

               

              Also, I know the cache works but how can I see the message of session replication in console when any value is set or get ?

               

              Some guy post his log with those messages and I think it will useful to have it ? Any setting in infinitispan-configs.xml ?

               

              Thank a lot again.

              • 4. Help ! Web Session cache clustering not working JBoss 6
                codevally

                Hi Galder

                 

                I am also suffering with the same problem. Want to replicate my session over the cluster nodes.  Done everything mentioned in the Cluster community blogs to enable it. but still no luck. Got the following warning message to the server log if one application server is down.

                 

                14:07:59,737 WARN  [org.jboss.web.tomcat.service.session.distributedcache.ispn.DistributedCacheManager] Problem accessing session [9P****Jiuw__]: java.lang.RuntimeException: java.lang.NullPointerException

                 

                My environment is JBOSS AS 6, Infinispan 4.2.0

                • 5. Help ! Web Session cache clustering not working JBoss 6
                  galder.zamarreno

                  @Roshan, what does the rest of the stacktrace look like? Where is the NPE coming from? Maybe you can use pastebin to show the full stacktrace?

                  • 6. Help ! Web Session cache clustering not working JBoss 6
                    codevally

                    Hi Galder

                     

                    This is the full server log after the target cluster node is down.

                     

                    2011-03-23 08:00:51,876 INFO  [org.apache.coyote.http11.Http11Protocol] (Thread-2) Starting Coyote HTTP/1.1 on http-app9.dev1.whispir.net%2F10.1.161.69-8080

                    2011-03-23 08:00:51,880 INFO  [org.apache.coyote.ajp.AjpProtocol] (Thread-2) Starting Coyote AJP/1.3 on ajp-app9.dev1.whispir.net%2F10.1.161.69-8009

                    2011-03-23 08:00:51,881 INFO  [org.jboss.bootstrap.impl.base.server.AbstractServer] (Thread-2) JBossAS [6.0.0.Final "Neo"] Started in 1m:43s:896ms

                    2011-03-23 08:00:51,896 INFO  [org.hornetq.ra.inflow.HornetQActivation] (pool-1-thread-3) Attempting to reconnect org.hornetq.ra.inflow.HornetQActivationSpec(ra=org.hornetq.ra.HornetQResourceAdapter@aa576b destination=queue/social/MessageQueue destinationType=javax.jms.Queue ack=Auto-acknowledge durable=false clientID=null user=null maxSession=15)

                    2011-03-23 08:00:51,935 INFO  [org.hornetq.ra.inflow.HornetQActivation] (pool-1-thread-3) Reconnected with HornetQ

                    2011-03-23 08:00:52,780 INFO  [org.hornetq.ra.inflow.HornetQActivation] (pool-1-thread-2) Attempting to reconnect org.hornetq.ra.inflow.HornetQActivationSpec(ra=org.hornetq.ra.HornetQResourceAdapter@aa576b destination=topic/socialTopic destinationType=javax.jms.Topic ack=Auto-acknowledge durable=false clientID=null user=null maxSession=15)

                    2011-03-23 08:00:52,804 INFO  [org.hornetq.ra.inflow.HornetQActivation] (pool-1-thread-2) Reconnected with HornetQ

                    2011-03-23 08:07:33,244 WARN  [org.hornetq.core.protocol.core.impl.RemotingConnectionImpl] (Thread-1 (group:HornetQ-client-global-threads-15876194)) Connection failure has been detected: The connection was disconnected because of server shutdown [code=4]

                    2011-03-23 08:07:33,853 INFO  [org.jboss.ha.core.framework.server.CoreGroupCommunicationService.lifecycle] (Incoming-16,null) New cluster view for partition null (id: 2, delta: -1, merge: false) : [app9.dev1.whispir.net:1099]

                    2011-03-23 08:07:33,854 INFO  [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (Incoming-16,null) Received new cluster view: [app9.dev1.whispir.net:1099|2] [app9.dev1.whispir.net:1099]

                    2011-03-23 08:07:34,153 INFO  [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (Incoming-2,null) Received new cluster view: [app9.dev1.whispir.net:1099|2] [app9.dev1.whispir.net:1099]

                    2011-03-23 08:07:34,168 WARN  [org.jgroups.protocols.pbcast.NAKACK] (Incoming-7,null) app9.dev1.whispir.net:1099: dropped message from app8.dev1.whispir.net:1099 (not in table [app9.dev1.whispir.net:1099]), view=[app9.dev1.whispir.net:1099|2] [app9.dev1.whispir.net:1099]

                    2011-03-23 08:07:34,471 INFO  [org.jboss.ha.framework.server.ClusterPartition.lifecycle.devPartition] (Incoming-8,null) New cluster view for partition devPartition (id: 2, delta: -1, merge: false) : [app9.dev1.whispir.net:1099]

                    2011-03-23 08:07:34,471 INFO  [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (Incoming-8,null) Received new cluster view: [app9.dev1.whispir.net:1099|2] [app9.dev1.whispir.net:1099]

                    2011-03-23 08:07:34,491 INFO  [org.jboss.ha.core.framework.server.DistributedReplicantManagerImpl.devPartition] (AsynchViewChangeHandler Thread) I am (app9.dev1.whispir.net:1099) received membershipChanged event:

                    2011-03-23 08:07:34,516 INFO  [org.jboss.ha.core.framework.server.DistributedReplicantManagerImpl.devPartition] (AsynchViewChangeHandler Thread) Dead members: 1 ([app8.dev1.whispir.net:1099])

                    2011-03-23 08:07:34,518 INFO  [org.jboss.ha.core.framework.server.DistributedReplicantManagerImpl.devPartition] (AsynchViewChangeHandler Thread) New Members : 0 ([])

                    2011-03-23 08:07:34,522 INFO  [org.jboss.ha.core.framework.server.DistributedReplicantManagerImpl.devPartition] (AsynchViewChangeHandler Thread) All Members : 1 ([app9.dev1.whispir.net:1099])

                    2011-03-23 08:07:34,539 WARN  [org.jgroups.protocols.pbcast.NAKACK] (Incoming-6,null) app9.dev1.whispir.net:1099: dropped message from app8.dev1.whispir.net:1099 (not in table [app9.dev1.whispir.net:1099]), view=[app9.dev1.whispir.net:1099|2] [app9.dev1.whispir.net:1099]

                    2011-03-23 08:07:34,842 INFO  [org.jboss.ha.core.framework.server.CoreGroupCommunicationService.lifecycle] (Incoming-14,null) New cluster view for partition null (id: 2, delta: -1, merge: false) : [app9.dev1.whispir.net:1099]

                    2011-03-23 08:07:34,843 INFO  [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (Incoming-14,null) Received new cluster view: [app9.dev1.whispir.net:1099|2] [app9.dev1.whispir.net:1099]

                    2011-03-23 08:07:45,643 WARN  [org.jboss.web.tomcat.service.session.distributedcache.ispn.DistributedCacheManager] (ajp-app9.dev1.whispir.net%2F10.1.161.69-8009-1) Problem accessing session [2d****0buQ__]: java.lang.RuntimeException: java.lang.NullPointerException

                    • 7. Help ! Web Session cache clustering not working JBoss 6
                      codevally

                      Hi Galder

                       

                      Appriciate very much if you can comment something to my latest post.

                       

                      http://community.jboss.org/thread/165932

                      • 8. Re: Help ! Web Session cache clustering not working JBoss 6
                        galder.zamarreno

                        Roshan, still no stacktrace (assumming you understand what's a stacktrace here? ). No need for the rest of the log here, just the stacktrace to see where the NPE is rooted. Maybe you need to check the debug or trace logs in the app server to see the full stacktrace.