[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: How to Add an Entry using JNDI ??



I am really not an expert here, but why are you providing the ou attribute in the last entry?

Would the following not be better (possibly even work!).

dn: cn=xyz,ou=People,dc=AuthServ,dc=Walgreens,dc=com
cn: xyzuid:
uid: xyz
objectclass: Person

.. just an idea.

Simon.

Rajneesh.Sharma@walgreens.com wrote:

Hi ,

I have my schema given below . When I try to add entries for "people" in the
LDAP schema using JNDI , I get a  NamingException.

dn: dc=walgreens, dc=com
dc: walgreens
o: Walgreens Co.
objectclass: organization
objectclass: dcObject

dn: dc=AuthServ,dc=Walgreens,dc=com
objectclass: top
objectclass: domainComponent
dc: AuthServ

dn: ou=Groups,dc=AuthServ,dc=Walgreens,dc=com
objectclass: top
objectclass: organizationalUnit
ou: Groups

dn: ou=People,dc=AuthServ,dc=Walgreens,dc=com
objectclass: top
objectclass: organizationalUnit
ou: People

dn: cn=xyz,ou=People,dc=AuthServ,dc=Walgreens,dc=com
cn: xyzuid:
ou: People
uid: xyz
objectclass: Person

I created a Java Class for a Person with all required attributes !!!
When I try binding the class given below , I get a NamingException ::

     Person u = new Person("myName","myName","person","People");

     //The above class for assigning the attributes
     //cn: myName
     //ou: People
     //uid: myName
               //objectclass: person

     I have bound the DirCtx variable "ctx" as the Directory Manager who has the
 rights to add , delete and modify attributes
     When I try binding the class given below , I get a NamingException ::

     try
     {

ctx.bind("cn=rajsharm,ou=people,dc=AuthServ,dc=Walgreens,dc=com",u,null);
     }
     catch(NameAlreadyBoundException e)
     {
          System.out.println("Error" + e.getMessage());
          System.out.println("Error" + e.getExplanation());
     }
     catch(InvalidAttributesException e)
     {
          System.out.println("Error" + e.getMessage());
          System.out.println("Error" + e.getExplanation());
     }
     catch(NameNotFoundException e)
     {
          System.out.println("Error" + e.getMessage());
     }
     catch(NamingException e)
     {
          System.out.println("Error" + e.getMessage());
          System.out.println("Error" + e.getExplanation());
     }
     catch(Exception e)
     {
          System.out.println("Error" + e.getMessage());
     }

Any Help will be Highly appreciated !!!

Thanks in Advance !!!

Rajneesh

-- 
    Siemens Business Services D EBS KS
    Mch P/Ca, Carl-Weri-Strasse 22, 81739 Muenchen, Germany

    Tel: +49 (0)89 636-54347    (Fax: -54303)

    Internet-Mail: mailto:Simon.Woods@mch.sni.de