From 390df7a5eef10535f7ff79f88e556a70ce71fe29 Mon Sep 17 00:00:00 2001 From: "Renat R. Safiullin" Date: Tue, 16 Jun 2026 15:36:13 +0300 Subject: [PATCH] Fix GlassFish 8.x install detection when modules/glassfish.jar is absent 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 #9441 --- .../common/wizards/ServerWizardIterator.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/ServerWizardIterator.java b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/ServerWizardIterator.java index 604b2e895e8a..c48b8f186c4e 100644 --- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/ServerWizardIterator.java +++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/ServerWizardIterator.java @@ -337,7 +337,17 @@ ServerDetails isValidInstall(File installDir, File glassfishDir, WizardDescripto wizard.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, errMsg); // getSanitizedPath(installDir))); File jar = ServerUtilities.getJarName(glassfishDir.getAbsolutePath(), ServerUtilities.GFV3_JAR_MATCHER); if (jar == null || !jar.exists()) { - return null; + // GlassFish 8 no longer ships a versioned modules/glassfish*.jar; the + // bootstrap jar lives at lib/bootstrap/glassfish.jar in every + // distribution (both the full and the web profile). Accept that as + // proof of a GlassFish install while staying backward compatible with + // GlassFish 3-7. The actual version is still resolved further below + // through ServerUtils.getServerVersion() (modules/common-util.jar). + File bootstrapJar = new File(glassfishDir, + "lib" + File.separator + "bootstrap" + File.separator + "glassfish.jar"); // NOI18N + if (!bootstrapJar.exists()) { + return null; + } } File containerRef = new File(glassfishDir, "config" + File.separator + "glassfish.container");