Return-Path: X-Original-To: apmail-directory-api-archive@minotaur.apache.org Delivered-To: apmail-directory-api-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6182D107B8 for ; Wed, 4 Dec 2013 16:47:03 +0000 (UTC) Received: (qmail 80378 invoked by uid 500); 4 Dec 2013 16:47:02 -0000 Delivered-To: apmail-directory-api-archive@directory.apache.org Received: (qmail 79900 invoked by uid 500); 4 Dec 2013 16:47:01 -0000 Mailing-List: contact api-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: api@directory.apache.org Delivered-To: mailing list api@directory.apache.org Received: (qmail 79885 invoked by uid 99); 4 Dec 2013 16:47:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Dec 2013 16:47:00 +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 stmura@gmail.com designates 209.85.220.180 as permitted sender) Received: from [209.85.220.180] (HELO mail-vc0-f180.google.com) (209.85.220.180) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Dec 2013 16:46:54 +0000 Received: by mail-vc0-f180.google.com with SMTP id if17so11860801vcb.11 for ; Wed, 04 Dec 2013 08:46:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=pUPoIb6F+XFMBKDvZtfTw4PDAuJ3WYCuZB5tFzitPCA=; b=gdM4JFu6BcXCF4RLZGWqhk6s5nSBrWuuiwAg25UBiudcPZiHvT8TGnKdIwO46NKZIZ M3utvlZYLZeeuQtsS/C+BrVI8A+ou1wR7/Fnl1RK/XFczKLsAnQSsl+qCVxYu+ewt5DF P5KJxQ7PHGPW+Gr+hyn/ECcg1qhGgM369zvqwMORacD+CdPZe9fc8kAmikDNfraYJmE0 t9w96XLpx/0/XFuMrAlZFPUFQ8NmgHLzZrUd51Bh/tHKYCIGFdTUg7Z6oHbvAjaSPcfe qfPOoTXZAETiCnCkbrGEi6VwnwpURumK3Q/pqa6F2H01EjRm8Int3Wzrfigfr1yYbMHM 50KQ== MIME-Version: 1.0 X-Received: by 10.58.11.73 with SMTP id o9mr59709565veb.8.1386175593721; Wed, 04 Dec 2013 08:46:33 -0800 (PST) Received: by 10.58.40.66 with HTTP; Wed, 4 Dec 2013 08:46:33 -0800 (PST) In-Reply-To: References: Date: Wed, 4 Dec 2013 17:46:33 +0100 Message-ID: Subject: Re: ClassCast Exception with Paging From: Stefan Murawski To: api@directory.apache.org Content-Type: multipart/alternative; boundary=047d7b2ed341dc621504ecb827e2 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b2ed341dc621504ecb827e2 Content-Type: text/plain; charset=ISO-8859-1 Thanks! This helped. And also removing the line pagedSearchControl.setCookie("test".getBytes("UTF-8")); which broke the process. 2013/12/4 Daniel Fisher > On Wed, Dec 4, 2013 at 7:06 AM, Stefan Murawski wrote: > > Unfortunately I get the following ClassCast-Exception, and don't know how > > to proceed further. > > > > java.lang.ClassCastException: > > org.apache.directory.api.ldap.codec.BasicControlDecorator cannot be cast > to > > org.apache.directory.api.ldap.model.message.controls.PagedResults > > > > for: > > > > pagedSearchControl = (PagedResults) result > > .getControl(PagedResults.OID); > > > > Try adding: System.setProperty(StandaloneLdapApiService.CONTROLS_LIST, > PagedResultsFactory.class.getName()); > at the top of your code. > I recall seeing CastClassExceptions if the ApiService doesn't know > about the control. > > --Daniel Fisher > --047d7b2ed341dc621504ecb827e2--