Return-Path: Delivered-To: apmail-directory-users-archive@www.apache.org Received: (qmail 33591 invoked from network); 22 Feb 2011 19:27:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Feb 2011 19:27:19 -0000 Received: (qmail 40349 invoked by uid 500); 22 Feb 2011 19:27:18 -0000 Delivered-To: apmail-directory-users-archive@directory.apache.org Received: (qmail 40245 invoked by uid 500); 22 Feb 2011 19:27: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 40237 invoked by uid 99); 22 Feb 2011 19:27:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Feb 2011 19:27:17 +0000 X-ASF-Spam-Status: No, hits=3.1 required=5.0 tests=HTML_MESSAGE,MAY_BE_FORGED,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [62.161.7.4] (HELO smtp-out06.msg.oleane.net) (62.161.7.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Feb 2011 19:27:09 +0000 Received: from smtp04.msg.oleane.net (smtp04.mail.priv [172.17.20.113]) by smtp-out06.msg.oleane.net with ESMTP id p1MFr675026897 for ; Tue, 22 Feb 2011 16:53:06 +0100 Received: from smtp04.msg.oleane.net (localhost [127.0.0.1]) by smtp04.msg.oleane.net (MTA-AV) with ESMTP id p1MFr5on014980 for ; Tue, 22 Feb 2011 16:53:05 +0100 Received: from srv-mes-01.bf_bfm.giems.fr (Microservice.rain.fr [194.250.68.154] (may be forged)) by smtp04.msg.oleane.net (MTA) with ESMTP id p1MFqvQr013772 for ; Tue, 22 Feb 2011 16:53:02 +0100 X-Oleane-Rep: REPA Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CBD2A8.946794EC" X-MimeOLE: Produced By Microsoft Exchange V6.5 Subject: Querying Apache DS via .NET C# DirectorySearcher Date: Tue, 22 Feb 2011 16:52:59 +0100 Message-ID: <430DFBEF10F86D45842B2C6C080AF1C706037778@srv-mes-01.bf_bfm.giems.fr> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Querying Apache DS via .NET C# DirectorySearcher Thread-Index: AcvSpnMIOguq50FlR/GdaAtlBk0UZA== From: "Laporte Sylvain (GIE)" To: X-PMX-Spam: Probability=8% X-PFSI-Info: PMX 5.5.9.395186, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.2.22.153916 (no virus found) X-Old-Spam-Flag: NO ------_=_NextPart_001_01CBD2A8.946794EC Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi all, =20 We've just implemented Apache Directory Server on one of our Windows 2008 Servers. Some of our developpers have to create a C# web service that query this new ApacheDS directory using the DirectorySearcher class. =20 When he comes to query the LDAP directory, he gets a strange message on his side: < A network peripheral is not functionning > Switching the logs to DEBUG, I can see that the bind performs well, but the search throws a java exception when ADS is handling the request :=20 =20 [15:55:49] DEBUG [org.apache.directory.server.ldap.handlers.ReferralAwareRequestHandler] - OTHER: failed for SearchRequest baseDn : '' filter : '(2.5.4.0=3D*:[3232])' scope : whole subtree typesOnly : false Size Limit : 1 Time Limit : no limit Deref Aliases : never Deref Aliases attributes : 'objectclass', 'cn' : -1 java.lang.ArrayIndexOutOfBoundsException: -1 =20 ADS adds a < : -1 > at the end of the request although the original search request seems to be well received :=20 =20 [15:55:49] DEBUG [org.apache.directory.server.ldap.handlers.ReferralAwareRequestHandler] - Handling single reply request: SearchRequest baseDn : '' filter : '(objectClass=3D*)' scope : whole subtree typesOnly : false Size Limit : 1 Time Limit : no limit Deref Aliases : never Deref Aliases attributes : 'objectclass', 'cn' =20 The transaction is although very simple :=20 =20 //Declares the Directory entry object DirectoryEntry Ldap =3D new DirectoryEntry(_ldapserver, _bindDN, _password, AuthenticationTypes.None); try { //Declares the search object DirectorySearcher search =3D new DirectorySearcher(Ldap); // Adds a filter search.Filter =3D "(objectClass=3D*)"; // version APACHE //Defines the attributes to retrieve =20 search.PropertiesToLoad.Add("objectClass"); search.PropertiesToLoad.Add("cn"); //Performs the search SearchResult result =3D search.FindOne(); } =20 Can anybody help? I cannot understand where does this ": -1" come from as it doesn't appear using Apache Directory Studio. =20 If useful the full query log is following... =20 Thank you very much, =20 S. Laporte ------------------------------- =20 =20 [15:40:39] DEBUG [org.apache.directory.server.ldap.handlers.ReferralAwareRequestHandler] - Handling single reply request: SearchRequest baseDn : 'cn=3DmyBindUser,ou=3DmyBindOU,ou=3DanotherOU,dc=3DmyDomain,dc=3DmyTLD' filter : '(objectClass=3D*)' scope : single level typesOnly : false Size Limit : 1000 Time Limit : no limit Deref Aliases : deref Always attributes : 'hassubordinates', 'objectclass' =20 [15:40:39] DEBUG [org.apache.directory.server.ldap.handlers.ReferralAwareRequestHandler] - ManageDsaITControl NOT detected. [15:40:39] DEBUG [org.apache.directory.server.ldap.handlers.SearchHandler] - Entry cn=3DmyBindUser,ou=3DmyBindOU,ou=3DanotherOU,dc=3DmyDomain,dc=3DmyTLD is = NOT a referral. [15:40:39] DEBUG [org.apache.directory.server.ldap.handlers.SearchHandler] - Message received: SearchRequest baseDn : 'cn=3DmyBindUser,ou=3DmyBindOU,ou=3DanotherOU,dc=3DmyDomain,dc=3DmyTLD' filter : '(objectClass=3D*)' scope : single level typesOnly : false Size Limit : 1000 Time Limit : no limit Deref Aliases : deref Always attributes : 'hassubordinates', 'objectclass' =20 [15:40:39] DEBUG [org.apache.directory.server.ldap.handlers.SearchHandler] - using <1000,1000> for size limit [15:55:49] DEBUG [org.apache.directory.server.ldap.handlers.BindHandler] - Received: BindRequest Version : '3' Name : 'cn=3DmyBindUser,ou=3DmyBindOU,ou=3DanotherOU,dc=3DmyDomain,dc=3DmyTLD' Simple authentication : 'password/0x3F 0x41 0x66 0x73 0x4B 0x3C 0x3D 0x6A ' =20 [15:55:49] DEBUG [org.apache.directory.server.ldap.handlers.BindHandler] - Returned SUCCESS message: BindResponse Ldap Result Result code : (SUCCESS) success Matched DN : 'null' Error message : 'null' . [15:55:49] DEBUG [org.apache.directory.server.ldap.handlers.ReferralAwareRequestHandler] - Handling single reply request: SearchRequest baseDn : '' filter : '(objectClass=3D*)' scope : base object typesOnly : false Size Limit : no limit Time Limit : no limit Deref Aliases : never Deref Aliases attributes : 'subschemasubentry', 'dsservicename', 'namingcontexts', 'defaultnamingcontext', 'schemanamingcontext', 'configurationnamingcontext', 'rootdomainnamingcontext', 'supportedcontrol', 'supportedldapversion', 'supportedldappolicies', 'supportedsaslmechanisms', 'dnshostname', 'ldapservicename', 'servername', 'supportedcapabilities' =20 [15:55:49] DEBUG [org.apache.directory.server.ldap.handlers.ReferralAwareRequestHandler] - ManageDsaITControl NOT detected. [15:55:49] DEBUG [org.apache.directory.server.ldap.handlers.SearchHandler] - Entry is NOT a referral. [15:55:49] DEBUG [org.apache.directory.server.ldap.handlers.SearchHandler] - Message received: SearchRequest baseDn : '' filter : '(objectClass=3D*)' scope : base object typesOnly : false Size Limit : no limit Time Limit : no limit Deref Aliases : never Deref Aliases attributes : 'subschemasubentry', 'dsservicename', 'namingcontexts', 'defaultnamingcontext', 'schemanamingcontext', 'configurationnamingcontext', 'rootdomainnamingcontext', 'supportedcontrol', 'supportedldapversion', 'supportedldappolicies', 'supportedsaslmechanisms', 'dnshostname', 'ldapservicename', 'servername', 'supportedcapabilities' =20 [15:55:49] WARN [org.apache.directory.server.core.interceptor.context.SearchingOperation Context] - Requested attribute dsservicename does not exist in the schema, it will be ignored [15:55:49] WARN [org.apache.directory.server.core.interceptor.context.SearchingOperation Context] - Requested attribute defaultnamingcontext does not exist in the schema, it will be ignored [15:55:49] WARN [org.apache.directory.server.core.interceptor.context.SearchingOperation Context] - Requested attribute schemanamingcontext does not exist in the schema, it will be ignored [15:55:49] WARN [org.apache.directory.server.core.interceptor.context.SearchingOperation Context] - Requested attribute configurationnamingcontext does not exist in the schema, it will be ignored [15:55:49] WARN [org.apache.directory.server.core.interceptor.context.SearchingOperation Context] - Requested attribute rootdomainnamingcontext does not exist in the schema, it will be ignored [15:55:49] WARN [org.apache.directory.server.core.interceptor.context.SearchingOperation Context] - Requested attribute supportedldappolicies does not exist in the schema, it will be ignored [15:55:49] WARN [org.apache.directory.server.core.interceptor.context.SearchingOperation Context] - Requested attribute dnshostname does not exist in the schema, it will be ignored [15:55:49] WARN [org.apache.directory.server.core.interceptor.context.SearchingOperation Context] - Requested attribute ldapservicename does not exist in the schema, it will be ignored [15:55:49] WARN [org.apache.directory.server.core.interceptor.context.SearchingOperation Context] - Requested attribute servername does not exist in the schema, it will be ignored [15:55:49] WARN [org.apache.directory.server.core.interceptor.context.SearchingOperation Context] - Requested attribute supportedcapabilities does not exist in the schema, it will be ignored [15:55:49] DEBUG [org.apache.directory.server.ldap.handlers.ReferralAwareRequestHandler] - Handling single reply request: SearchRequest baseDn : '' filter : '(objectClass=3D*)' scope : whole subtree typesOnly : false Size Limit : 1 Time Limit : no limit Deref Aliases : never Deref Aliases attributes : 'objectclass', 'cn' =20 [15:55:49] DEBUG [org.apache.directory.server.ldap.handlers.ReferralAwareRequestHandler] - ManageDsaITControl NOT detected. [15:55:49] DEBUG [org.apache.directory.server.ldap.handlers.SearchHandler] - Entry is NOT a referral. [15:55:49] DEBUG [org.apache.directory.server.ldap.handlers.SearchHandler] - Message received: SearchRequest baseDn : '' filter : '(objectClass=3D*)' scope : whole subtree typesOnly : false Size Limit : 1 Time Limit : no limit Deref Aliases : never Deref Aliases attributes : 'objectclass', 'cn' =20 [15:55:49] DEBUG [org.apache.directory.server.ldap.handlers.ReferralAwareRequestHandler] - OTHER: failed for SearchRequest baseDn : '' filter : '(2.5.4.0=3D*:[3232])' scope : whole subtree typesOnly : false Size Limit : 1 Time Limit : no limit Deref Aliases : never Deref Aliases attributes : 'objectclass', 'cn' : -1 java.lang.ArrayIndexOutOfBoundsException: -1 at java.util.ArrayList.get(Unknown Source) at org.apache.directory.server.core.filtering.CursorList.beforeFirst(Cursor List.java:170) at org.apache.directory.server.ldap.handlers.SearchHandler.doSimpleSearch(S earchHandler.java:729) at org.apache.directory.server.ldap.handlers.SearchHandler.handleIgnoringRe ferrals(SearchHandler.java:978) at org.apache.directory.server.ldap.handlers.SearchHandler.handleWithReferr als(SearchHandler.java:1054) at org.apache.directory.server.ldap.handlers.SearchHandler.handleWithReferr als(SearchHandler.java:78) at org.apache.directory.server.ldap.handlers.ReferralAwareRequestHandler.ha ndle(ReferralAwareRequestHandler.java:94) at org.apache.directory.server.ldap.handlers.ReferralAwareRequestHandler.ha ndle(ReferralAwareRequestHandler.java:57) at org.apache.directory.server.ldap.handlers.LdapRequestHandler.handleMessa ge(LdapRequestHandler.java:208) at org.apache.directory.server.ldap.handlers.LdapRequestHandler.handleMessa ge(LdapRequestHandler.java:58) at org.apache.mina.handler.demux.DemuxingIoHandler.messageReceived(Demuxing IoHandler.java:232) at org.apache.directory.server.ldap.LdapProtocolHandler.messageReceived(Lda pProtocolHandler.java:193) at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.message Received(DefaultIoFilterChain.java:713) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageRec eived(DefaultIoFilterChain.java:434) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(Defaul tIoFilterChain.java:46) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messag eReceived(DefaultIoFilterChain.java:793) at org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:7 1) at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63) at org.apache.mina.filter.executor.UnorderedThreadPoolExecutor$Worker.runTa sk(UnorderedThreadPoolExecutor.java:480) at org.apache.mina.filter.executor.UnorderedThreadPoolExecutor$Worker.run(U norderedThreadPoolExecutor.java:434) at java.lang.Thread.run(Unknown Source) [15:55:49] DEBUG [org.apache.directory.server.ldap.LdapProtocolHandler] - Cleaning the LdapSession : <2.5.4.3=3Dmybinduser,2.5.4.11=3Dmybinfou,2.5.4.11=3Danotherou,0.9.2342.1= 92003 00.100.1.25=3Dmydomain,0.9.2342.19200300.100.1.25=3Dmytld,...> session [15:55:49] INFO [org.apache.directory.server.ldap.handlers.LdapRequestHandler] - ignoring the message org.apache.directory.shared.ldap.message.UnbindRequestImpl@374e67ab received from null session ------_=_NextPart_001_01CBD2A8.946794EC--