From commits-return-34563-apmail-directory-commits-archive=directory.apache.org@directory.apache.org Wed Oct 3 03:11:12 2012 Return-Path: X-Original-To: apmail-directory-commits-archive@www.apache.org Delivered-To: apmail-directory-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AA476913A for ; Wed, 3 Oct 2012 03:11:12 +0000 (UTC) Received: (qmail 37223 invoked by uid 500); 3 Oct 2012 03:11:12 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 37144 invoked by uid 500); 3 Oct 2012 03:11:11 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 37125 invoked by uid 99); 3 Oct 2012 03:11:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Oct 2012 03:11:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Oct 2012 03:11:09 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 9FE4B23889E1 for ; Wed, 3 Oct 2012 03:10:26 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1393269 - /directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java Date: Wed, 03 Oct 2012 03:10:26 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121003031026.9FE4B23889E1@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: elecharny Date: Wed Oct 3 03:10:26 2012 New Revision: 1393269 URL: http://svn.apache.org/viewvc?rev=1393269&view=rev Log: Modified the Index addition so that if the indexed Attribute does not exists in the Schema, it does not forbid the server to start. Now, we get an error, but the server can be launched. (of course, no index is created) Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java?rev=1393269&r1=1393268&r2=1393269&view=diff ============================================================================== --- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java (original) +++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java Wed Oct 3 03:10:26 2012 @@ -73,6 +73,7 @@ import org.apache.directory.shared.ldap. import org.apache.directory.shared.ldap.model.exception.LdapContextNotEmptyException; import org.apache.directory.shared.ldap.model.exception.LdapEntryAlreadyExistsException; import org.apache.directory.shared.ldap.model.exception.LdapException; +import org.apache.directory.shared.ldap.model.exception.LdapNoSuchAttributeException; import org.apache.directory.shared.ldap.model.exception.LdapNoSuchObjectException; import org.apache.directory.shared.ldap.model.exception.LdapOperationErrorException; import org.apache.directory.shared.ldap.model.exception.LdapSchemaViolationException; @@ -2281,11 +2282,18 @@ public abstract class AbstractBTreeParti checkInitialized( "addIndex" ); // Check that the index String is valid - AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( index.getAttributeId() ); + AttributeType attributeType = null; - if ( attributeType == null ) + try + { + attributeType = schemaManager.lookupAttributeTypeRegistry( index.getAttributeId() ); + } + catch ( LdapNoSuchAttributeException lnsae ) { - throw new IllegalArgumentException( I18n.err( I18n.ERR_309, index.getAttributeId() ) ); + LOG.error( "Cannot initialize the index for AttributeType {}, this value does not exist", + index.getAttributeId() ); + + return; } String oid = attributeType.getOid();