From users-return-2362-apmail-directory-users-archive=directory.apache.org@directory.apache.org Wed Apr 22 15:00:19 2009 Return-Path: Delivered-To: apmail-directory-users-archive@www.apache.org Received: (qmail 41922 invoked from network); 22 Apr 2009 15:00:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Apr 2009 15:00:18 -0000 Received: (qmail 97810 invoked by uid 500); 22 Apr 2009 15:00:17 -0000 Delivered-To: apmail-directory-users-archive@directory.apache.org Received: (qmail 97744 invoked by uid 500); 22 Apr 2009 15:00:17 -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 97734 invoked by uid 99); 22 Apr 2009 15:00:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Apr 2009 15:00:17 +0000 X-ASF-Spam-Status: No, hits=3.7 required=10.0 tests=HTML_MESSAGE,NORMAL_HTTP_TO_IP,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mcaliskan@gmail.com designates 209.85.217.158 as permitted sender) Received: from [209.85.217.158] (HELO mail-gx0-f158.google.com) (209.85.217.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Apr 2009 15:00:10 +0000 Received: by gxk2 with SMTP id 2so20851gxk.1 for ; Wed, 22 Apr 2009 07:59:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=B9FB14hsutqrp/S3UEY4lEAOIAwJpX9OuaOxzc6sHJE=; b=tc/PmDcJn9iqePK0upkXDbUmwqLSMqPhWlv/5NBYKAsJUjmwJVSdsDkxDhjsTy6tby uEvKmaYCR4piUraA95m3Kjdc6wcKHPSF7mTXMjJ3rInKyBmifSy7vDM8A+q+DcKWg2jU bwU6BRKrEguYJHvQOU1f84gwHH1nBzSjPqAzQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=tidJyCmXrAkeWi4BN1ofqCSr9j2wqfGUL0Ijmv6dFwP85fZXisbylrdlpCXiU1J3hK 0N1U4M6BKSsXhuCOndqHmeQ0ORcH4YaAhvhnZYJ7oGJg2almbPtf+sqruMDAXjx/WX3W fIQnE6yWn4583uy93dFKxcDT5dEHBcWhM2Djw= MIME-Version: 1.0 Received: by 10.151.43.19 with SMTP id v19mr5643576ybj.28.1240412389892; Wed, 22 Apr 2009 07:59:49 -0700 (PDT) In-Reply-To: <49EF2408.3060204@gameaccount.com> References: <49EF13CA.7070604@gameaccount.com> <49EF19D8.9000602@gameaccount.com> <49EF2408.3060204@gameaccount.com> Date: Wed, 22 Apr 2009 17:59:49 +0300 Message-ID: Subject: Re: classcast on ApacheDS From: =?ISO-8859-9?Q?Mert_=C7al=FD=FEkan?= To: users@directory.apache.org Content-Type: multipart/alternative; boundary=00151750d9b8dfe2ce046826037a X-Virus-Checked: Checked by ClamAV on apache.org --00151750d9b8dfe2ce046826037a Content-Type: text/plain; charset=ISO-8859-9 Content-Transfer-Encoding: quoted-printable 1.5.5? latest downloads are only for 1.5.4, no? http://directory.apache.org/apacheds/1.5/downloads.html 2009/4/22 Yiannis Mavroukakis > Have you tried this with 1.5.5 ? > > > Mert =C7al=FD=FEkan wrote: > >> yes, when that method executes, my ApacheDS server (standalone working >> one) >> throws that error. >> >> >> 2009/4/22 Yiannis Mavroukakis >> >> >> >>> Are you getting the same ClassCastException as the root cause of the >>> search? >>> >>> >>> Mert =C7al=FD=FEkan wrote: >>> >>> >>> >>>> Hey, >>>> >>>> via jdni calls I guess, seam's ldap-identity-store is taking care of..= . >>>> lemme elaborate the case, >>>> >>>> Actually before creating a user, the seam framework is doing a search >>>> with >>>> userExists method. >>>> >>>> public boolean userExists(String name) >>>> { >>>> InitialLdapContext ctx =3D null; >>>> try >>>> { >>>> ctx =3D initialiseContext(); >>>> >>>> String[] userAttr =3D {getUserNameAttribute()}; >>>> >>>> SearchControls controls =3D new SearchControls(); >>>> controls.setSearchScope(searchScope); >>>> controls.setReturningAttributes(userAttr); >>>> controls.setTimeLimit(getSearchTimeLimit()); >>>> >>>> StringBuilder userFilter =3D new StringBuilder(); >>>> >>>> Object[] filterArgs =3D new Object[getUserObjectClasses().lengt= h]; >>>> for (int i =3D 0; i < getUserObjectClasses().length; i++) >>>> { >>>> userFilter.append("("); >>>> userFilter.append(getObjectClassAttribute()); >>>> userFilter.append("=3D{"); >>>> userFilter.append(i); >>>> userFilter.append("})"); >>>> filterArgs[i] =3D getUserObjectClasses()[i]; >>>> } >>>> >>>> NamingEnumeration answer =3D ctx.search(getUserContextDN(), >>>> userFilter.toString(), filterArgs, controls); >>>> while (answer.hasMore()) >>>> { >>>> SearchResult sr =3D (SearchResult) answer.next(); >>>> Attributes attrs =3D sr.getAttributes(); >>>> Attribute user =3D attrs.get(getUserNameAttribute()); >>>> >>>> for (int i =3D 0; i < user.size(); i++) >>>> { >>>> Object value =3D user.get(i); >>>> if (name.equals(value)) >>>> { >>>> answer.close(); >>>> return true; >>>> } >>>> } >>>> } >>>> answer.close(); >>>> return false; >>>> } >>>> catch (NamingException ex) >>>> { >>>> throw new IdentityManagementException("Error getting users", ex= ); >>>> } >>>> finally >>>> { >>>> if (ctx !=3D null) >>>> { >>>> try >>>> { >>>> ctx.close(); >>>> } >>>> catch (NamingException ex) {} >>>> } >>>> } >>>> } >>>> >>>> and this is throwing out, >>>> >>>> Caused by: >>>> org.jboss.seam.security.management.IdentityManagementException: >>>> Error getting users >>>> at >>>> >>>> >>>> org.jboss.seam.security.management.LdapIdentityStore.userExists(LdapId= entityStore.java:1235) >>>> at >>>> >>>> >>>> org.jboss.seam.security.management.IdentityManager.userExists(Identity= Manager.java:172) >>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>> at >>>> >>>> >>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j= ava:39) >>>> at >>>> >>>> >>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess= orImpl.java:25) >>>> at java.lang.reflect.Method.invoke(Method.java:597) >>>> at >>>> org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335) >>>> ... 79 more >>>> Caused by: javax.naming.CommunicationException: Request: 2 cancelled; >>>> remaining name 'ou=3Dpeople,o=3Dmycompany' >>>> at com.sun.jndi.ldap.LdapRequest.getReplyBer(LdapRequest.java:60) >>>> at com.sun.jndi.ldap.Connection.readReply(Connection.java:411) >>>> >>>> M >>>> >>>> >>>> On Wed, Apr 22, 2009 at 3:55 PM, Yiannis Mavroukakis < >>>> imavroukakis@gameaccount.com> wrote: >>>> >>>> >>>> >>>> >>>> >>>>> How are you creating this new person? Via JNDI calls or through the D= S >>>>> API? >>>>> >>>>> Y. >>>>> >>>>> >>>>> Mert =C7al=FD=FEkan wrote: >>>>> >>>>> >>>>> >>>>> >>>>> >>>>>> Hi, >>>>>> >>>>>> I'm integrating the seam framework's user management module with >>>>>> ApacheDS >>>>>> ldap. For creating a new user (person objectClass) in the DS I got t= he >>>>>> error >>>>>> below, >>>>>> So apacheDS is forcing the client to close the conn since it gets a >>>>>> classcast. I'm on 1.5.4 version. How to debug & solve this? Any clue= s? >>>>>> >>>>>> Thanks, >>>>>> >>>>>> M >>>>>> >>>>>> Trace: >>>>>> >>>>>> [15:39:46] WARN [org.apache.directory.server.ldap.LdapProtocolHandle= r] >>>>>> - >>>>>> [/ >>>>>> 127.0.0.1:2453] Unexpected exception forcing >>>>>> session to close: sending disconnect notice to client. >>>>>> *org.apache.mina.filter.codec.ProtocolDecoderException: >>>>>> java.lang.ClassCastException: org.apache.directory.shared.ldap.co >>>>>> dec.search.AttributeValueAssertionFilter cannot be cast to >>>>>> org.apache.directory.shared.ldap.codec.search.ConnectorFilter* >>>>>> (Hexdump: 30 81 82 02 01 02 63 60 04 17 6F 75 3D 70 65 6F 70 6C 65 2= C >>>>>> 6F >>>>>> 3D >>>>>> 6F 6E 74 6F 6D 65 74 72 69 63 73 0A 01 02 0 >>>>>> A 01 03 02 01 00 02 01 0B 01 01 00 A3 15 04 0B 6F 62 6A 65 63 74 43 = 6C >>>>>> 61 >>>>>> 73 >>>>>> 73 04 06 70 65 72 73 6F 6E A3 18 04 0B 6F 6 >>>>>> 2 6A 65 63 74 43 6C 61 73 73 04 09 75 69 64 4F 62 6A 65 63 74 30 05 = 04 >>>>>> 03 >>>>>> 75 >>>>>> 69 64 A0 1B 30 19 04 17 32 2E 31 36 2E 38 3 >>>>>> 4 30 2E 31 2E 31 31 33 37 33 30 2E 33 2E 34 2E 32) >>>>>> at >>>>>> >>>>>> >>>>>> >>>>>> org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(Pro= tocolCodecFilter.java:165) >>>>>> at >>>>>> >>>>>> >>>>>> >>>>>> org.apache.mina.common.support.AbstractIoFilterChain.callNextMessage= Received(AbstractIoFilterChain.java:299) >>>>>> at >>>>>> >>>>>> >>>>>> >>>>>> org.apache.mina.common.support.AbstractIoFilterChain.access$1100(Abs= tractIoFilterChain.java:53) >>>>>> at >>>>>> >>>>>> >>>>>> >>>>>> org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.mes= sageReceived(AbstractIoFilterChain.java:6 >>>>>> 48) >>>>>> at >>>>>> >>>>>> >>>>>> >>>>>> org.apache.mina.filter.executor.ExecutorFilter.processEvent(Executor= Filter.java:220) >>>>>> at >>>>>> >>>>>> >>>>>> >>>>>> org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable= .run(ExecutorFilter.java:264) >>>>>> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknow= n >>>>>> Source) >>>>>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown >>>>>> Source) >>>>>> at java.lang.Thread.run(Unknown Source) >>>>>> Caused by: java.lang.ClassCastException: >>>>>> >>>>>> >>>>>> >>>>>> org.apache.directory.shared.ldap.codec.search.AttributeValueAssertio= nFilter >>>>>> can >>>>>> not be cast to >>>>>> org.apache.directory.shared.ldap.codec.search.ConnectorFilter >>>>>> at >>>>>> >>>>>> >>>>>> >>>>>> org.apache.directory.shared.ldap.codec.search.SearchRequest.addCurre= ntFilter(SearchRequest.java:356) >>>>>> at >>>>>> >>>>>> >>>>>> >>>>>> org.apache.directory.shared.ldap.codec.actions.InitEqualityMatchFilt= erAction.action(InitEqualityMatchFilterAc >>>>>> tion.java:70) >>>>>> at >>>>>> >>>>>> >>>>>> >>>>>> org.apache.directory.shared.asn1.ber.grammar.AbstractGrammar.execute= Action(AbstractGrammar.java:153) >>>>>> at >>>>>> >>>>>> >>>>>> >>>>>> org.apache.directory.shared.asn1.ber.Asn1Decoder.treatTLVDoneState(A= sn1Decoder.java:620) >>>>>> at >>>>>> >>>>>> >>>>>> >>>>>> org.apache.directory.shared.asn1.ber.Asn1Decoder.decode(Asn1Decoder.= java:796) >>>>>> at >>>>>> >>>>>> >>>>>> >>>>>> org.apache.directory.shared.ldap.codec.TwixDecoder.decode(TwixDecode= r.java:110) >>>>>> at >>>>>> >>>>>> >>>>>> >>>>>> org.apache.directory.shared.ldap.message.MessageDecoder.decode(Messa= geDecoder.java:150) >>>>>> at >>>>>> >>>>>> >>>>>> >>>>>> org.apache.directory.shared.asn1.codec.Asn1CodecDecoder.decode(Asn1C= odecDecoder.java:53) >>>>>> at >>>>>> >>>>>> >>>>>> >>>>>> org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(Pro= tocolCodecFilter.java:158) >>>>>> ... 8 more >>>>>> [15:39:46] WARN [org.apache.directory.server.ldap.LdapProtocolHandle= r] >>>>>> - >>>>>> Null LdapSession given to cleanUpSession. >>>>>> [15:39:46] WARN [org.apache.directory.server.ldap.LdapProtocolHandle= r] >>>>>> - >>>>>> Null LdapSession given to cleanUpSession. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>> >>> >> >> > --00151750d9b8dfe2ce046826037a--