Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 41697 invoked from network); 30 Sep 2007 22:02:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Sep 2007 22:02:55 -0000 Received: (qmail 68956 invoked by uid 500); 30 Sep 2007 22:02:44 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 68906 invoked by uid 500); 30 Sep 2007 22:02:44 -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 68895 invoked by uid 99); 30 Sep 2007 22:02:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Sep 2007 15:02:44 -0700 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 66.249.82.231 as permitted sender) Received: from [66.249.82.231] (HELO wx-out-0506.google.com) (66.249.82.231) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Sep 2007 22:02:43 +0000 Received: by wx-out-0506.google.com with SMTP id s8so2747243wxc for ; Sun, 30 Sep 2007 15:02:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; 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; bh=LU5W7FxX4uJzx4MQkHJDwFXBUSgUq0HgFZZFNd+7ZEw=; b=Sb45WsdbVmFpDbAUkmPb52+sVsel3vn09tQOXyYdzX/NpHuHnxbjCdD8P7YJMHA7SOzshYMzjN53TQhLS4j0MH3cV3f2fXvxypVhtvVH17AbncH5DOboMH6QztC0JaVLKu/jbSdHWHuBFnANAjcxNJnPRSVrqxIxREv8YfxJLps= 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=ijf/pRIDR5ASzNWkaJRCZHDpWz5EI3es4oBWAJs+VWMZNLtZ+B8rzyxro3GVvOBnlhFYupupnP+CDfZa9J8skTNB/9ga7VK6Nq0JEl0R2Du3ylkzDbp/UPX4ge50MBI7TeBTKRC+23UvadsP9XhcI28jJaGcnWatsB54hsltNE0= Received: by 10.90.115.9 with SMTP id n9mr4602046agc.1191189742076; Sun, 30 Sep 2007 15:02:22 -0700 (PDT) Received: by 10.90.65.1 with HTTP; Sun, 30 Sep 2007 15:02:22 -0700 (PDT) Message-ID: Date: Mon, 1 Oct 2007 00:02:22 +0200 From: "Emmanuel Lecharny" Reply-To: elecharny@iktek.com To: "Apache Directory Developers List" Subject: Re: ClassCastException in rename() In-Reply-To: <12970672.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <12970503.post@talk.nabble.com> <12970672.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org yes, for sure. But we are just in the middle of a big cleanup, to get rid of such horrible things ... On 9/30/07, jdemic wrote: > > > Hmmm...shouldnt the method signature take LdapDN instances then instead o= f > instances of Name? > > > Emmanuel Lecharny-3 wrote: > > > > Hi, > > > > as you can see, the two DN are supposed to be LdapDN objects. If you pa= ss > > some > > org.springframework.ldap.support.DistinguishedName objects, you will > > certainly get some ClasscastException, for sure... > > > > On 9/30/07, jdemic wrote: > >> > >> Hey All, > >> > >> I'm encountering a ClassCastException in the rename() method of > >> ServerContext. I'm not sure if I'm doing something wrong, but the code > >> works > >> with OpenLDAP but not with ApacheDS. Here's the relevant lines from > >> ServerContext: > >> > >> public void rename( Name oldName, Name newName ) throws NamingExcepti= on > >> { > >> LdapDN oldDn =3D buildTarget( oldName ); > >> LdapDN newDn =3D buildTarget( newName ); > >> > >> if ( oldDn.size() =3D=3D 0 ) > >> { > >> throw new LdapNoPermissionException( "can't rename the > >> rootDSE" > >> ); > >> } > >> > >> // calculate parents > >> LdapDN oldBase =3D ( LdapDN ) oldName.clone(); <<<< > >> ClassCastException > >> > >> My client code is passing in > >> org.springframework.ldap.support.DistinguishedName objects. I could b= e > >> mistaken, but it seems like the clone() should be on oldDn and not > >> oldName. > >> > >> Any help is appreciated, > >> -jd > >> > >> -- > >> View this message in context: > >> http://www.nabble.com/ClassCastException-in-rename%28%29-tf4545255.htm= l#a12970503 > >> Sent from the Apache Directory Project mailing list archive at > >> Nabble.com. > >> > >> > > > > > > -- > > Regards, > > Cordialement, > > Emmanuel L=E9charny > > www.iktek.com > > > > > > -- > View this message in context: http://www.nabble.com/ClassCastException-in= -rename%28%29-tf4545255.html#a12970672 > Sent from the Apache Directory Project mailing list archive at Nabble.com= . > > --=20 Regards, Cordialement, Emmanuel L=E9charny www.iktek.com