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

LDAP record search works in 1.2.1; broken in 1.3beta (CMP vs. SRCH)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.3.0
    • core-libs



      Name: krT82822 Date: 01/25/2000


      java version "1.3beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3beta-0)
      Java(TM) HotSpot Client VM (build 1.3beta-0, mixed mode)

      We have been using Java to build a system that interfaces with Netscape
      Directory Server 4.0. When we recently upgraded our JDK from 1.2.1 to 1.3beta,
      we began to have problems with the LDAP. A search of the LDAP that previously
      worked began to produce an error. The following code fragment sets up and runs
      the search:

         private DirContext myCtx = null;
         private Hashtable myEnv=new Hashtable(11);

          //Set up context information.
          myEnv.put(Context.INITIAL_CONTEXT_FACTORY,INITCTX);
          myEnv.put(Context.PROVIDER_URL, myService);

          //Set up the binding information.
          myEnv.put(Context.SECURITY_AUTHENTICATION,AUTHTYPE);
          myEnv.put(Context.SECURITY_PRINCIPAL,ACCESSDN);
          myEnv.put(Context.SECURITY_CREDENTIALS,ACCESSPW);

                        . . . . . . . .

          //Try opening a connection to the LDAP service.
          try{
            myCtx = new InitialDirContext(myEnv);
          } catch(NamingException e) { }
       
                        . . . . . . . .

          Hashtable pdef = null;

          //Set up LDAP search controls for the query.
          SearchControls ctls = new SearchControls();
          ctls.setSearchScope(SearchControls.OBJECT_SCOPE);

          String filter = mySiteId;

          //Execute search
          try {
      //Perform the query.
            NamingEnumeration answer = myCtx.search(mySearchBase,filter,ctls);
      //Put the query information into a hashtable.
            pdef = putObjectIntoHashtable(answer);
            if (pdef.isEmpty()) {
              throw new java.io.IOException (
                        "Site Definition not found for site="+mySiteId);
            }
          } catch (Exception e) { }

      In both the jdk1.2.1 and jdk1.3beta case the code is able to connect and bind to
      the LDAP service, but in the jdk1.2.1 case the myCtx.search call produces a SRCH
      access in the LDAP and in the jdk1.3beta case a CMP access is produced. This
      information was gleaned from the LDAP access log. Needless to say the CMP
      access was unsuccessful. We tried using the JNDI1.2.1 and LDAP1.2.1 releases
      (which I believe are the versions bundled into jdk1.3beta) with jdk1.2.1 and had
      no problems. The problem only seems to surface when using jdk1.3beta.
      (Review ID: 99975)
      ======================================================================

            vinnie Vincent Ryan
            kryansunw Kevin Ryan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: