PDA

View Full Version : AttributeInUseException if attribute values differ only in case



mindjoy
Jun 8th, 2007, 09:54 AM
I have been using LdapTemplate's modifyAttributes(javax.naming.Name dn, javax.naming.directory.ModificationItem[] mods) as per documentation and ran into a peculiar situation.

My modification items are:

Modification item: Add attribute: objectclass: groupOfUniqueNames
Modification item: Remove attribute: objectclass: groupofuniquenames

As you can see, the problem is that the values of attribute "objectclass" differ only in case and, since LDAP is not case sensitive, exception javax.naming.directory.AttributeInUseException: [LDAP: error code 20 - Attribute Or Value Exists] is thrown.

There might be two ways to correct this:

(1) Change the code not to be case sensitive or
(2) First perform remove, then add.

Could somebody from the developers team take a look at this please? Thank you.

rasky
Jun 8th, 2007, 12:31 PM
This exact problem has been addressed in the 1.2-RC1 release. The modification item calculation has been greatly improved in this version. Please give it a try to see if it solves your problems. Feedback would be appreciated.
Cheers,

mindjoy
Jun 8th, 2007, 02:20 PM
Wonderful! I swapped 1.2-RC1 in and adjusted for the code changes as suggested in upgrade documents. As a result, my lowercase/uppercase problems disappeared. Thank you so much!