if (schemaManager != null) {
AttributeTypeRegistry registry = schemaManager.getAttributeTypeRegistry();
if (registry != null) {
try {
String oid = registry.getOidByName(attributeName);
return registry.lookup(oid);
} catch (LdapException e) {
String msg = "An error occurred while querying attribute " + attributeName +
" from registry.";
logger.error(msg, e);
throw new DirectoryServerException(msg, e);