1 Reply Latest reply on Jan 10, 2012 9:41 AM by rhusar

    I have encounter the session replication problem with jboss5.1

    ylq2250

      I have two computer with the Ip address are 172.16.1.151 and 172.16.1.153 and they are all the windows OS。I install two jboss5.1 on them,for the 151 computer i start the jboss with the follow command:

       

      run.bat -c all -g GillionPartition -u 239.255.100.100 -b 172.16.1.151 -Djgroups.bind_addr=172.16.1.151 -Djboss.messaging.ServerPeerID=3 -Djboss.service.binding.set=ports-02

       

      the start Print Screen is follow:

      node1.jpg

       

      and for 153 computer the start command like this:

      run.bat -c all -g GillionPartition -u 239.255.100.100 -b 172.16.1.153 -Djgroups.bind_addr=172.16.1.153 -Djboss.messaging.ServerPeerID=1 -Djboss.service.binding.set=ports-default

       

      and the start Print Screen is follow:

      node2.jpg

       

      but when i access the application i deploy on the two jboss, the session didn't replication successfully.

       

      if i take the jboss AS on 151 computer copy to 153,and start it with the command:

       

       

      run.bat -c all -g GillionPartition -u 239.255.100.100 -b 172.16.1.153 -Djgroups.bind_addr=172.16.1.153 -Djboss.messaging.ServerPeerID=3 -Djboss.service.binding.set=ports-02

       

      and then when i test my application , the session can replication successfully.

       

      I have use the jgroup testdemo to check the two computer can  find and communication with each other.

      node3.jpg

      the test step is that:

        I open an IE  and login in the test application on 153,and input the url:

      http://172.16.1.153:8080/weiph/index.jsp

      there are an input Text and a submit button on this page,when i input something like 'test111' and check the button I will set the 'test111' into the session with the key 'name'. then the page forward to the test.jsp whose url is :

      http://172.16.1.153:8080/weiph/test.jsp

      on this page just use the session.getAttribute('name') and print it onto the console. when the page forward to it i can see the 'test111' on the console.

      then I put the ctrl+n on the test.jsp page and input the follow url:

       

      if another jboss deploy on the 153 computer:

      http://172.16.1.153:8280/weiph/test.jsp

      then I can see the 'test111' on the jboss's console with the port 8280.

       

      if another jboss deploy on the 151 computer:

      http://172.16.1.151:8280/weiph/test.jsp

      I can not see the 'test111' on the jboss's console on the 151 computer.

       

       

       

       

       

        • 1. Re: I have encounter the session replication problem with jboss5.1
          rhusar

          if another jboss deploy on the 153 computer:

          http://172.16.1.153:8280/weiph/test.jsp

          then I can see the 'test111' on the jboss's console with the port 8280.

           

          if another jboss deploy on the 151 computer:

          http://172.16.1.151:8280/weiph/test.jsp

          I can not see the 'test111' on the jboss's console on the 151 computer.

           

          If I read it correctly, I think there is a crucial problem with your approach. Session is bound to a HTTP cookie. You are first logging to 172.16.1.153 thus cookie is bound to this "host" only (ie IP address). Then when you visit 172.16.1.151 the session is NOT BOUND to that IP address, as its different. (That would be a critical security issue if it would present cookie from wrong domain).

           

          How to do the test correctly:

          1. install loadbalancer and then shutdown 1 server
          2. spoof the cookie (for instance with Opera browser or Firefox with extension)
          3. nongui way, use CURL

           

          HTH,
          R