Return-Path: Delivered-To: apmail-directory-users-archive@www.apache.org Received: (qmail 71091 invoked from network); 12 May 2009 14:25:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 May 2009 14:25:36 -0000 Received: (qmail 94405 invoked by uid 500); 12 May 2009 14:24:28 -0000 Delivered-To: apmail-directory-users-archive@directory.apache.org Received: (qmail 94274 invoked by uid 500); 12 May 2009 14:24:28 -0000 Mailing-List: contact users-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@directory.apache.org Delivered-To: mailing list users@directory.apache.org Received: (qmail 94220 invoked by uid 99); 12 May 2009 14:24:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 May 2009 14:24:28 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of elecharny@gmail.com designates 209.85.220.180 as permitted sender) Received: from [209.85.220.180] (HELO mail-fx0-f180.google.com) (209.85.220.180) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 May 2009 14:24:18 +0000 Received: by fxm28 with SMTP id 28so5017fxm.25 for ; Tue, 12 May 2009 07:23:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=m+Lg/wsNc+srPaxKqCFqoPGRzBu5jaGb9vJ5xb/TCHQ=; b=UoWN1zT4+8HXeiyMpZ5KnAqflzcqLuJzTxVCvkl4+kjG5fF3v9qC08mwufjdVKaxkN /XpXLOUc9tXva+gNrFHAH9pmFgvTwitg8V/O2RpTfMFjrLZ+OapwHWgbF3HioiN9Y6UM axEuJhSuipdCdCTJlqK8vicNEIk+XXLiSpdwo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; b=QceDCHuK2kZJvyz4T04ZrSAw10/7RLpkF0qF/48xWviHZvBuz7IMDCP2rSSALxbcWq SHAdeuFQSwBpVJnS45ntDIt3rRWD/BZiz3Yq+wxz3amhfSu1xIQ2wuDradzmZP5VPlpG QBKJzxmxENu1arg8go9dPeMRZpzqmZRiP8EcY= Received: by 10.86.53.2 with SMTP id b2mr7799038fga.67.1242138236138; Tue, 12 May 2009 07:23:56 -0700 (PDT) Received: from ?192.168.0.1? (vol75-3-82-66-216-176.fbx.proxad.net [82.66.216.176]) by mx.google.com with ESMTPS id d6sm8976928fga.7.2009.05.12.07.23.55 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 12 May 2009 07:23:55 -0700 (PDT) Sender: Emmanuel Lecharny Message-ID: <4A09867E.4090605@nextury.com> Date: Tue, 12 May 2009 16:23:58 +0200 From: Emmanuel Lecharny User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 To: users@directory.apache.org Subject: Re: 1.5.5 convertAttributesFromLdif : An entry must not have two DNs References: <85db8ff60905120644s244a74cne101eeccd973aab6@mail.gmail.com> In-Reply-To: <85db8ff60905120644s244a74cne101eeccd973aab6@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Tom Zeller wrote: > In trunk, it looks like LdifUtils.convertAttributesFromLdif() throws a > NamingException for ldif containing a dn. > Plain normal, but might be confusing. What happens is that this method tries to convert something stored using a LDIF format to an Attributes (JNDI). Attributes objects don't contain a DN, only attributes. This method is a bit confusing, as it does not state that it does not try to convert only the attributes. If you want to parse a LDIF to get an Attributes object, you have to use the LdifReader.parseLdif( String ), you'll get a List of Entry objects, and loop on the entry's attributes to convert them to Attribute, and store them into an Attributes. FYI, we have defined a new set of classes to manage LDAP elements, based on the Entry element (basically, an entry is a DN plus a set of attributes). Hope it helps. -- -- cordialement, regards, Emmanuel L�charny www.iktek.com directory.apache.org