Closed rwinch closed 8 years ago
cdevos said: Hi,
We're currently using spring-ldap and it's been ok until we ran on this issue, do you plan on having it fixed anytime soon? We found a quick fix by mapping the DN not to a Name but to a String and handle the DN in java... but it's not flawless...
Cheers,
Clément
rwinch said: Right now my focus is on getting Spring Security 4.0 M2 out.
Of course a PR with a proper fix and test would be most welcome & speed things up quite a bit.
Original Reporter: thommy25 Environment: Not Specified Version: 2.0.1 Migrated From: https://jira.spring.io//browse/LDAP-304 My domain class has following javax.naming.Name attribute:
{code} @Attribute(name = "memberDN") private final Set memberDNs = new HashSet();
{code}
1) First I created a new instance (without setting this attribut !!!) and save the instance by calling LDAPRepository.save() method.
2) After that I modified this attribut by calling addMemberDN(), and saving the instance again throws a NullPointerException
{noformat} [ERROR] java.lang.NullPointerException [ERROR] at org.springframework.ldap.core.DirContextAdapter.collectModifications(DirContextAdapter.java:338) {noformat}
look at the sourcecode:
{code} NameAwareAttribute currentAttribute = originalAttrs.get(changedAttr.getID());
338: currentAttribute.initValuesAsNames(); } {code}
problem: currentAttribute is null, because this attribute has not been seet,