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

java.net.InetAddress.getLocalHost() returns 127.0.0.1

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.1.1
    • core-libs
    • None
    • sparc
    • solaris_2.5.1



      Name: sgC58550 Date: 06/23/97


      java.net.InetAddress.getLocalHost() returns 127.0.0.1

      Platform: Solaris 2.4 on a Sparc station
      When I run the following code:

         java.net.InetAddress oLocalHost = java.net.InetAddress.getLocalHost();
         System.out.println("ReportTestServer.bindServers() - local host name: ");
         System.out.println(oLocalHost.getHostName());

         System.out.println("ReportTestServer.bindServers() - local host address: ");
         System.out.println(oLocalHost.getHostAddress());

      I get the following output on the Solaris box:

      ReportTestServer.bindServers() - local host name:
      localhost
      ReportTestServer.bindServers() - local host address:
      127.0.0.1

      When I run on a WIN95 box, I get the correct local host, e.g.,:

      ReportTestServer.bindServers() - local host name:
      spider
      ReportTestServer.bindServers() - local host address:
      129.9.200.103

      /etc/hosts is set up as usual with localhost set to 127.0.0.1
      and the particluar node set up properly. Both hostname and uname -n
      return the proper name/address for the node.

      I do belive this is also the cause of the problems with bind/rebind/unbind
      in RMI (as documented in other bugs). It also causes Visigenic's
      CORBA implementation the same problems. In general this is preventing
      me from running servers on a Solaris box and clients on other
      boxes using RMI and/or CORBA.
      company - Marinbridge Corporation Ltd. , email - ###@###.###
      ======================================================================

            brenaudsunw Benjamin Renaud (Inactive)
            sgoodsunw Sheri Good (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: