Skip to content

[#746] remove stale opendj-server-legacy jar during upgrade#751

Merged
vharseko merged 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:issue-746-upgrade-remove-stale-server-legacy-jar
Jul 20, 2026
Merged

[#746] remove stale opendj-server-legacy jar during upgrade#751
vharseko merged 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:issue-746-upgrade-remove-stale-server-legacy-jar

Conversation

@vharseko

Copy link
Copy Markdown
Member

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:

InitializationException: The OpenDJ binary version '5.1.1...' does not match the installed
version '5.1.2...'. Please run upgrade before continuing

Root cause

Builds before #661 (which was fixed in 5.1.2) shipped a duplicate org.openidentityplatform.opendj.opendj-server-legacy.jar alongside the canonical opendj.jar in lib/, because the dependencySet exclude in opendj-archive-component.xml still 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 ./upgrade does not prune lib/ either. The launcher builds the classpath with the lib/* wildcard, so the stale 5.1.1 jar stays on the classpath next to the fresh opendj.jar. With the unordered wildcard classpath the stale DynamicConstants can 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

  • Code: register an upgrade task that deletes the leftover lib/org.openidentityplatform.opendj.opendj-server-legacy.jar. It is registered at 5.1.2, so it runs for any upgrade from a release ≤ 5.1.1 (getUpgradeTasks selects fromVersion < version <= toVersion), and is a harmless no-op when the file is absent (FileManager.deleteRecursively guards on file.exists()), mirroring the existing je.jar cleanup tasks. Ships in 5.2.0.
  • Docs: add a NOTE to install-guide/chap-upgrade documenting 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 compile succeeds.

… 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.
@vharseko
vharseko requested a review from maximthomas July 19, 2026 05:50
@vharseko vharseko added bug packaging deb/rpm/MSI, distribution layout, config.ldif docs java Pull requests that update java code labels Jul 19, 2026
@vharseko vharseko changed the title Issue #746: remove stale opendj-server-legacy jar during upgrade [#746] remove stale opendj-server-legacy jar during upgrade Jul 19, 2026
@vharseko
vharseko merged commit a7dc809 into OpenIdentityPlatform:master Jul 20, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug docs java Pull requests that update java code packaging deb/rpm/MSI, distribution layout, config.ldif

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Server does not start after upgrade from 5.1.1 to 5.1.2 (binary version '5.1.1....' does not match the installed version '5.1.2....')

2 participants