renatsaf opened a new pull request, #9442: URL: https://github.com/apache/netbeans/pull/9442
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 in `modules/` whose name matches `ServerUtilities.GFV3_JAR_MATCHER`: ``` glassfish(?:-[0-9bSNAPHOT]+(?:\.[0-9]+(?:_[0-9]+|)|).*|).jar ``` This was meant to find the kernel jar `modules/glassfish.jar` (or `glassfish-<version>.jar`) shipped by GlassFish 3–7. GlassFish 8 no longer ships it — the bootstrap jar moved to `lib/bootstrap/glassfish.jar`, which `getJarName()` (it only scans `modules/`) never sees. Detection then falls back to matching the loose regex against whatever else is in `modules/`: | Distribution | `modules/*.jar` that match (case-sensitive) | |---|---| | Full | `glassfish-batch-commands.jar`, `glassfish-batch-connector.jar` | | Web Profile | *(none)* | The Full profile passes only by accident — `glassfish-batch-*.jar` matches because the char class `[0-9bSNAPHOT]` contains a lowercase `b` (`glassfish-api.jar`, `glassfish-naming.jar`, etc. do not match). The Web Profile excludes the Batch feature, so no jar qualifies, `getJarName()` returns `null`, and the install is rejected. Version detection itself is unaffected: `ServerUtils.getServerVersion()` (reads `Bundle-Version` from `modules/common-util.jar`) works for both profiles. Only the brittle jar-presence gate fails. ### Fix When the legacy `modules/glassfish*.jar` is absent, fall back to `lib/bootstrap/glassfish.jar`, which is present in every GlassFish distribution (full and web). This is backward compatible with GlassFish 3–7, and the `config/glassfish.container` check plus version resolution via `getServerVersion()` are left unchanged. ### Testing Verified against staged GlassFish 8.x builds: `lib/bootstrap/glassfish.jar` exists in both the full and web profile distributions, and neither has `modules/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. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
