0
我試圖向ldap中添加一個新條目。我使用unboundid ldap sdk我能夠成功連接然而,LDAP,當我嘗試添加新條目,我收到以下錯誤:使用unboundid ldap sdk在openldap服務器中添加條目
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代碼片段:
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));
請讓我什麼我做錯了。
謝謝