Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 3361 invoked from network); 1 Jun 2007 15:30:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Jun 2007 15:30:11 -0000 Received: (qmail 2835 invoked by uid 500); 1 Jun 2007 15:30:14 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 2797 invoked by uid 500); 1 Jun 2007 15:30:14 -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 2786 invoked by uid 99); 1 Jun 2007 15:30:14 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jun 2007 08:30:14 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of elecharny@gmail.com designates 64.233.184.237 as permitted sender) Received: from [64.233.184.237] (HELO wr-out-0506.google.com) (64.233.184.237) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jun 2007 08:30:09 -0700 Received: by wr-out-0506.google.com with SMTP id 25so537928wry for ; Fri, 01 Jun 2007 08:29:48 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Ai3A5exLNnOXzpfOSmVKWQYX3OmwbYFqP2TvNweljMWRRiMzJ/WI3AtGsCq9nIai5WuPlskCM1qgc1OJRooBBlcKPzr8AdvnSonqXX1POt1lyjqft5GtlvbPezcT4gYwLU4a8DJi2mceyEX8E4hVcsJg+ZSvhRdZHOU9fN2Yr78= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=evQbMoh0fqrsRg4CEzeOc+CVLrZYNWZxxNqLqQPK9Nls+YpUgQioLzRotNrENUty6/sa10RHqiqBK8pmPAUCo3dwYLortDCDnvriEgNFZWlwbWs2vtuoIxD9iHfyGDFZ2xMw37D2118Q5hX8jJyP5fxSR5+PLnFRd6FD0H45i1g= Received: by 10.78.123.5 with SMTP id v5mr1295818huc.1180711787798; Fri, 01 Jun 2007 08:29:47 -0700 (PDT) Received: by 10.78.42.13 with HTTP; Fri, 1 Jun 2007 08:29:47 -0700 (PDT) Message-ID: Date: Fri, 1 Jun 2007 17:29:47 +0200 From: "Emmanuel Lecharny" Reply-To: elecharny@iktek.com To: "Apache Directory Developers List" Subject: Re: NPE Defect in Latest Directory - 1.0.2 In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: X-Virus-Checked: Checked by ClamAV on apache.org Hi Simon, the difference between remote and embedded server is natural : when using a remote server, all the messages are encoded into an ASN.1 BER encoded byte array, and decoded on the server, but we use our home made BasicAttributes, which is case insesitive. Emmanuel On 6/1/07, Simon.Temple@saaconsultants.com wrote: > > > > Hi Alex > > Your suggestion makes good sense, a developer would get early visibility = of > any attempt to use the "wrong type" of BasicAttributes. > > However, I now have code that used to work with DS 1.0.0 that no longer > works with DS 1.0.2, furthermore I have code that will work if used with = a > remote context (i.e. via LDAP communications) and won't if I run with an > embedded directory context. > > It's the inconsistent behaviour of the same interface between versions an= d > remote/local contexts that I have found confusing. > > Is there any way we can have the old behaviour back where it didn't see t= o > matter what type of BasicAttributes() we used? :o) > > Kind Regards > > Simon Temple > > 01 June 2007 15:58 > To: "Apache Directory Developers List" , > elecharny@iktek.com > cc: > From: "Alex Karasulu" > Subject: Re: NPE Defect in Latest Directory - 1.0.2 > > +1 on all of Emmanuel's points. Let me add one additional option. > > We could write some protective code to detect when the BasicAttributes is > created without the > boolean argument for ignoring case. We should have some kind of > RuntimeException for it. > Could be a ConfigurationException maybe? Don't know exactly but basicall= y > we need: > > BasicAttributes attrs =3D ... > if ( ! attrs.isCaseIgnored() ) > { > throw new "something that tells the user to correct this miss > configuration of BasicAttributes"; > } > > WDYT? > > Alex > > > On 6/1/07, Emmanuel Lecharny wrote: > > Hi Simon, > > > > you can raise a JIRA, because we should not allow NPE in the server. > > > > Now, regarding Attributes(), you should *always* pass true as an > > argument. This is a major drawback of JNDI as a generic API for > > directory, because it does not take into account the underlying > > directory it has to deal with. There is nothing we can do about it, > > except fixing NPEs, when it comes to use ADS embedded (meaning : > > without the network layer which automatically substitutes > > BasicAttributes to a more ldap compliant BasicAttributesImpl...) > > > > Emmanuel > > > > On 6/1/07, Simon.Temple@saaconsultants.com > > < Simon.Temple@saaconsultants.com> wrote: > > > > > > > > > We've found a problem with DS 1.0.2. This problem only exists when > running > > > with DS embedded in the same VM. > > > Running the same code remotely (outside of DS VM) works fine. > > > > > > Example code: > > > > > > .... > > > Attributes attrs =3D new BasicAttributes(); > > > attrs.put("objectClass", "organizationalUnit"); > > > attrs.put("description", "Test OU"); > > > > > > DirContext subContext =3D context.createSubcontext("ou=3D= Test", > > > attrs); > > > > > > > > > Exception from createSubcontext(): > > > > > > Caused by: java.lang.NullPointerException > > > at > > > > org.apache.directory.shared.ldap.util.AttributeUtils.containsValueCaseIgn= ore(AttributeUtils.java:309) > > > at > > > > org.apache.directory.server.core.schema.SchemaService.assertAllAttributes= Allowed > (SchemaService.java:1806) > > > at > > > > org.apache.directory.server.core.schema.SchemaService.check(SchemaService= .java:1624) > > > at > > > > org.apache.directory.server.core.schema.SchemaService.add(SchemaService.j= ava > :1636) > > > at > > > > org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.add= (InterceptorChain.java:1181) > > > ... 130 more > > > > > > If you change the BasicAttributes() constructor call to: > > > > > > Attributes attrs =3D new BasicAttributes( true ); > > > > > > it works fine. > > > > > > This issue means we cannot use DS 1.0.2. Should I raise a JIRA entry > yet or > > > should I hold off until you guys have had chance to check my findings= ? > > > > > > Many Thanks > > > > > > SimonT > > > > > > -- > > Regards, > > Cordialement, > > Emmanuel L=E9charny > > www.iktek.com > > > > --=20 Regards, Cordialement, Emmanuel L=E9charny www.iktek.com