You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Kiran Ayyagari (JIRA)" <ji...@apache.org> on 2014/03/21 04:55:43 UTC

[jira] [Updated] (DIRAPI-156) LdapNetworkConnection.addSchema doesn't register attribute types

     [ https://issues.apache.org/jira/browse/DIRAPI-156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kiran Ayyagari updated DIRAPI-156:
----------------------------------

    Fix Version/s: 1.0.0-M22

> 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
>             Fix For: 1.0.0-M22
>
>         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<Value<?>> iterator = memberAttribute.iterator();
>          iterator.hasNext();) {
>       @SuppressWarnings("unchecked")
>       Value<String> value = (Value<String>) 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.<init>(Dn.java:287)
>     at net.xoint.usermanager.model.Role.<init>(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.2#6252)