【发布时间】:2016-03-05 11:55:06
【问题描述】:
我试图在 ldap 中添加一个新条目。我正在使用unboundid ldap sdk 我能够成功连接到 ldap 但是当我尝试添加新条目时,我收到以下错误:
Exception in thread "main" LDAPException(resultCode=undefined attribute type, errorMessage='changetype: attribute type undefined')
at com.unboundid.ldap.sdk.LDAPConnection.add(LDAPConnection.java:1539)
这是我用来向 ldap 添加条目的代码 sn-p:
String[] ldifAttrs = {
"dn: ou=people,dc=maxcrc,dc=com",
"changetype:add",
"cn: vipin",
"sn: falke",
"uid: vfalke",
"userPassword:secret"
};
LDAPConnection ldapConnection = new LDAPConnection("127.0.0.1", 389,
"cn=Manager, dc=maxcrc, dc=com", "secret");
ldapConnection.add(new AddRequest(ldifAttrs));
请告诉我我做错了什么。
谢谢
【问题讨论】:
标签: java openldap unboundid-ldap-sdk