From: murali <gm...@tr...> - 2000-09-07 11:26:36
|
HAI=20 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.*;=20 import java.util.*; public class Add2 { public static void main( String[] args ) { /* Specify the DN of the new entry. */ // String dn =3D "uid=3Dwbjensen, ou=3DPeople, = o=3DLdap.Baylor.edu"; String dn =3D "uid=3Dwbjensen, ou=3DPeople, o=3D172.16.5.64"; System.out.println("this is attribute"); LDAPAttributeSet attrs =3D new LDAPAttributeSet(); /* Create and add attributes to the attribute set. */ String objectclass_values[] =3D { "top", "person",=20 "organizationalPerson", "inetOrgPerson" }; LDAPAttribute attr =3D new LDAPAttribute( "objectclass",=20 objectclass_values ); attrs.add( attr ); String cn_values[] =3D { "William B Jensen", "William Jensen",=20 "Bill Jensen" }; attr =3D new LDAPAttribute( "cn", cn_values ); attrs.add( attr ); String givenname_values[] =3D { "William", "Bill" }; attr =3D new LDAPAttribute( "givenname", givenname_values ); attrs.add( attr ); attrs.add( new LDAPAttribute( "sn", "Jensen" ) ); attrs.add( new LDAPAttribute( "telephonenumber",=20 "+1 415 555 1212" ) ); attrs.add( new LDAPAttribute( "uid", "wbjensen" ) ); /* Create an entry with this DN and these attributes . */ // LDAPEntry myEntry =3D new LDAPEntry( dn, attrs ); /* Connect to the server and add the entry. */ System.out.println("this is before connection"); LDAPConnection ld =3D null; try { LDAPEntry myEntry =3D new LDAPEntry( dn, attrs ); ld =3D 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 ****************************************************************** |