javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object]; remaining name 'cn=denis
我想添加节点到ldap目录下,但是总报错:
Exception in add():javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object]; remaining name 'cn=denis,dc=lily,dc=com'
下面是添加节点的方法代码,请大家帮忙看看哪有问题啊(服务器认证已成功)
public static void add(){
try{
String newUserName = "denis";
Attributes attrs = new BasicAttributes(true);
Attribute objclassSet = new BasicAttribute("objectclass");
objclassSet.add("top");
objclassSet.add("person");
attrs.put(objclassSet);
attrs.put(new BasicAttribute("cn", newUserName));
attrs.put(new BasicAttribute("sn", newUserName));
ctx.createSubcontext("cn=" + newUserName + ",dc=lily,dc=com", attrs); //添加一个节点
}catch(Exception e){
System.out.println("Exception in add():"+e);
}
}
Exception in add():javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object]; remaining name 'cn=denis,dc=lily,dc=com'
下面是添加节点的方法代码,请大家帮忙看看哪有问题啊(服务器认证已成功)
public static void add(){
try{
String newUserName = "denis";
Attributes attrs = new BasicAttributes(true);
Attribute objclassSet = new BasicAttribute("objectclass");
objclassSet.add("top");
objclassSet.add("person");
attrs.put(objclassSet);
attrs.put(new BasicAttribute("cn", newUserName));
attrs.put(new BasicAttribute("sn", newUserName));
ctx.createSubcontext("cn=" + newUserName + ",dc=lily,dc=com", attrs); //添加一个节点
}catch(Exception e){
System.out.println("Exception in add():"+e);
}
}
解决方案 »
- 求帮忙在myeclipse里面导入一个maven项目,有偿!
- Exception in thread "main" java.lang.OutOfMemoryError: Java heap space,怎么办
- 使用java开发基于C/S模式的应用程序
- 两道面试题..有点难度.!雪地跪求答案!~~~!~!~!~!
- 一道简单的考试题,有点疑问
- 由oracle 数据库更换为sqlserver的疑问!
- 请问Java有没有工业模拟、控制、监视方面的开源东东啊
- import的问题
- Exception in thread "main" java.lang.NoClassDefFoundError: hw
- 怎么样捕获鼠标的双击事件?
- 热心好友帮忙看下我的程序出了什么问题,在下不胜感激!
- 请问,怎么给JTextArea设置字体啊。
程序又出现新的问题了!
在服务器认证时,原来的程序认证授权是simple,后来认证授权改为none时出现下面错误:
Exception in add():javax.naming.AuthenticationNotSupportedException: [LDAP: error code 8 - modifications require authentication]; remaining name 'cn=denis,dc=lily,dc=com'
认证授权改为strong时出现下面错误:
javax.naming.AuthenticationNotSupportedException: strong
这又是怎么回事呢?
改为 ctx.createSubcontext("cn=" + newUserName , attrs);