Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 2318 invoked from network); 23 Oct 2005 17:15:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Oct 2005 17:15:26 -0000 Received: (qmail 6081 invoked by uid 500); 23 Oct 2005 17:15:25 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 6039 invoked by uid 500); 23 Oct 2005 17:15:25 -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 6028 invoked by uid 99); 23 Oct 2005 17:15:25 -0000 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=SPF_FAIL X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 23 Oct 2005 10:15:24 -0700 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id A4B1C222 for ; Sun, 23 Oct 2005 19:15:03 +0200 (CEST) Message-ID: <30747244.1130087703672.JavaMail.jira@ajax.apache.org> Date: Sun, 23 Oct 2005 19:15:03 +0200 (CEST) From: "Enrique Rodriguez (JIRA)" To: dev@directory.apache.org Subject: [jira] Commented: (DIREVE-282) Attribute names with periods cannot be used in a search filter. In-Reply-To: <758891638.1130048285765.JavaMail.jira@ajax.apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DIREVE-282?page=comments#action_12332900 ] Enrique Rodriguez commented on DIREVE-282: ------------------------------------------ I'm fine not using periods as X.500 and Java convention are to use "camel notation." Perhaps the fix is to make the exception more friendly by pointing out the Attribute Type rule. The low-level antlr exception should be converted to a higher-level NamingException, anyway. > Attribute names with periods cannot be used in a search filter. > --------------------------------------------------------------- > > Key: DIREVE-282 > URL: http://issues.apache.org/jira/browse/DIREVE-282 > Project: Directory Server > Type: Bug > Components: jndi-provider > Reporter: Enrique Rodriguez > Assignee: Alex Karasulu > > The following filter fails in a DirContext.search(), but it works fine in the JDK (test cases are below): > String filter = "(service.Pid=org.apache.dns.factory)"; > javax.naming.directory.InvalidSearchFilterException: Encountered parse exception while parsing the filter: '(service.Pid=org.apache.dns.factory)' [Root exception is java.text.ParseException: Parser failure on filter: > (service.Pid=org.apache.dns.factory) > Antlr exception trace: > unexpected char: '.'] > at org.apache.ldap.server.jndi.ServerDirContext.search(ServerDirContext.java:598) > at org.apache.ldap.server.jndi.ServerDirContext.search(ServerDirContext.java:559) > ... > Caused by: java.text.ParseException: Parser failure on filter: > (service.Pid=org.apache.dns.factory) > Antlr exception trace: > unexpected char: '.' > at org.apache.ldap.common.filter.FilterParserImpl.parse(FilterParserImpl.java:128) > at org.apache.ldap.server.jndi.ServerDirContext.search(ServerDirContext.java:594) > ... 17 more > // works fine > public void testLdapNameJdk() throws Exception > { > new javax.naming.ldap.LdapName( "asdf.asdf=asdf" ); > } > // Parser failure on name: asdf.asdf=asdf > public void testLdapNameApacheDs() throws Exception > { > new org.apache.ldap.common.name.LdapName( "asdf.asdf=asdf" ); > } > org.apache.ldap.common.exception.LdapInvalidNameException: Parser failure on name: > asdf.asdf=asdf > Antlr exception trace: > line 1:5: unexpected char: '.' > at org.apache.ldap.common.name.antlrTypeLexer.nextToken(antlrTypeLexer.java:154) > at antlr.TokenStreamSelector.nextToken(TokenStreamSelector.java:64) > at antlr.TokenBuffer.fill(TokenBuffer.java:69) > at antlr.TokenBuffer.LA(TokenBuffer.java:80) > at antlr.LLkParser.LA(LLkParser.java:52) > at antlr.Parser.match(Parser.java:212) > at org.apache.ldap.common.name.antlrNameParser.attributeTypeAndValue(antlrNameParser.java:185) > at org.apache.ldap.common.name.antlrNameParser.nameComponent(antlrNameParser.java:120) > at org.apache.ldap.common.name.antlrNameParser.name(antlrNameParser.java:69) > at org.apache.ldap.common.name.DnParser.parse(DnParser.java:187) > at org.apache.ldap.common.name.LdapName.(LdapName.java:93) > ... -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira