mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noël Rouvignac
26.37.2015 bed9ba6f9dcea95f7df2a3e76669d10e9c9c18e6
OPENDJ-2480 Upgrade fails while migrating JE backend

When opening the JE environment to remove the old indexes,
JE tries to deserialize the comparators embedded in the indexes.
In this particular case, JE cannot find the class org.opends.server.backends.jeb.AttributeIndex$KeyComparator which is used for attribute indexes.
This class has been removed from OpenDJ code with OPENDJ-2337 (Remove old JE local-db backend code).
Note that the same problem can also happen with VLV indexes org.opends.server.backends.jeb.VLVKeyComparator.

The fix is the same as OPENDJ-1637: Ensure that classes exist in the classpath that will allow deserialization of the comparators.

AttributeIndex.java, VLVKeyComparator.java: ADDED to opendj-legacy project
2 files added
92 ■■■■■ changed files
opendj-legacy/src/main/java/org/opends/server/backends/jeb/AttributeIndex.java 50 ●●●●● patch | view | raw | blame | history
opendj-legacy/src/main/java/org/opends/server/backends/jeb/VLVKeyComparator.java 42 ●●●●● patch | view | raw | blame | history
opendj-legacy/src/main/java/org/opends/server/backends/jeb/AttributeIndex.java
New file
@@ -0,0 +1,50 @@
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
 * or http://forgerock.org/license/CDDLv1.0.html.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at legal-notices/CDDLv1_0.txt.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information:
 *      Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 *
 *      Copyright 2015 ForgeRock AS
 */
package org.opends.server.backends.jeb;
import org.opends.legacy.DummyByteArrayComparator;
/**
 * Required by rebuild-index process when upgrading to OpenDJ3.
 *
 * @deprecated since OPENDJ-2337 Remove old JE local-db backend code and JE changelog
 */
@Deprecated
public class AttributeIndex {
    /**
     * Required by rebuild-index process when upgrading to OpenDJ3.
     *
     * @deprecated since OPENDJ-1591 Migrate matching rules
     * @deprecated since OPENDJ-2337 Remove old JE local-db backend code and JE changelog
     */
    @Deprecated
    public static class KeyComparator extends DummyByteArrayComparator {
        @Override
        public int compare(byte[] a, byte[] b) {
            return 0;
        }
    }
}
opendj-legacy/src/main/java/org/opends/server/backends/jeb/VLVKeyComparator.java
New file
@@ -0,0 +1,42 @@
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
 * or http://forgerock.org/license/CDDLv1.0.html.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at legal-notices/CDDLv1_0.txt.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information:
 *      Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 *
 *      Copyright 2015 ForgeRock AS
 */
package org.opends.server.backends.jeb;
import org.opends.legacy.DummyByteArrayComparator;
/**
 * Required by rebuild-index process when upgrading to OpenDJ3.
 *
 * @deprecated since OPENDJ-1591 Migrate matching rules
 * @deprecated since OPENDJ-2337 Remove old JE local-db backend code and JE changelog
 */
@Deprecated
public class VLVKeyComparator extends DummyByteArrayComparator {
    @Override
    public int compare(byte[] b1, byte[] b2) {
        return 0;
    }
}