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

-Djava.rmi.server.hostname is ignored

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 1.4.0
    • core-libs
    • x86
    • linux



      Name: gm110360 Date: 12/10/2001


      java version "1.4.0-beta3"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta3-b84)
      Java HotSpot(TM) Client VM (build 1.4.0-beta3-b84, mixed mode)


      On a multihomed host (I use eth0:0 aliases) where the hostname is a.b.com
      which resolves to 192.168.0.2.
      Try to start RMID like this:
      rmid -J-Djava.rmi.server.useLocalHostname=false
      \-J-Djava.rmi.server.hostname=172.31.0.128

      rmid still uses 192.168.0.2. You can prove this to yourself by disabling the
      192.168.0.2 ethernet device temporarily by 'ifconfig eth0 down' and retrying.
      You will see an rmid exception stating that connection to 192.168.0.2 has
      failed.

      The solution usually suggested by Sun doesn't work:
      http://java.sun.com/products/jdk/1.2/docs/guide/rmi/faq.html

      You also can't place the 172.31.0.128 ip address/hostname in /etc/hosts as
      placing this in the first/second/third slot in front/behind 127.0.0.1 doesn't
      work.

      I did find something undocumented that did work, however:
      > hostname new.b.com
      fixes the problem where /etc/hosts maps new.b.com to 172.31.0.128.

      Unfortunately this changes the hostname for the entire machine. I would rather
      the documented java.rmi.server.hostname property worked.

      Thanks.
      (Review ID: 135559)
      ======================================================================

            awollratsunw Ann Wollrath (Inactive)
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: