rmi lookup name can't use hostname?

Discussion in 'Java' started by cnwy@263.net, Mar 17, 2006.

  1. Guest

    Hello,All.

    I can get the rmi remote object by below code:
    String name = "rmi://192.168.1.248/RMIExport";
    RMIExportRemote remote = (RMIExportRemote) Naming.lookup(name);
    But failed when I change IP to hostname.
    String name = "rmi://rt_server/RMIExport";
    RMIExportRemote remote = (RMIExportRemote) Naming.lookup(name);
    I have put a entry in hosts and ping rt_server return 192.168.1.248.
    It seems rmi can't translate hostname into ip address.


    wy.
     
    , Mar 17, 2006
    #1
    1. Advertising

  2. Guest

    It is really strange,
    When I put
    192.168.1.248 www.google.com
    into C:\WINNT\system32\drivers\etc\hosts
    and try
    String name = "rmi://www.google.com/RMIExport";
    RMIExportRemote remote = (RMIExportRemote) Naming.lookup(name);
    it runs very well.

    wy.
     
    , Mar 17, 2006
    #2
    1. Advertising

  3. Chris Uppal Guest

    wrote:

    > I have put a entry in hosts and ping rt_server return 192.168.1.248.
    > It seems rmi can't translate hostname into ip address.


    I can't be bothered to check the standards myself, but I have a vague memory
    that _ is not allowed in hostnames.

    -- chris
     
    Chris Uppal, Mar 17, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jayaram
    Replies:
    1
    Views:
    688
    Sudsy
    Feb 28, 2004
  2. =?ISO-8859-1?Q?Richard_K=F6rber?=

    [RMI] Naming.lookup freezes

    =?ISO-8859-1?Q?Richard_K=F6rber?=, Jun 30, 2004, in forum: Java
    Replies:
    0
    Views:
    1,086
    =?ISO-8859-1?Q?Richard_K=F6rber?=
    Jun 30, 2004
  3. David Murko
    Replies:
    0
    Views:
    862
    David Murko
    Dec 2, 2004
  4. Sadu

    Rmi clinet dont lookup!

    Sadu, Apr 23, 2005, in forum: Java
    Replies:
    3
    Views:
    461
    Alex Molochnikov
    Apr 23, 2005
  5. AWieminer
    Replies:
    0
    Views:
    754
    AWieminer
    Jul 12, 2005
Loading...

Share This Page