Return-Path: X-Original-To: apmail-directory-dev-archive@www.apache.org Delivered-To: apmail-directory-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EDCF51089D for ; Mon, 24 Feb 2014 09:59:24 +0000 (UTC) Received: (qmail 70773 invoked by uid 500); 24 Feb 2014 09:59:22 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 70368 invoked by uid 500); 24 Feb 2014 09:59:20 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 70354 invoked by uid 99); 24 Feb 2014 09:59:19 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Feb 2014 09:59:19 +0000 Date: Mon, 24 Feb 2014 09:59:19 +0000 (UTC) From: "Kiran Ayyagari (JIRA)" To: dev@directory.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (DIRAPI-156) LdapNetworkConnection.addSchema doesn't register attribute types MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DIRAPI-156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kiran Ayyagari resolved DIRAPI-156. ----------------------------------- Resolution: Not A Problem Assignee: Kiran Ayyagari > LdapNetworkConnection.addSchema doesn't register attribute types > ---------------------------------------------------------------- > > Key: DIRAPI-156 > URL: https://issues.apache.org/jira/browse/DIRAPI-156 > Project: Directory Client API > Issue Type: Bug > Affects Versions: 1.0.0-M20 > Reporter: Gerald Turner > Assignee: Kiran Ayyagari > Attachments: DIRAPI-156.patch > > > I'm loading schema with code like: > con.loadSchema(new JarLdifSchemaLoader()); > con.addSchema("custom.schema"); > Later an exception is thrown while I'm handling some search results. The entry in question looks like: > dn: cn=ICRCSSTAccess,ou=Roles,o=jaas,dc=xoint,dc=net > objectClass: groupOfNames > cn: ICRCSSTAccess > member: uid=gturner,ou=people,dc=xoint,dc=net > member: uuid=98bb35ee-9ff3-444f-9925-7fe762810d50,o=Asus,ou=customers,dc=xoint,dc=net > The code where the exception is thrown looks like: > Attribute memberAttribute = entry.get("member"); > if (memberAttribute != null) > for (Iterator> iterator = memberAttribute.iterator(); > iterator.hasNext();) { > @SuppressWarnings("unchecked") > Value value = (Value) iterator.next(); > String member = value.getValue(); > Dn memberDn = new Dn(context.getSchemaManager(), member); > members.add(memberDn); > } > It is the Dn instantiation that throws the following stacktrace: > > org.apache.directory.api.ldap.model.exception.LdapInvalidDnException: ERR_04188 The type cannot be empty or null > at org.apache.directory.api.ldap.model.name.Dn.atavOidToName(Dn.java:1106) > at org.apache.directory.api.ldap.model.name.Dn.rdnOidToName(Dn.java:1143) > at org.apache.directory.api.ldap.model.name.Rdn.apply(Rdn.java:454) > at org.apache.directory.api.ldap.model.name.Dn.apply(Dn.java:1202) > at org.apache.directory.api.ldap.model.name.Dn.apply(Dn.java:1281) > at org.apache.directory.api.ldap.model.name.Dn.(Dn.java:287) > at net.xoint.usermanager.model.Role.(Role.java:45) > at net.xoint.usermanager.model.LDAPLoader.loadRoles(LDAPLoader.java:75) > at net.xoint.usermanager.model.LDAPLoader.load(LDAPLoader.java:52) > at net.xoint.usermanager.UserManagerTest.test2(UserManagerTest.java:134) > Caused by: org.apache.directory.api.ldap.model.exception.LdapInvalidDnException: ERR_04188 The type cannot be empty or null > at org.apache.directory.api.ldap.model.name.Ava.apply(Ava.java:476) > at org.apache.directory.api.ldap.model.name.Dn.atavOidToName(Dn.java:1100) > ... 36 more > Caused by: org.apache.directory.api.ldap.model.exception.LdapNoSuchAttributeException: ERR_04269 ATTRIBUTE_TYPE for OID 1.3.6.1.4.1.38541.2.1.3 do\ > es not exist! > at org.apache.directory.api.ldap.model.schema.registries.DefaultAttributeTypeRegistry.lookup(DefaultAttributeTypeRegistry.java:293) > at org.apache.directory.api.ldap.model.schema.registries.DefaultAttributeTypeRegistry.lookup(DefaultAttributeTypeRegistry.java:47) > at org.apache.directory.api.ldap.schemamanager.impl.DefaultSchemaManager.lookupAttributeTypeRegistry(DefaultSchemaManager.java:1604) > at org.apache.directory.api.ldap.model.name.Ava.apply(Ava.java:470) > ... 37 more > Caused by: org.apache.directory.api.ldap.model.exception.LdapException: ERR_04269 ATTRIBUTE_TYPE for OID 1.3.6.1.4.1.38541.2.1.3 does not exist! > at org.apache.directory.api.ldap.model.schema.registries.DefaultSchemaObjectRegistry.lookup(DefaultSchemaObjectRegistry.java:176) > at org.apache.directory.api.ldap.model.schema.registries.DefaultAttributeTypeRegistry.lookup(DefaultAttributeTypeRegistry.java:289) > ... 40 more > OID 1.3.6.1.4.1.38541.2.1.3 is the uuid attribute that is part of a member DN. "custom.schema" defines it as follows: > > attributetype ( 1.3.6.1.4.1.38541.2.1.3 > NAME 'uuid' > DESC 'The customer UUID' > EQUALITY UUIDMatch > SYNTAX 1.3.6.1.1.16.1 > SINGLE-VALUE ) > While scrutinizing the source, looking for why this attribute wouldn't be found in the DefaultSchemaObjectRegistry#byName Map for the AttributeTypeRegistry, I'm beginning to suspect that somewhere around where LdapNetworkConnection#addSchema is calling AttributeTypeRegistry#addMappingFor, it hasn't quite finished the job, perhaps something like calling AttributeTypeRegistry#register (which seems to be the only method that put's into the byName Map). > Mailing List reference: https://mail-archives.apache.org/mod_mbox/directory-api/201308.mbox/%3C87eh9mhl46.fsf@zoth-ommog.unzane.com%3E -- This message was sent by Atlassian JIRA (v6.1.5#6160)