ldap Modification Items Error Code 32
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   piyush_sharma
Posted On:   Friday, October 28, 2005 07:38 PM

Im trying to modufy my attributes in ldap/// and in the process im getting the javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object]; remaining name 'dc=i-debut,dc=org' in the process import java.util.Hashtable; //import java.util.Enumeration; import javax.naming.*; import javax.naming.directory.*; public class ldp { public static void main(String args[]) { Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory"); // Specify LDAPS URL env.put(Context.PROVIDER_URL, "ldap://127.0.0.1:389/dc=i-debut,dc=org"); env.put(Context.SEC   More>>

Im trying to modufy my attributes in ldap/// and in the process im getting the
javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object]; remaining name 'dc=i-debut,dc=org'
in the process

import java.util.Hashtable;
//import java.util.Enumeration;
import javax.naming.*;
import javax.naming.directory.*;


public class ldp
{

public static void main(String args[])
{
Hashtable env = new Hashtable();

env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
// Specify LDAPS URL

env.put(Context.PROVIDER_URL, "ldap://127.0.0.1:389/dc=i-debut,dc=org");
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, "uid=diradmin,cn=users,dc=i-debut,dc=org");
env.put(Context.SECURITY_CREDENTIALS, "admin");
// Create initial context

try
{

DirContext ctx = new InitialDirContext(env);

//System.out.println("user id is :" +userID);
//SearchControls ctls = new SearchControls();
//ctls.setSearchScope(2);


ModificationItem[] mods = new ModificationItem[1];
String str = "god1@i-debut.org";
Attribute mod0 = new BasicAttribute("mail",str); //original Password
//Attribute mod1 =new BasicAttribute("idebutUserNoren",newUnicodePwd); //modified Password

mods[0] =new ModificationItem(DirContext.REMOVE_ATTRIBUTE, mod0); //Replacing the Atribute in the Ldap

ctx.modifyAttributes("dc=i-debut,dc=org", mods);
System.out.println("modification seccess full0");

}
catch (Exception e)
{
e.printStackTrace();
}

}


}




MY LDIF FILE LOOKS LIKE SOME THING LIKE THIS

dn: ou=top, dc=i-debut,dc=org
objectClass: organizationalUnit
objectClass: idebutGroup
ou: top
idebutGroupName: å­¦æ?| ¡ã?~R¢ã?~R?~@?ã?~R«ã?~R?~Fã?~R?~Rã?~R?~@~T
groupOwnerID: 0

dn: idebutID=0, ou=top, dc=i-debut,dc=org
objectClass: idebutAccount
mail: god@i-debut.org
idebutID: 0
idebutUserType: God
o: top

dn: ou=bunka, ou=top, dc=10share,dc=com
objectClass: organizationalUnit
objectClass: idebutGroup
idebutGroupName: æ?~@~S?~@?å?~R?~@~Sæ?~S?è£?~@?å­¦å?~S?~@~Y
groupOwnerID: 1000
MaxnumOfidebutID: 4997
ou: bunka

dn: idebutID=1000, ou=bunka, ou=top, dc=i-debut,dc=org
objectClass: idebutAccount
idebutName: å±±æ?~S¬
mail: admin@bunka.ac.jp
idebutID: 1000
idebutUserType: SuperLeader
o: bunka

   <<Less
About | Sitemap | Contact