[#746] remove stale opendj-server-legacy jar during upgrade#751
Merged
vharseko merged 1 commit intoJul 20, 2026
Conversation
… during upgrade Builds before OpenIdentityPlatform#661 (fixed in 5.1.2) shipped a duplicate org.openidentityplatform.opendj.opendj-server-legacy.jar alongside opendj.jar in lib/. Unpacking a 5.1.2+ archive over such an install leaves that jar behind (it is no longer in the archive, so nothing overwrites or removes it). Because the launcher builds the classpath with the lib/* wildcard, the stale 5.1.1 jar can win and make the runtime report the old binary version, so the server refuses to start with "binary version does not match the installed version" after a successful upgrade. Register an upgrade task that deletes the leftover jar, and document the manual cleanup for upgrades to the already-released 5.1.2.
maximthomas
approved these changes
Jul 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Fixes #746. After upgrading from 5.1.1 to 5.1.2 by unzipping the new archive over the existing installation and running
./upgrade, the server refuses to start:Root cause
Builds before #661 (which was fixed in 5.1.2) shipped a duplicate
org.openidentityplatform.opendj.opendj-server-legacy.jaralongside the canonicalopendj.jarinlib/, because thedependencySetexclude inopendj-archive-component.xmlstill referenced the pre-fork groupId. Both jars contain the same classes, including the compiled-in version constants.When upgrading by unzipping a 5.1.2+ archive over such an installation, that duplicate jar is no longer part of the delivery, so the unzip neither overwrites nor removes it, and
./upgradedoes not prunelib/either. The launcher builds the classpath with thelib/*wildcard, so the stale 5.1.1 jar stays on the classpath next to the freshopendj.jar. With the unordered wildcard classpath the staleDynamicConstantscan win, so the runtime reports binary version 5.1.1 while the recorded installed version is 5.1.2 — hence the mismatch and shutdown.The reporter confirmed that cleaning
lib/before unzipping resolves it.Change
lib/org.openidentityplatform.opendj.opendj-server-legacy.jar. It is registered at5.1.2, so it runs for any upgrade from a release ≤ 5.1.1 (getUpgradeTasksselectsfromVersion < version <= toVersion), and is a harmless no-op when the file is absent (FileManager.deleteRecursivelyguards onfile.exists()), mirroring the existingje.jarcleanup tasks. Ships in 5.2.0.install-guide/chap-upgradedocumenting the manual cleanup for anyone upgrading to the already-released 5.1.2, where the automatic cleanup is not yet present.Testing
mvn -o -pl opendj-server-legacy compilesucceeds.