Hello,

I am attempting to add a baseDN using ApacheDS and Eclipse, but have
been failing miserable.

Below is the attempt.   I would love it if you could help.


package snippets.security.ldap.groovyldap.add

import org.apache.directory.groovyldap.LDAP

class AddEntryDemo
{
    
    static main( args)
    {
        def ldap = LDAP.newInstance('ldap://localhost:10389', 'uid=admin, 
ou=system' ,'secret')
        
        // add the baseDN as a valid name entry
        def baseDNAttrs = [ objectclass: ['top', 'ou'], sn: 'dc=epims dc=biz', 
cn: 'epims' ]
        ldap.add( 'ou: epims dc=epims dc=biz', baseDNAttrs)
        
        assert ! ldap.exists('cn=Heather Nova, dc=epims, dc=biz') // checks for 
previous entry with this dn
        
        
        
        
        // define the attributes as a map
        def attrs = [ objectclass: ['top', 'person'], sn: 'Nova', cn: 'Heather 
Nova' ]
        
        ldap.add( 'cn=Heather Nova, dc=epims, dc=biz', attrs)
        
        assert ldap.exists('cn=Heather Nova, dc=epims, dc=com')
        
    }
    
    
}








---------------------------------------------------------
Dr. St Clair S. Clarke (M.B.B.S; D.M. (General Surgery) )
Head, General Surgery Department
Spanish Town General Hospital
Burk Road,
Spanish Town
St Catherine
Jamaica

Phone:(876) 984-3030/5
Phone:(876) 984-4670/2
Phone:(876) 749-2213 (Direct)
Fax:(876) 749-2213

Mobile: (876) 303-6177
Email: [email protected]
Skype: st.clair.clarke

Reply via email to