Hi everyone,

I'm working on a project where I have embedded an Apache DS for testing purpose.

In my unit test, I'm trying to launch a request like this one

   "(&(member=cn=John
   Doe,ou=Peoples,ou=Paris,ou=Offices,dc=ippon,dc=fr)(objectClass=ipponGroup))"

Unfortunaly this request fails with the following stack trace

   Caused by: java.lang.NullPointerException
       at
   
org.apache.directory.server.core.schema.DnNormalizer.normalize(DnNormalizer.java:64)
       at
   
org.apache.directory.shared.ldap.schema.CachingNormalizer.normalize(CachingNormalizer.java:96)
       at
   
org.apache.directory.server.core.partition.impl.btree.LeafEvaluator.evalEquality(LeafEvaluator.java:332)
       at
   
org.apache.directory.server.core.partition.impl.btree.LeafEvaluator.evaluate(LeafEvaluator.java:121)
       at
   
org.apache.directory.server.core.partition.impl.btree.ExpressionEvaluator.evaluate(ExpressionEvaluator.java:103)
       at
   
org.apache.directory.server.core.partition.impl.btree.ExpressionEvaluator.evaluate(ExpressionEvaluator.java:130)
       at
   
org.apache.directory.server.core.partition.impl.btree.ExpressionEnumerator$2.assertCandidate(ExpressionEnumerator.java:257)
       at
   
org.apache.directory.server.core.partition.impl.btree.IndexAssertionEnumeration.prefetch(IndexAssertionEnumeration.java:161)
       at
   
org.apache.directory.server.core.partition.impl.btree.IndexAssertionEnumeration.<init>(IndexAssertionEnumeration.java:66)
       at
   
org.apache.directory.server.core.partition.impl.btree.ExpressionEnumerator.enumConj(ExpressionEnumerator.java:270)
       at
   
org.apache.directory.server.core.partition.impl.btree.ExpressionEnumerator.enumerate(ExpressionEnumerator.java:134)
       at
   
org.apache.directory.server.core.partition.impl.btree.DefaultSearchEngine.search(DefaultSearchEngine.java:136)
       at
   
org.apache.directory.server.core.partition.impl.btree.BTreePartition.search(BTreePartition.java:404)
       at
   
org.apache.directory.server.core.partition.DefaultPartitionNexus.search(DefaultPartitionNexus.java:863)
       at
   
org.apache.directory.server.core.interceptor.InterceptorChain$1.search(InterceptorChain.java:139)
       at
   
org.apache.directory.server.core.interceptor.InterceptorChain$2.search(InterceptorChain.java:1263)
       ... 45 more

ipponGroup objectClass's definition - OpenLDAP form - is the following :

   ##
   ##
   objectclass (1.3.6.1.4.1.7165.1.1.1.2 NAME 'ipponGroup'
       SUP top STRUCTURAL
       MUST ( cn )
       MAY ( description $ member ) )

member attribute is the same as described in the RFC2256: member of a group


With the debugger I found that the concerned method - DnNormalizer#normalize(Object) - does not perform LdapDN dn initilization. Here the code :

       public Object normalize( Object value ) throws NamingException
       {
           LdapDN dn = null;
           if ( value instanceof LdapDN )
           {
               dn = ( LdapDN ) ( ( LdapDN ) value ).clone();
           }
           else if ( value instanceof Name )
           {
               dn = new LdapDN( ( Name ) value );
           }
           else if ( value instanceof String )
           {
               dn = new LdapDN( ( String ) value );
           }
dn.normalize( attrRegistry.getNormalizerMapping() );
           return dn.getNormName();
       }

In my case dn is null because value passed as parameter is a byte[]. Indeed, it seems that the case of DN containing non US-ASCII characters - my DNs may be composed with all characters used for (french) name and surname - is represented by ApacheDS with a byte[] - which can be used to construct a new String representation.

Is ApacheDS fails to handle UTF8 DN or should I not use UTF8 DN? In the second case, is the LDAP protocol explicitly proscribe non US-ASCII DN?

Thanks for help.

Reply via email to