Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6972374

NetworkInterface.getNetworkInterfaces throws "java.net.SocketException" on Solaris zone

XMLWordPrintable

    • b102
    • 7
    • b105
    • generic
    • generic
    • Not verified

      Test
      com/sun/jdi/ListenAddress.java

      fails since JDK 7 b102 on Solaris 10 zone with

      java.net.SocketException: No such device or address
              at java.net.NetworkInterface.getAll(Native Method)
              at java.net.NetworkInterface.getNetworkInterfaces(NetworkInterface.java:316)
              at ListenAddress.main(ListenAddress.java:93)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:613)
              at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
              at java.lang.Thread.run(Thread.java:717)
      Other static methods of NetworkInterface that returnes NetworkInterface was also affected.
      To reproduce the problem a very simple java code could be used.

      import java.net.*;

      public class test {

          public static void main(String argv[]) {
              test t = new test();
              t.run();
          }

          public void run() {
              try {
                  for (int i = 1; i<10; i++) {
                      if (NetworkInterface.getByIndex(i) != null) {
                          System.out.println(NetworkInterface.getByIndex(i).getName());
                      } else {
                          System.out.println(i);
                          break;
                      }
                  }
              } catch (SocketException se) {
                  se.printStackTrace();
              }
          }
      }

            chegar Chris Hegarty
            nhaustov Nicolay Haustov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: