From: Mark W. <mew...@un...> - 2000-09-07 14:17:04
|
This is a Perl list. Don't ask Java related questions here :). Mark On Thu, 7 Sep 2000, murali wrote: > HAI > > I am using al ldap server which is running in our local system( linux). When i connect to that sytem by using java ldap client. > > I am getting a execption error no 32(this statnds for name problem). > > > > The version it will support 3.0, > > I am not using any authenticate because if i use this one it is giving exception it will not support the version. > > The code i used PLEASE GO THROUG IT: > > import.netscape.ldap.*; > import java.util.*; > > public class Add2 { > > public static void main( String[] args ) { > > /* Specify the DN of the new entry. */ > > // String dn = "uid=wbjensen, ou=People, o=Ldap.Baylor.edu"; > > String dn = "uid=wbjensen, ou=People, o=172.16.5.64"; > > System.out.println("this is attribute"); > > LDAPAttributeSet attrs = new LDAPAttributeSet(); > > /* Create and add attributes to the attribute set. */ > > String objectclass_values[] = { "top", "person", > > "organizationalPerson", "inetOrgPerson" }; > > LDAPAttribute attr = new LDAPAttribute( "objectclass", > > objectclass_values ); > > attrs.add( attr ); > > String cn_values[] = { "William B Jensen", "William Jensen", > > "Bill Jensen" }; > > attr = new LDAPAttribute( "cn", cn_values ); > > attrs.add( attr ); > > String givenname_values[] = { "William", "Bill" }; > > attr = new LDAPAttribute( "givenname", givenname_values ); > > attrs.add( attr ); > > attrs.add( new LDAPAttribute( "sn", "Jensen" ) ); > > attrs.add( new LDAPAttribute( "telephonenumber", > > "+1 415 555 1212" ) ); > > attrs.add( new LDAPAttribute( "uid", "wbjensen" ) ); > > > /* Create an entry with this DN and these attributes . */ > > // LDAPEntry myEntry = new LDAPEntry( dn, attrs ); > > > /* Connect to the server and add the entry. */ > > System.out.println("this is before connection"); > > LDAPConnection ld = null; > > > try { > LDAPEntry myEntry = new LDAPEntry( dn, attrs ); > > ld = new LDAPConnection(); > > /* Connect to the server. */ > > > ld.connect("172.16.5.64",389 ); > > /* Authenticate to the server as the directory manager. */ > > > > > System.out.println("this is after authenticate"); > > /* Add the entry to the directory. */ > > System.out.println("this is before adding to ldap"); > > ld.add( myEntry ); > > System.out.println( "Added entry successfully." ); > > } > catch( LDAPException e ) > { > System.out.println("the error is: " + e); > } > } > } > > > > The code is executing upto " this is after authenticate". Then it is throwing an exception error no 32.. > > Help me in this matter asp > with regards > bye > murali.gali > Software Engineer > RENDEZVOUS ON CHIP (I) PVT.LTD. > VOICE: ph:040-7742606 ( Extn )- 315 > mail to: gm...@tr... > > Fax : (413)581-2650 > Web Page : http://www.trinc.com > ****************************************************************** > > > > > |