I am creating an application where I am write LDAP client which would connect to SunOne Directory Server. User an enter attributes, select type and enter value and my application will create that user on the SunOne.
When user selects homePhone
, type as Integer
and enters value as 22334546
, it fails with below exception
javax.naming.directory.InvalidAttributeValueException: Malformed 'homePhone' attribute value; remaining name 'cn=Identity3,ou=SunOU'
The code for same is
for(...)
{
String attrName = attrRequest.getName();
Object attrVal = attrRequest.getValue();
BasicAttribute attribute = getBasicAttribute(attrName, attrVal);
attrs.put(attribute);
}
ldapCtx.bind(objectDN,null,attrs);
I am able to create this user using Apache directory Studio