Closed
Description
Javadoc for @DnAttribute
states:
Indicates that a field is to be automatically populated to/from the distinguished name of an entry.
However, spring-ldap will also try to create an actual LDAP attribute with any field annotated with @DnAttribute
. So either the documentation is wrong or this annotation does too much.
In my case, using
@DnAttribute(value = "ou", index = 3) public String branch;
causes a schema violation:
Caused by: javax.naming.directory.SchemaViolationException:
[LDAP: error code 65 - Unable to modify entry '<removed>' because the entry resulting from applying the modifications would have violated the provided schema:
The entry contains attribute branch which is not defined in the schema.]
Please either document this behaviour or prevent @DnAttribute
from affecting something else than the DN.