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

Naming.lookup fails if url does not use an explicit port and name contains a :

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.3.0
    • core-libs
    • beta
    • sparc
    • solaris_8
    • Verified



      Name: skT45625 Date: 11/07/2000


      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0)
      Java HotSpot(TM) Client VM (build 1.3.0, mixed mode)


      If the remote object name contains a colon (in my case the name is an LDAP
      URL), the java.rmi.Naming.lookup method fails to extract the hostname from the
      URL. The function cuts off the part after the colon instead of the (3rd) slash
      to extract the hostname, eg.: from the
      URL "rmi://host.domain/ldap:host2.domain/dn" extracts the "host.domain/ldap" as
      hostname instead of "host.domain"

      Example source code:

              try {
                  Remote test = Naming.lookup
                      ("rmi://microsoft.com/ldap://ldaphost.domain/o=whatever");
                  System.out.println("OK.");
              } catch (Exception e) {
                  System.out.println("Error:" +e);
              }

      Error message:

              Error:java.rmi.UnknownHostException: Unknown host: microsoft.com/ldap;
              nested exception is:
                      java.net.UnknownHostException: microsoft.com/ldap

      Note: the JDK 1.2.2/05a was free from this bug.


      ###@###.### 2000-11-07
      Was able to reproduce the problem in 1.3, works fine in 1.2.x
      (Review ID: 110656)
      ======================================================================

            mwarressunw Michael Warres (Inactive)
            skondamasunw Suresh Kondamareddy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: