Return-Path: X-Original-To: apmail-directory-dev-archive@www.apache.org Delivered-To: apmail-directory-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8BAF0F8BF for ; Thu, 18 Apr 2013 18:53:44 +0000 (UTC) Received: (qmail 85348 invoked by uid 500); 18 Apr 2013 18:53:44 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 85302 invoked by uid 500); 18 Apr 2013 18:53: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 85295 invoked by uid 99); 18 Apr 2013 18:53:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Apr 2013 18:53:44 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ayyagarikiran@gmail.com designates 209.85.210.176 as permitted sender) Received: from [209.85.210.176] (HELO mail-ia0-f176.google.com) (209.85.210.176) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Apr 2013 18:53:38 +0000 Received: by mail-ia0-f176.google.com with SMTP id i9so2739101iad.21 for ; Thu, 18 Apr 2013 11:53:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=TSNAf7hTbYPcG/B5KPHVtozr7m6nNq9+BoX2z9WQoRs=; b=GtTW1UvapZ8WRKCfiuI1hdHim6He72NiRONr90StvmI0I5AMDVc6kyqHCx+enZujGu GFeklKgqhzcvBVZQWXSCmWP7gzUI8wrIH837NaTC26GQ0NClRIWDgRb4gt1b2BaJXqx0 VqD3p2CPCn+9lpJ7d/dxlRPUw1LMB9dr4oXo/fIeOqNDMjnfx4Qi2nmSR2iB1PR2Vb1I jxf8B6q/bleLiVVoMDBkJ8Yb3W8C7RYN1EG+6xj9gkWdU6M5CdCEDFhJz09oDhrRHkL9 Mqkuj99yEjH8I6x10B2wCBpSZJRh2fRZhaSr32Ur8u2ptruykjjEx1Ep7zXuVJG95ZZZ iObg== MIME-Version: 1.0 X-Received: by 10.50.136.131 with SMTP id qa3mr126985igb.1.1366311197597; Thu, 18 Apr 2013 11:53:17 -0700 (PDT) Sender: ayyagarikiran@gmail.com Received: by 10.231.121.5 with HTTP; Thu, 18 Apr 2013 11:53:17 -0700 (PDT) In-Reply-To: <7D664BE6CF058A4CB1A06984A7AA678F18037C877B@SM-CALA-VXMB06A.swna.wdpr.disney.com> References: <7D664BE6CF058A4CB1A06984A7AA678F18037C877B@SM-CALA-VXMB06A.swna.wdpr.disney.com> Date: Fri, 19 Apr 2013 00:23:17 +0530 X-Google-Sender-Auth: x2PpvRQOL9aoft6bC9NX-WVv9a4 Message-ID: Subject: Re: what cause InvalidCursonPositionException? From: Kiran Ayyagari To: Apache Directory Developers List Content-Type: multipart/alternative; boundary=089e013d06c895e78c04daa71d63 X-Virus-Checked: Checked by ClamAV on apache.org --089e013d06c895e78c04daa71d63 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable based on your code you need to specify the scope to OBJECT level , by default the scope will be set to ONELEVEL On Fri, Apr 19, 2013 at 12:12 AM, Wu, James C. wrote= : > Hi Guys,**** > > ** ** > > I am trying to query an attribute of a DN in my customerized authenticato= r > that overrides the SimpleAuthenticator. The following is the code.**** > > ** ** > > SearchRequest searchRequest =3D new SearchRequestImpl();*= *** > > Dn dn =3D new Dn(maxUidDN);**** > > searchRequest.setBase(dn);**** > > searchRequest.addAttributes("uidNumber");**** > > DirectoryService service =3D getDirectoryService();**** > > CoreSession session =3D service.getAdminSession();**** > > EntryFilteringCursor cursor =3D > session.search(searchRequest);**** > > cursor.beforeFirst();**** > > cursor.next();**** > > Entry entry =3D cursor.get();**** > > ** ** > > The DN is defined as follows:**** > > ** ** > > dn: uid=3DmaxUidNumber,dc=3Dexample,dc=3Dcom**** > > objectClass: top**** > > objectClass: account**** > > objectClass: extensibleObject**** > > uidNumber: 1000**** > > ** ** > > and maxUidDN is set to =93uid=3DmaxUidNumber,dc=3Dexample,dc=3Dcom=94**** > > ** ** > > I keep getting the InvalidCursonPositionException at the last line of the > code. I am wondering why the cursor position can be invalid. Can anyone > give me some clue? Thanks.**** > > ** ** > > James**** > --=20 Kiran Ayyagari http://keydap.com --089e013d06c895e78c04daa71d63 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable
based on your code you need to specify the scope to OBJECT= level , by default the scope will be set to ONELEVEL


On Fri, Apr 19, 2013 at= 12:12 AM, Wu, James C. <James.C.Wu@disney.com> wrote:

Hi Guys,

=A0

I am trying to query an attribute of a DN in my cust= omerized authenticator that overrides the SimpleAuthenticator. =A0The follo= wing is the code.

=A0=

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Search= Request searchRequest =3D new SearchRequestImpl();

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Dn dn =3D new= Dn(maxUidDN);

=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0 searchRequest.setBase(dn);

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 search= Request.addAttributes("uidNumber");

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 DirectoryService s= ervice =3D getDirectoryService();

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 CoreSession session =3D servi= ce.getAdminSession();

=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 EntryFilteringCursor cursor =3D session.s= earch(searchRequest);

=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 cursor.beforeFirst();

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 cursor= .next();

=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 Entry entry =3D cursor.get();

=A0

The DN is defi= ned as follows:

=A0

=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 dn: uid=3DmaxUidNumber,dc=3Dexample= ,dc=3Dcom

=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 objectClass: top

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 objectClass: account

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0 objectClass: extensibleObject

= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uidNumber: 1000=

=A0

and maxUidDN is set to =93uid= =3DmaxUidNumber,dc=3Dexample,dc=3Dcom=94

=A0

I keep getting the Invali= dCursonPositionException at the last line of the code. I am wondering why t= he cursor position can be invalid. Can anyone give me some clue? Thanks.

=A0

James




--
Kiran Ayya= gari
http://keydap.com
--089e013d06c895e78c04daa71d63--