Fix GlassFish 8.x install detection when modules/glassfish.jar is absent#9442
Open
renatsaf wants to merge 1 commit into
Open
Fix GlassFish 8.x install detection when modules/glassfish.jar is absent#9442renatsaf wants to merge 1 commit into
renatsaf wants to merge 1 commit into
Conversation
The Add Server wizard validated a GlassFish install by requiring a jar in modules/ matching GFV3_JAR_MATCHER (originally modules/glassfish.jar from GlassFish 3-7). GlassFish 8 removed that jar; the bootstrap jar moved to lib/bootstrap/glassfish.jar, which getJarName() does not scan. The full distribution still matches only by accident (glassfish-batch-*.jar), while the Web Profile excludes Batch and so matches nothing, causing the wizard to reject it as an invalid installation. Accept lib/bootstrap/glassfish.jar (present in every distribution, full and web) as a fallback. Backward compatible with GlassFish 3-7; the container check and version resolution via getServerVersion() are unchanged. Fixes apache#9441
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.
Fixes #9441
What
The Add Server → GlassFish Server wizard rejects a GlassFish 8.x Web Profile installation as invalid, while accepting the Full distribution of the same version. Reported downstream at eclipse-ee4j/glassfish#26098.
Root cause
ServerWizardIterator.isValidInstall()requires a jar inmodules/whose name matchesServerUtilities.GFV3_JAR_MATCHER:This was meant to find the kernel jar
modules/glassfish.jar(orglassfish-<version>.jar) shipped by GlassFish 3–7. GlassFish 8 no longer ships it — the bootstrap jar moved tolib/bootstrap/glassfish.jar, whichgetJarName()(it only scansmodules/) never sees. Detection then falls back to matching the loose regex against whatever else is inmodules/:modules/*.jarthat match (case-sensitive)glassfish-batch-commands.jar,glassfish-batch-connector.jarThe Full profile passes only by accident —
glassfish-batch-*.jarmatches because the char class[0-9bSNAPHOT]contains a lowercaseb(glassfish-api.jar,glassfish-naming.jar, etc. do not match). The Web Profile excludes the Batch feature, so no jar qualifies,getJarName()returnsnull, and the install is rejected.Version detection itself is unaffected:
ServerUtils.getServerVersion()(readsBundle-Versionfrommodules/common-util.jar) works for both profiles. Only the brittle jar-presence gate fails.Fix
When the legacy
modules/glassfish*.jaris absent, fall back tolib/bootstrap/glassfish.jar, which is present in every GlassFish distribution (full and web). This is backward compatible with GlassFish 3–7, and theconfig/glassfish.containercheck plus version resolution viagetServerVersion()are left unchanged.Testing
Verified against staged GlassFish 8.x builds:
lib/bootstrap/glassfish.jarexists in both the full and web profile distributions, and neither hasmodules/glassfish.jar. With this change the web profile directory is accepted by the wizard; the full distribution and older (3–7) installs continue to be detected.