3 Replies Latest reply on Apr 23, 2013 2:42 PM by Dmitri Zamysloff

    JBoss & JGroups

    Dmitri Zamysloff Newbie

      Hi together,

      probably sombody already had this issue and it is just lack of documentation. I hope somebody can give me a link to solution or just brief description.

      The problem.

       

      I created a component which uses JGroups to share state with other instances of this component. Components use special cluster name. Protocol stack initialization is done programmatically. In UDP "bind_addr" set to InetAddress.getLocalHost() and "mcast_port" set to same value in all components. If this component used in dektop programm, then two desktop programms can share their states with no problem. I wanted to use the same component also in JBoss. The problem - desktop programms see each other, but cannot see the component in JBoss; component running in JBoss cannot see desktop components.

       

      The two possible causes

      1. The cause can be formulated with the question - is there any version incompatibilities if I use JGroups 3.x?

      2. JChannel configuration.

       

      Overal information:

      Java 7, JBoss 7.1.1 (component runs in JBoss extension and uses dependency to JBoss JGroup module), jgroups-3.2.7 in desktop app.

       

      I thank you in advance and hope to get responses sooner

        • 1. Re: JBoss & JGroups
          Dmitri Zamysloff Newbie

          If somebody have interrest I can share the solution.

          The problem is that by default java has no preference for IPv4. It must be set as system property. As soon as I set this property in desktop application the desktop application was able to communicate with the same component in jboss server. That's it!

          • 2. Re: JBoss & JGroups
            rang s Newbie

            Can you explain a bit more, what is the system property? I always get a mix of IPv4 and IPv6 addresses.

            • 3. Re: JBoss & JGroups
              Dmitri Zamysloff Newbie

              Say, the problem was that we had on PC always preconfigured two protocols IPv4 and IPv6. Since Java 4 you have Dual-Stack node (see more information for example here http://docs.oracle.com/javase/6/docs/technotes/guides/net/ipv6_guide/). Of couse if you get connection over IPv4, then you will have Inet4Address. If you get it over IPv6, than you will get it so.

               

              So I think, that JBoss development team was avare of this problem and thus if you start JGroups in JBoss you will be automatically connected with IPv4. Two system settings java.net.preferIPv4Stack and java.net.preferIPv6Addresses are per default false. So you have dual-stack node . So I have solved my problem by enabling setting true for system property preferIPvStack.

               

              I hope I could give you enough information.