Archived

This forum has been archived. Please start a new discussion on GitHub.

Ice 3.5 under XP results in java.net.SocketException: Protocol family unavailable

Hi.

I have a Java project which, when compile with Ice 3.4.2, runs without problem under XP SP3 and Windows 7.

If I change to Ice 3.5 then the jar does not run under XP, but it runs under Windows 7.

The jar just creates an Ice proxy object (sever) and listens to TCP/IP port 10000 (tcp -p 10000:udp -p 10000).

The exception I get is a
java.net.SocketException: Protocol family unavailable

Best
Christian

Comments

  • bernard
    bernard Jupiter, FL
    Hi Christian,

    Welcome to our forums!

    Which version of the JDK/JRE do you use on Windows XP?

    Best regards,
    Bernard
  • JRE version

    The JRE is 1.7.0_21.
  • Details

    Attached you find a zip archive with two versions of Obba server. One with ICE 3.4.2 and one with ICE 3.5.0.

    "cd" into the corresponding directory (containing Obba.jar) and start
    java -jar Obba.jar

    Under Windows XP:
    • The version with ICE 3.4.2 will show "Obba server started".
    • The version with ICE 3.5.0 will show the following exception:
      Microsoft Windows XP [Version 5.1.2600]
      (C) Copyright 1985-2001 Microsoft Corp.

      C:\Documents and Settings\Administrator\Desktop\Obba ICE\Obba Server ICE 3.5.0>java -jar Obba.jar
      Launching Obba server listening at port 10000 (tcp/udp).
      Obba version 4.0.1
      Unable to start server. Please check if a server is already running or another server is already usi
      ng Obba server's TCP/IP port.
      Ice.SocketException
      error = 0
      at IceInternal.Network.doBind(Network.java:249)
      at IceInternal.TcpAcceptor.<init>(TcpAcceptor.java:119)
      at IceInternal.TcpEndpointI.acceptor(TcpEndpointI.java:415)
      at IceInternal.IncomingConnectionFactory.<init>(IncomingConnectionFactory.java:378)
      at Ice.ObjectAdapterI.<init>(ObjectAdapterI.java:1028)
      at IceInternal.ObjectAdapterFactory.createObjectAdapter(ObjectAdapterFactory.java:160)
      at Ice.CommunicatorI.createObjectAdapter(CommunicatorI.java:77)
      at info.obba.server.Server.run(Server.java:34)
      at Ice.Application.doMain(Application.java:202)
      at Ice.Application.main(Application.java:182)
      at info.obba.server.Server.main(Server.java:98)
      Caused by: java.net.SocketException: Address family not supported by protocol family: bind
      at sun.nio.ch.Net.bind0(Native Method)
      at sun.nio.ch.Net.bind(Unknown Source)
      at sun.nio.ch.Net.bind(Unknown Source)
      at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)
      at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
      at IceInternal.Network.doBind(Network.java:243)
      ... 10 more

      C:\Documents and Settings\Administrator\Desktop\Obba ICE\Obba Server ICE 3.5.0>

    (Note: There is no other "Obba server" running. The message is just for the average user, because having another server running is a common mistake...)
  • benoit
    benoit Rennes, France
    Hi,

    Can you try with --Ice.IPv6=0 to disable the IPv6 support which is now enabled by default since the 3.5.0 release?

    IPv6 isn't supported by Java 7 on Windows XP so most likely this is the cause of this exception.

    Cheers,
    Benoit.
  • fix

    Thank you Bernard. A java command line -D option to prefer IPv4 did not work, but adding
    initData.properties.setProperty("Ice.IPv6", "0");
    

    to my app.main properties fixed the problem.

    I suspected IPv6 before, when googling, and had installed a corresponding update on XP, but maybe that didn't work for Java 1.7 on XP... don't know why.