Skip to content

Commit a7dc809

Browse files
authored
[#746] remove stale opendj-server-legacy jar during upgrade (#751)
1 parent 29445ad commit a7dc809

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

  • opendj-doc-generated-ref/src/main/asciidoc/install-guide
  • opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade

opendj-doc-generated-ref/src/main/asciidoc/install-guide/chap-upgrade.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,13 @@ The following steps describe how to upgrade OpenDJ directory server installed fr
108108
. (Optional) If you have not already backed up the current OpenDJ server, make a back up copy of the directory where OpenDJ is installed.
109109
110110
. Unpack the new files from the .zip delivery over the current server files.
111+
+
112+
[NOTE]
113+
======
114+
When upgrading from a release before 5.1.2, first delete the stale `lib/org.openidentityplatform.opendj.opendj-server-legacy.jar` file (or clean out the `lib/` directory) before unpacking the new `.zip`.
115+
116+
That file is a duplicate library that shipped in older distributions and is no longer part of the delivery, so unpacking the new archive over the existing installation neither overwrites nor removes it. Because the server builds its classpath from `lib/*`, the leftover jar makes the runtime report the old binary version, and the server fails to start after the upgrade with an error such as `The OpenDJ binary version '5.1.1...' does not match the installed version '5.1.2...'. Please run upgrade before continuing`.
117+
======
111118
112119
. Run the `upgrade` command, described in xref:../reference/admin-tools-ref.adoc#upgrade-1[upgrade(1)] in the __Reference__, to bring OpenDJ configuration and application data up to date with the new binary and script files that you copied over the current server files.
113120
+

opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/Upgrade.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* information: "Portions Copyright [year] [name of copyright owner]".
1313
*
1414
* Portions Copyright 2013-2016 ForgeRock AS.
15+
* Portions Copyrighted 2026 3A Systems, LLC.
1516
*/
1617
package org.opends.server.tools.upgrade;
1718

@@ -609,6 +610,17 @@ public String toString() {
609610
register("4.0.0", moveSubordinateBaseDnToGlobalConfiguration());
610611
register("4.0.0", removeTools("ldif-diff", "make-ldif", "dsjavaproperties"));
611612

613+
/*
614+
* See issue #746. Builds before #661 (fixed in 5.1.2) shipped a duplicate
615+
* org.openidentityplatform.opendj.opendj-server-legacy.jar alongside opendj.jar in lib/.
616+
* When upgrading by unzipping a 5.1.2+ archive over such an installation, that jar is no
617+
* longer part of the archive so it is neither overwritten nor removed. As the launcher builds
618+
* the classpath with the lib/* wildcard, the stale jar makes the runtime report the old
619+
* binary version and refuse to start with a version-mismatch error. Delete the leftover.
620+
*/
621+
register("5.1.2",
622+
deleteFile(new File(libDirectory, "org.openidentityplatform.opendj.opendj-server-legacy.jar")));
623+
612624
/* All upgrades will refresh the server configuration schema and generate a new upgrade folder. */
613625
registerLast(
614626
performOEMMigrationIfNeeded(),

0 commit comments

Comments
 (0)