directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerald Turner (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DIRAPI-156) LdapNetworkConnection.addSchema doesn't register attribute types
Date Thu, 22 Aug 2013 18:03:52 GMT

    [ https://issues.apache.org/jira/browse/DIRAPI-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13747729#comment-13747729
] 

Gerald Turner commented on DIRAPI-156:
--------------------------------------

Sorry if the use of UUID in a DN made this analysis too complex - it happens to be the quickest
path to an exception.

In another example, if re-work the client to ignore instantiating a Dn containg this custom
uuid attribute, and instead try to search other entries that have custom attributes that are
not part of the DN, the API emits log messages about the type not existing, and fetching the
attributes return null.

Schema:

  attributetype ( 1.3.6.1.4.1.38541.2.1.100
                  NAME 'requiredRole'
                  DESC 'Required Roles for a company unit'
                  SUP 2.5.4.49 )

  attributetype ( 1.3.6.1.4.1.38541.2.1.101
                  NAME 'optionalRole'
                  DESC 'Optional Role for a company unit'
                  SUP distinguishedName )

  objectclass   ( 1.3.6.1.4.1.38541.2.2.2
                  NAME 'customerOrganization'
                  DESC 'XOI Customer Organization Object reference'
                  SUP organization
                  MUST ( cn $ o )
                  MAY ( optionalRole $ requiredRole ) )

Entry:

  dn: o=Asus,ou=customers,dc=xoint,dc=net
  objectClass: customerOrganization
  o: Asus
  cn: Asus International ICR
  requiredRole: cn=Application1787,ou=roles,o=jaas,dc=xoint,dc=net
  requiredRole: cn=ICRCSSTAccess,ou=roles,o=jaas,dc=xoint,dc=net
  optionalRole: cn=ICRCSSTReadOnly,ou=roles,o=jaas,dc=xoint,dc=net
  optionalRole: cn=ICRCSSTRestrictDNISGroup,ou=roles,o=jaas,dc=xoint,dc=net

Log output:

  10:48:52,821 WARN  [org.apache.directory.api.ldap.model.entry.DefaultEntry] (NioProcessor-1)
The attribute 'optionalrole' cannot be stored
  10:48:52,824 ERROR [org.apache.directory.api.ldap.model.entry.DefaultEntry] (main) ERR_04269
ATTRIBUTE_TYPE for OID requiredrole does not exist!
  10:48:52,825 ERROR [org.apache.directory.api.ldap.model.entry.DefaultEntry] (main) ERR_04269
ATTRIBUTE_TYPE for OID optionalrole does not exist!
  10:48:52,822 WARN  [org.apache.directory.ldap.client.api.LdapNetworkConnection] (NioProcessor-1)
ERR_04269 ATTRIBUTE_TYPE for OID optionalrole does not exist!: org.apache.directory.api.ldap.model.exception.LdapNoSuchAttributeException:
ERR_04269 ATTRIBUTE_TYPE for OID optionalrole does 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:1)
[:]
    at org.apache.directory.api.ldap.schemamanager.impl.DefaultSchemaManager.lookupAttributeTypeRegistry(DefaultSchemaManager.java:1604)
[:]
    at org.apache.directory.api.ldap.model.entry.DefaultEntry.<init>(DefaultEntry.java:311)
[:]
    at org.apache.directory.ldap.client.api.LdapNetworkConnection.messageReceived(LdapNetworkConnection.java:2099)
[:]
    at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:690)
[mina-core-2.0.7.jar:]
    at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417)
[mina-core-2.0.7.jar:]
    at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47)
[mina-core-2.0.7.jar:]
    at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765)
[mina-core-2.0.7.jar:]
    at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:407)
[mina-core-2.0.7.jar:]
    at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:236)
[mina-core-2.0.7.jar:]
    at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417)
[mina-core-2.0.7.jar:]
    at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47)
[mina-core-2.0.7.jar:]
    at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765)
[mina-core-2.0.7.jar:]
    at org.apache.mina.filter.ssl.SslHandler.flushScheduledEvents(SslHandler.java:322) [mina-core-2.0.7.jar:]
    at org.apache.mina.filter.ssl.SslFilter.messageReceived(SslFilter.java:497) [mina-core-2.0.7.jar:]
    at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417)
[mina-core-2.0.7.jar:]
    at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47)
[mina-core-2.0.7.jar:]
    at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765)
[mina-core-2.0.7.jar:]
    at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:109)
[mina-core-2.0.7.jar:]
    at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417)
[mina-core-2.0.7.jar:]
    at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:410)
[mina-core-2.0.7.jar:]
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:710)
[mina-core-2.0.7.jar:]
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:664)
[mina-core-2.0.7.jar:]
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:653)
[mina-core-2.0.7.jar:]
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$600(AbstractPollingIoProcessor.java:67)
[mina-core-2.0.7.jar:]
    at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1124)
[mina-core-2.0.7.jar:]
    at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) [mina-core-2.0.7.jar:]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_09]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_09]
    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09]
  Caused by: org.apache.directory.api.ldap.model.exception.LdapException: ERR_04269 ATTRIBUTE_TYPE
for OID optionalrole 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)
[:]
    ... 30 more


                
> 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
>
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message