Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-2391

BindException on Windows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 4.1.7
    • 4.1.0, 4.1.1, 4.1.2, 4.1.3, 4.1.4, 4.1.5, 4.1.6
    • None
    • Hide

      Run this code under windows with the a jgroups version >= 4.1.0

      try (org.jgroups.JChannel channel = new JChannel("udp.xml")) {
                  channel.setReceiver(new ReceiverAdapter() {
                      @Override
                      public void receive(Message msg) {
                          System.out.println("received msg from " + msg.getSrc() + ": " + msg.getObject());
                      }
                  });
                  channel.connect("MyCluster");
                  channel.send(new Message(null, "hello world"));
              }
      
      Show
      Run this code under windows with the a jgroups version >= 4.1.0 try (org.jgroups.JChannel channel = new JChannel( "udp.xml" )) { channel.setReceiver( new ReceiverAdapter() { @Override public void receive(Message msg) { System .out.println( "received msg from " + msg.getSrc() + ": " + msg.getObject()); } }); channel.connect( "MyCluster" ); channel.send( new Message( null , "hello world" )); }

    Description

      After updating to jgroups 4.1.6 i get the following BindException

      java.net.BindException: Cannot assign requested address: Cannot bind
          at java.base/java.net.TwoStacksPlainDatagramSocketImpl.bind0(Native Method)
          at java.base/java.net.TwoStacksPlainDatagramSocketImpl.bind0(TwoStacksPlainDatagramSocketImpl.java:114)
          at java.base/java.net.AbstractPlainDatagramSocketImpl.bind(AbstractPlainDatagramSocketImpl.java:117)
          at java.base/java.net.TwoStacksPlainDatagramSocketImpl.bind(TwoStacksPlainDatagramSocketImpl.java:98)
          at java.base/java.net.DatagramSocket.bind(DatagramSocket.java:395)
          at java.base/java.net.MulticastSocket.<init>(MulticastSocket.java:176)
          at org.jgroups.util.DefaultSocketFactory.createMulticastSocket(DefaultSocketFactory.java:92)
          at org.jgroups.stack.DiagnosticsHandler.startUDP(DiagnosticsHandler.java:180)
          at org.jgroups.stack.DiagnosticsHandler.start(DiagnosticsHandler.java:122)
          at org.jgroups.protocols.TP.startDiagnostics(TP.java:1031)
          at org.jgroups.protocols.TP.start(TP.java:938)
          at org.jgroups.protocols.UDP.start(UDP.java:295)
          at org.jgroups.stack.ProtocolStack.startStack(ProtocolStack.java:888)
          at org.jgroups.JChannel.startStack(JChannel.java:980)
          at org.jgroups.JChannel._preConnect(JChannel.java:844)
          at org.jgroups.JChannel.connect(JChannel.java:349)
          at org.jgroups.JChannel.connect(JChannel.java:343)
          at com.thorstenmarx.webtools.cluster.JGroupsTest.simple(JGroupsTest.java:43)
      

      It seems to be caused by https://stackoverflow.com/questions/14086740/how-to-create-a-new-multicastsocket-with-an-inetsocketadress-i-always-get-a-bin

      Attachments

        Activity

          People

            rhn-engineering-bban Bela Ban
            thmarx Thorsten Marx (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: