diff --git a/appserver/admin/cli-optional/pom.xml b/appserver/admin/cli-optional/pom.xml
index 20d5b05bbce..03f9b89957e 100755
--- a/appserver/admin/cli-optional/pom.xml
+++ b/appserver/admin/cli-optional/pom.xml
@@ -80,7 +80,8 @@
org.glassfish.main.admin
admin-cli
${project.version}
-
+
+
org.glassfish.main.core
glassfish
${project.version}
@@ -138,18 +139,5 @@
-
-
- maven-jar-plugin
-
-
-
- true
-+ ../../modules
-
-
-
-
-
diff --git a/appserver/admin/cli/pom.xml b/appserver/admin/cli/pom.xml
index c8acfb8d918..5b044f67ef1 100755
--- a/appserver/admin/cli/pom.xml
+++ b/appserver/admin/cli/pom.xml
@@ -59,14 +59,7 @@
org.glassfish.admin.cli.AsadminMain
- true
- custom
- ${artifact.artifactId}.${artifact.extension}
- ../../modules
-
- ../bootstrap/glassfish-jul-extension.jar ../bootstrap/glassfish-jdk-extensions.jar ../bootstrap/simple-glassfish-api.jar
-
diff --git a/appserver/distributions/glassfish-common/src/main/resources/bin/asadmin b/appserver/distributions/glassfish-common/src/main/resources/bin/asadmin
index 8f7f88bbe26..77c480ad28a 100644
--- a/appserver/distributions/glassfish-common/src/main/resources/bin/asadmin
+++ b/appserver/distributions/glassfish-common/src/main/resources/bin/asadmin
@@ -21,11 +21,12 @@ case "`uname`" in
CYGWIN*) AS_INSTALL=`cygpath --windows $AS_INSTALL`
esac
. "${AS_INSTALL}/config/asenv.conf"
+
JAVA=java
#Depends upon Java from asenv.conf
if [ ${AS_JAVA} ]; then
JAVA=${AS_JAVA}/bin/java
fi
-AS_CLIENT="$AS_INSTALL/lib/client"
-exec "$JAVA" "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "$AS_CLIENT/appserver-cli.jar" "$@"
+ASADMIN_CLASSPATH="$AS_INSTALL/appserver-cli.jar:$AS_INSTALL/admin-cli.jar:$AS_INSTALL/modules/*"
+exec "$JAVA" "${ASADMIN_JVM_OPTIONS}" --module-path "${ASADMIN_MODULEPATH}" --add-modules ALL-MODULE-PATH -cp "$ASADMIN_CLASSPATH" org.glassfish.admin.cli.AsadminMain "$@"
diff --git a/appserver/distributions/glassfish-common/src/main/resources/bin/asadmin.bat b/appserver/distributions/glassfish-common/src/main/resources/bin/asadmin.bat
index 5eb640e0a94..50b841054a6 100644
--- a/appserver/distributions/glassfish-common/src/main/resources/bin/asadmin.bat
+++ b/appserver/distributions/glassfish-common/src/main/resources/bin/asadmin.bat
@@ -1,33 +1,36 @@
-@echo off
-REM
-REM Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation
-REM Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
-REM
-REM This program and the accompanying materials are made available under the
-REM terms of the Eclipse Public License v. 2.0, which is available at
-REM http://www.eclipse.org/legal/epl-2.0.
-REM
-REM This Source Code may also be made available under the following Secondary
-REM Licenses when the conditions for such availability set forth in the
-REM Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
-REM version 2 with the GNU Classpath Exception, which is available at
-REM https://www.gnu.org/software/classpath/license.html.
-REM
-REM SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-REM
-
-
-VERIFY OTHER 2>nul
-setlocal ENABLEEXTENSIONS
-if ERRORLEVEL 0 goto ok
-echo "Unable to enable extensions"
-exit /B 1
-:ok
-call "%~dp0..\glassfish\config\asenv.bat"
-if "%AS_JAVA%x" == "x" goto UsePath
-set JAVA="%AS_JAVA%\bin\java"
-goto run
-:UsePath
-set JAVA=java
-:run
-%JAVA% "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "%~dp0..\glassfish\lib\client\appserver-cli.jar" %*
+@echo off
+REM
+REM Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation
+REM Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
+REM
+REM This program and the accompanying materials are made available under the
+REM terms of the Eclipse Public License v. 2.0, which is available at
+REM http://www.eclipse.org/legal/epl-2.0.
+REM
+REM This Source Code may also be made available under the following Secondary
+REM Licenses when the conditions for such availability set forth in the
+REM Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+REM version 2 with the GNU Classpath Exception, which is available at
+REM https://www.gnu.org/software/classpath/license.html.
+REM
+REM SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+REM
+
+VERIFY OTHER 2>nul
+setlocal ENABLEEXTENSIONS
+if ERRORLEVEL 0 goto ok
+echo "Unable to enable extensions"
+exit /B 1
+
+:ok
+call "%~dp0..\glassfish\config\asenv.bat"
+if "%AS_JAVA%x" == "x" goto UsePath
+set JAVA="%AS_JAVA%\bin\java"
+goto run
+
+:UsePath
+set JAVA=java
+
+:run
+set ASADMIN_CLASSPATH="%AS_INSTALL%/appserver-cli.jar:%AS_INSTALL%/admin-cli.jar:%AS_INSTALL%/modules/*"
+%JAVA% "%ASADMIN_JVM_OPTIONS%" --module-path "%ASADMIN_MODULEPATH%" --add-modules ALL-MODULE-PATH -cp "%ASADMIN_CLASSPATH%" org.glassfish.admin.cli.AsadminMain %*
diff --git a/appserver/distributions/glassfish-common/src/main/resources/bin/debug-asadmin b/appserver/distributions/glassfish-common/src/main/resources/bin/debug-asadmin
index 8f9fc3c7e52..5c5d7552c33 100644
--- a/appserver/distributions/glassfish-common/src/main/resources/bin/debug-asadmin
+++ b/appserver/distributions/glassfish-common/src/main/resources/bin/debug-asadmin
@@ -17,13 +17,14 @@
#
AS_INSTALL=`dirname "$0"`/../glassfish
-AS_INSTALL_LIB="$AS_INSTALL/lib"
. "${AS_INSTALL}/config/asenv.conf"
+
JAVA=java
#Depends upon Java from ../config/asenv.conf
if [ ${AS_JAVA} ]; then
JAVA=${AS_JAVA}/bin/java
fi
-exec "$JAVA" "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=9008 -jar "$AS_INSTALL_LIB/client/appserver-cli.jar" "$@"
+ASADMIN_CLASSPATH="$AS_INSTALL/appserver-cli.jar:$AS_INSTALL/admin-cli.jar:$AS_INSTALL/modules/*"
+exec "$JAVA" "${ASADMIN_JVM_OPTIONS}" -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=9008 --module-path "${ASADMIN_MODULEPATH}" --add-modules ALL-MODULE-PATH -cp "$ASADMIN_CLASSPATH" org.glassfish.admin.cli.AsadminMain "$@"
diff --git a/appserver/distributions/glassfish-common/src/main/resources/bin/debug-asadmin.bat b/appserver/distributions/glassfish-common/src/main/resources/bin/debug-asadmin.bat
index 619fa9b04cb..dfa747bd657 100755
--- a/appserver/distributions/glassfish-common/src/main/resources/bin/debug-asadmin.bat
+++ b/appserver/distributions/glassfish-common/src/main/resources/bin/debug-asadmin.bat
@@ -22,12 +22,16 @@ setlocal ENABLEEXTENSIONS
if ERRORLEVEL 0 goto ok
echo "Unable to enable extensions"
exit /B 1
+
:ok
call "%~dp0..\glassfish\config\asenv.bat"
if "%AS_JAVA%x" == "x" goto UsePath
set JAVA="%AS_JAVA%\bin\java"
goto run
+
:UsePath
set JAVA=java
+
:run
-%JAVA% "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=9008 -jar "%~dp0..\glassfish\lib\client\appserver-cli.jar" %*
+set ASADMIN_CLASSPATH="%AS_INSTALL%/appserver-cli.jar:%AS_INSTALL%/admin-cli.jar:%AS_INSTALL%/modules/*"
+%JAVA% "%ASADMIN_JVM_OPTIONS%" -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=9008 --module-path "%ASADMIN_MODULEPATH%" --add-modules ALL-MODULE-PATH -cp "%ASADMIN_CLASSPATH%" org.glassfish.admin.cli.AsadminMain %*
diff --git a/appserver/distributions/glassfish-common/src/main/resources/bin/startserv b/appserver/distributions/glassfish-common/src/main/resources/bin/startserv
index dc28eb2beb5..3188778d880 100755
--- a/appserver/distributions/glassfish-common/src/main/resources/bin/startserv
+++ b/appserver/distributions/glassfish-common/src/main/resources/bin/startserv
@@ -20,17 +20,19 @@ AS_INSTALL=`dirname "$0"`/../glassfish
case "`uname`" in
CYGWIN*) AS_INSTALL=`cygpath --windows $AS_INSTALL`
esac
-AS_INSTALL_LIB="$AS_INSTALL/modules"
. "${AS_INSTALL}/config/asenv.conf"
+
JAVA=java
#Depends upon Java from ../config/asenv.conf
if [ ${AS_JAVA} ]; then
JAVA=${AS_JAVA}/bin/java
fi
+ASADMIN_CLASSPATH="$AS_INSTALL/appserver-cli.jar:$AS_INSTALL/admin-cli.jar:$AS_INSTALL/modules/*"
+
start_as_main_process () {
if [[ "$@" == "--help" ]] || [[ "$@" == "--help=true" ]] || [[ "$@" == "-?" ]]; then
- exec java "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "$ASADMIN_JAR" start-domain --help
+ exec "$JAVA" "${ASADMIN_JVM_OPTIONS}" --module-path "${ASADMIN_MODULEPATH}" --add-modules ALL-MODULE-PATH -cp "$ASADMIN_CLASSPATH" org.glassfish.admin.cli.AsadminMain start-domain --help
fi
# Execute start-domain --dry-run and store the output line by line into an array.
@@ -50,7 +52,7 @@ start_as_main_process () {
else
DRY_RUN_OUTPUT+=("$COM");
fi
- done < <(java "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "$ASADMIN_JAR" start-domain --dry-run "$@" || echo "FAILED" )
+ done < <("$JAVA" "${ASADMIN_JVM_OPTIONS}" --module-path "${ASADMIN_MODULEPATH}" --add-modules ALL-MODULE-PATH -cp "$ASADMIN_CLASSPATH" org.glassfish.admin.cli.AsadminMain start-domain --dry-run "$@" || echo "FAILED")
if [[ x"$DRY_RUN_OUTPUT" == x ]]
then
echo -n -e "${DRY_RUN_OUTPUT_BEFORE_DUMP}" >&2
@@ -65,7 +67,6 @@ start_as_main_process () {
}
-ASADMIN_JAR="$AS_INSTALL_LIB/admin-cli.jar"
start_as_main_process "$@"
# Alternatively, run the following:
diff --git a/appserver/distributions/glassfish-common/src/main/resources/bin/startserv.bat b/appserver/distributions/glassfish-common/src/main/resources/bin/startserv.bat
index eb0b1198f6d..65c064aba7b 100755
--- a/appserver/distributions/glassfish-common/src/main/resources/bin/startserv.bat
+++ b/appserver/distributions/glassfish-common/src/main/resources/bin/startserv.bat
@@ -16,5 +16,21 @@ REM
REM SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
REM
+VERIFY OTHER 2>nul
+setlocal ENABLEEXTENSIONS
+if ERRORLEVEL 0 goto ok
+echo "Unable to enable extensions"
+exit /B 1
-java "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "%~dp0..\glassfish\modules\admin-cli.jar" start-domain --verbose %*
+:ok
+call "%~dp0..\config\asenv.bat"
+if "%AS_JAVA%x" == "x" goto UsePath
+set JAVA="%AS_JAVA%\bin\java"
+goto run
+
+:UsePath
+set JAVA=java
+
+:run
+set ASADMIN_CLASSPATH="%AS_INSTALL%/appserver-cli.jar:%AS_INSTALL%/admin-cli.jar:%AS_INSTALL%/modules/*"
+%JAVA% "%ASADMIN_JVM_OPTIONS%" --module-path "%ASADMIN_MODULEPATH%" --add-modules ALL-MODULE-PATH -cp "%ASADMIN_CLASSPATH%" org.glassfish.admin.cli.AsadminMain start-domain --verbose %*
diff --git a/appserver/distributions/glassfish-common/src/main/resources/bin/stopserv b/appserver/distributions/glassfish-common/src/main/resources/bin/stopserv
index bf6b38f7d09..fee54b1c43f 100755
--- a/appserver/distributions/glassfish-common/src/main/resources/bin/stopserv
+++ b/appserver/distributions/glassfish-common/src/main/resources/bin/stopserv
@@ -17,6 +17,5 @@
#
AS_INSTALL=`dirname "$0"`/../glassfish
-AS_INSTALL_LIB="$AS_INSTALL/modules"
-exec java "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "$AS_INSTALL_LIB/admin-cli.jar" stop-domain "$@"
+exec java "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "$AS_INSTALL/admin-cli.jar" stop-domain "$@"
diff --git a/appserver/distributions/glassfish-common/src/main/resources/bin/stopserv.bat b/appserver/distributions/glassfish-common/src/main/resources/bin/stopserv.bat
index 0f7fb7bd7ea..eba403e3a52 100755
--- a/appserver/distributions/glassfish-common/src/main/resources/bin/stopserv.bat
+++ b/appserver/distributions/glassfish-common/src/main/resources/bin/stopserv.bat
@@ -1,20 +1,20 @@
-@echo off
-REM
-REM Copyright (c) 2024 Contributors to the Eclipse Foundation
-REM Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
-REM
-REM This program and the accompanying materials are made available under the
-REM terms of the Eclipse Public License v. 2.0, which is available at
-REM http://www.eclipse.org/legal/epl-2.0.
-REM
-REM This Source Code may also be made available under the following Secondary
-REM Licenses when the conditions for such availability set forth in the
-REM Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
-REM version 2 with the GNU Classpath Exception, which is available at
-REM https://www.gnu.org/software/classpath/license.html.
-REM
-REM SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-REM
-
-
-java "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "%~dp0..\glassfish\modules\admin-cli.jar" stop-domain %*
+@echo off
+REM
+REM Copyright (c) 2024 Contributors to the Eclipse Foundation
+REM Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
+REM
+REM This program and the accompanying materials are made available under the
+REM terms of the Eclipse Public License v. 2.0, which is available at
+REM http://www.eclipse.org/legal/epl-2.0.
+REM
+REM This Source Code may also be made available under the following Secondary
+REM Licenses when the conditions for such availability set forth in the
+REM Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+REM version 2 with the GNU Classpath Exception, which is available at
+REM https://www.gnu.org/software/classpath/license.html.
+REM
+REM SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+REM
+
+
+java "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "%~dp0..\glassfish\admin-cli.jar" stop-domain %*
diff --git a/appserver/distributions/glassfish-common/src/main/resources/glassfish/bin/asadmin b/appserver/distributions/glassfish-common/src/main/resources/glassfish/bin/asadmin
index ecafdba4123..d363ad4a57b 100644
--- a/appserver/distributions/glassfish-common/src/main/resources/glassfish/bin/asadmin
+++ b/appserver/distributions/glassfish-common/src/main/resources/glassfish/bin/asadmin
@@ -21,11 +21,12 @@ case "`uname`" in
CYGWIN*) AS_INSTALL=`cygpath --windows $AS_INSTALL`
esac
. "${AS_INSTALL}/config/asenv.conf"
+
JAVA=java
#Depends upon Java from asenv.conf
if [ ${AS_JAVA} ]; then
JAVA=${AS_JAVA}/bin/java
fi
-AS_CLIENT=$AS_INSTALL/lib/client
-exec "$JAVA" "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "$AS_CLIENT/appserver-cli.jar" "$@"
+ASADMIN_CLASSPATH="$AS_INSTALL/appserver-cli.jar:$AS_INSTALL/admin-cli.jar:$AS_INSTALL/modules/*"
+exec "$JAVA" "${ASADMIN_JVM_OPTIONS}" --module-path "${ASADMIN_MODULEPATH}" --add-modules ALL-MODULE-PATH -cp "$ASADMIN_CLASSPATH" org.glassfish.admin.cli.AsadminMain "$@"
diff --git a/appserver/distributions/glassfish-common/src/main/resources/glassfish/bin/asadmin.bat b/appserver/distributions/glassfish-common/src/main/resources/glassfish/bin/asadmin.bat
index 8f33452d7b8..e5a2e53b0ea 100644
--- a/appserver/distributions/glassfish-common/src/main/resources/glassfish/bin/asadmin.bat
+++ b/appserver/distributions/glassfish-common/src/main/resources/glassfish/bin/asadmin.bat
@@ -1,33 +1,36 @@
-@echo off
-REM
-REM Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation
-REM Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
-REM
-REM This program and the accompanying materials are made available under the
-REM terms of the Eclipse Public License v. 2.0, which is available at
-REM http://www.eclipse.org/legal/epl-2.0.
-REM
-REM This Source Code may also be made available under the following Secondary
-REM Licenses when the conditions for such availability set forth in the
-REM Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
-REM version 2 with the GNU Classpath Exception, which is available at
-REM https://www.gnu.org/software/classpath/license.html.
-REM
-REM SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-REM
-
-
-VERIFY OTHER 2>nul
-setlocal ENABLEEXTENSIONS
-if ERRORLEVEL 0 goto ok
-echo "Unable to enable extensions"
-exit /B 1
-:ok
-call "%~dp0..\config\asenv.bat"
-if "%AS_JAVA%x" == "x" goto UsePath
-set JAVA="%AS_JAVA%\bin\java"
-goto run
-:UsePath
-set JAVA=java
-:run
-%JAVA% "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "%~dp0..\lib\client\appserver-cli.jar" %*
+@echo off
+REM
+REM Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation
+REM Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
+REM
+REM This program and the accompanying materials are made available under the
+REM terms of the Eclipse Public License v. 2.0, which is available at
+REM http://www.eclipse.org/legal/epl-2.0.
+REM
+REM This Source Code may also be made available under the following Secondary
+REM Licenses when the conditions for such availability set forth in the
+REM Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+REM version 2 with the GNU Classpath Exception, which is available at
+REM https://www.gnu.org/software/classpath/license.html.
+REM
+REM SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+REM
+
+VERIFY OTHER 2>nul
+setlocal ENABLEEXTENSIONS
+if ERRORLEVEL 0 goto ok
+echo "Unable to enable extensions"
+exit /B 1
+
+:ok
+call "%~dp0..\config\asenv.bat"
+if "%AS_JAVA%x" == "x" goto UsePath
+set JAVA="%AS_JAVA%\bin\java"
+goto run
+
+:UsePath
+set JAVA=java
+
+:run
+set ASADMIN_CLASSPATH="%AS_INSTALL%/appserver-cli.jar:%AS_INSTALL%/admin-cli.jar:%AS_INSTALL%/modules/*"
+%JAVA% "%ASADMIN_JVM_OPTIONS%" --module-path "%ASADMIN_MODULEPATH%" --add-modules ALL-MODULE-PATH -cp "%ASADMIN_CLASSPATH%" org.glassfish.admin.cli.AsadminMain %*
diff --git a/appserver/distributions/glassfish/src/main/assembly/glassfish.xml b/appserver/distributions/glassfish/src/main/assembly/glassfish.xml
index fd96e2b1848..d71bf761ee1 100644
--- a/appserver/distributions/glassfish/src/main/assembly/glassfish.xml
+++ b/appserver/distributions/glassfish/src/main/assembly/glassfish.xml
@@ -258,14 +258,15 @@
${install.dir.name}/glassfish/lib/asadmin
-
+
${temp.dir}
640
+ admin-cli.jar
appserver-cli.jar
- ${install.dir.name}/glassfish/lib/client
+ ${install.dir.name}/glassfish
@@ -327,7 +328,6 @@
640
glassfish.jar
- glassfish-osgi-bootstrap.jar
glassfish-jdk-extensions.jar
glassfish-jul-extension.jar
simple-glassfish-api.jar
@@ -366,8 +366,12 @@
*.jar
- server-mgmt.jar
+ admin-cli.jar
+ appserver-cli.jar
+ cli-optional.jar
+ cluster-cli.jar
osgi-cli-interactive.jar
+ server-mgmt.jar
flashlight-agent.jar
org.apache.felix.configadmin.jar
org.apache.felix.fileinstall.jar
@@ -382,13 +386,9 @@
nucleus-domain.jar
appserver-domain.jar
glassfish.jar
- glassfish-osgi-bootstrap.jar
glassfish-jdk-extensions.jar
glassfish-jul-extension.jar
simple-glassfish-api.jar
- cli-optional.jar
- appserver-cli.jar
- cluster-cli.jar
glassfish-embedded-shell.jar
glassfish-embedded-static-shell.jar
jakartaee.jar
diff --git a/appserver/distributions/web/src/main/assembly/web.xml b/appserver/distributions/web/src/main/assembly/web.xml
index 36d8b692eae..a30fa39c3e9 100644
--- a/appserver/distributions/web/src/main/assembly/web.xml
+++ b/appserver/distributions/web/src/main/assembly/web.xml
@@ -153,14 +153,15 @@
${install.dir.name}/glassfish/lib/asadmin
-
+
${temp.dir}
640
+ admin-cli.jar
appserver-cli.jar
- ${install.dir.name}/glassfish/lib/client
+ ${install.dir.name}/glassfish
@@ -201,7 +202,6 @@
640
glassfish.jar
- glassfish-osgi-bootstrap.jar
glassfish-jdk-extensions.jar
glassfish-jul-extension.jar
simple-glassfish-api.jar
@@ -240,8 +240,12 @@
*.jar
- server-mgmt.jar
+ admin-cli.jar
+ appserver-cli.jar
+ cli-optional.jar
+ cluster-cli.jar
osgi-cli-interactive.jar
+ server-mgmt.jar
flashlight-agent.jar
org.apache.felix.configadmin.jar
org.apache.felix.fileinstall.jar
@@ -256,13 +260,9 @@
nucleus-domain.jar
appserver-domain.jar
glassfish.jar
- glassfish-osgi-bootstrap.jar
glassfish-jdk-extensions.jar
glassfish-jul-extension.jar
simple-glassfish-api.jar
- cli-optional.jar
- appserver-cli.jar
- cluster-cli.jar
glassfish-embedded-shell.jar
glassfish-embedded-static-shell.jar
jakartaee.jar
diff --git a/nucleus/admin/cli/pom.xml b/nucleus/admin/cli/pom.xml
index c74acc5b85d..2be80f9612c 100755
--- a/nucleus/admin/cli/pom.xml
+++ b/nucleus/admin/cli/pom.xml
@@ -258,7 +258,7 @@
com.sun.enterprise.admin.cli.schemadoc
-
+
maven-jar-plugin
@@ -266,13 +266,7 @@
com.sun.enterprise.admin.cli.AdminMain
- true
- custom
- ${artifact.artifactId}.${artifact.extension}
-
- ../lib/bootstrap/glassfish-jul-extension.jar ../lib/bootstrap/glassfish-jdk-extensions.jar ../lib/bootstrap/simple-glassfish-api.jar
-
diff --git a/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/AdminMain.java b/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/AdminMain.java
index b1fb6243bdf..eb4bb13d38e 100644
--- a/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/AdminMain.java
+++ b/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/AdminMain.java
@@ -97,6 +97,7 @@ public class AdminMain {
}
private final Path installRoot;
+ private String modulePath;
private String classPath;
private String className;
private String command;
@@ -206,10 +207,12 @@ protected final int doMain(String[] args) {
cliContainer = new CLIContainer(ecl, extensions, logger);
classPath = SmartFile.sanitizePaths(System.getProperty("java.class.path"));
+ modulePath = SmartFile.sanitize(System.getProperty("jdk.module.path"));
className = AdminMain.class.getName();
if (logger.isLoggable(FINER)) {
- logger.log(FINER, "Classpath: {0}\nArguments: {1}", new Object[] {classPath, Arrays.toString(args)});
+ logger.log(FINER, "ModulePath: {0}\nClasspath: {1}\nArguments: {2}",
+ new Object[] {modulePath, classPath, Arrays.toString(args)});
}
if (args.length == 0) {
@@ -278,6 +281,7 @@ public int executeCommand(String[] argv) {
po = new ProgramOptions(env);
}
po.toEnvironment(env);
+ po.setModulePath(modulePath);
po.setClassPath(classPath);
po.setClassName(className);
po.setCommandName(getCommandName());
diff --git a/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/CLIContainer.java b/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/CLIContainer.java
index 273f2183be2..2e9b2cdd73d 100644
--- a/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/CLIContainer.java
+++ b/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/CLIContainer.java
@@ -122,7 +122,7 @@ private Set expandExtensions() throws IOException {
}
}
File inst = new File(System.getProperty(SystemPropertyConstants.INSTALL_ROOT_PROPERTY));
- File adminCliJar = new File(new File(inst, "modules"), "admin-cli.jar");
+ File adminCliJar = new File(inst, "admin-cli.jar");
if (!adminCliJar.exists()) {
throw new IOException(adminCliJar.getAbsolutePath());
}
diff --git a/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/MultimodeCommand.java b/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/MultimodeCommand.java
index 2313a69ff87..023c4704d25 100644
--- a/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/MultimodeCommand.java
+++ b/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/MultimodeCommand.java
@@ -225,6 +225,7 @@ private int executeCommands(BufferedReader reader) throws CommandException, Comm
*/
po = new ProgramOptions(env);
// copy over AsadminMain info
+ po.setModulePath(programOpts.getModulePath());
po.setClassPath(programOpts.getClassPath());
po.setClassName(programOpts.getClassName());
po.setCommandName(programOpts.getCommandName());
diff --git a/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/ProgramOptions.java b/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/ProgramOptions.java
index c14f15a1628..6fb76867d3f 100644
--- a/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/ProgramOptions.java
+++ b/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/ProgramOptions.java
@@ -83,15 +83,15 @@ public enum PasswordLocation {
private PasswordLocation location;
private String commandName;
- /*
+
+ private String modulePath;
+ /**
* Information passed in from AsadminMain and used by start-domain.
- * XXX - this is somewhat of a kludge but this seems the best place
- * to put it for now
*/
private String classPath;
private String className;
- /*
+ /**
* Define the meta-options known by the asadmin command.
*/
static {
@@ -153,6 +153,7 @@ public ProgramOptions(ProgramOptions other) {
this.options = new ParameterMap(other.options);
this.env = other.env;
this.password = other.password;
+ this.modulePath = other.modulePath;
this.classPath = other.classPath;
this.className = other.className;
}
@@ -640,6 +641,20 @@ public String getPlainOption(String name) {
return options.getOne(name);
}
+ /**
+ * @return the modulePath
+ */
+ public String getModulePath() {
+ return modulePath;
+ }
+
+ /**
+ * @param modulePath the modulePath to set
+ */
+ public void setModulePath(String modulePath) {
+ this.modulePath = modulePath;
+ }
+
/**
* @return the classPath
*/
diff --git a/nucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GFEmbeddedLauncher.java b/nucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GFEmbeddedLauncher.java
index ca55951ea8b..7ae15c65b95 100644
--- a/nucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GFEmbeddedLauncher.java
+++ b/nucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GFEmbeddedLauncher.java
@@ -68,9 +68,14 @@ void internalLaunch() throws GFLauncherException {
}
}
+ @Override
+ List getMainModulepath() throws GFLauncherException {
+ return List.of();
+ }
+
@Override
List getMainClasspath() throws GFLauncherException {
- throw new GFLauncherException("not needed?!?");
+ return List.of();
}
@Override
@@ -172,8 +177,16 @@ void setCommandLine() throws GFLauncherException {
cmdLine.clear();
cmdLine.add(javaExe.getPath());
addThreadDump(cmdLine);
- cmdLine.add("-cp");
- cmdLine.add(getClasspath());
+ if (getModulepath() != null) {
+ cmdLine.add("--module-path");
+ cmdLine.add(getModulepath());
+ cmdLine.add("--add-modules");
+ cmdLine.add("ALL-MODULE-PATH");
+ }
+ if (getClasspath() != null) {
+ cmdLine.add("-cp");
+ cmdLine.add(getClasspath());
+ }
addDebug(cmdLine);
cmdLine.add(getMainClass());
cmdLine.add("--installdir");
@@ -221,6 +234,7 @@ private void setupFromEnv() throws GFLauncherException {
setupDomainDir();
setupJavaDB();
setClasspath();
+ setModulepath();
}
private void setupDomainDir() throws GFLauncherException {
diff --git a/nucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GFLauncher.java b/nucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GFLauncher.java
index 362ef704deb..07d821ce2d2 100644
--- a/nucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GFLauncher.java
+++ b/nucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GFLauncher.java
@@ -79,10 +79,8 @@
* @author bnevins
*/
public abstract class GFLauncher {
-
private static final LocalStringsImpl I18N = new LocalStringsImpl(GFLauncher.class);
private static final Logger LOG = System.getLogger(GFLauncher.class.getName(), I18N.getBundle());
- private final static LocalStringsImpl strings = new LocalStringsImpl(GFLauncher.class);
/**
* Parameters provided by the caller of a launcher, either programmatically (for GF embedded) or as commandline
@@ -138,6 +136,7 @@ public abstract class GFLauncher {
private Map domainXMLSystemProperty;
private String javaExe;
+ private String modulepath;
private String classpath;
private String adminFileRealmKeyFile;
private boolean secureAdminEnabled;
@@ -217,7 +216,7 @@ public final void launch() throws GFLauncherException {
throw gfe;
} catch (Throwable t) {
// hk2 might throw a java.lang.Error
- throw new GFLauncherException(strings.get("unknownError", t.getMessage()), t);
+ throw new GFLauncherException(I18N.get("unknownError", t.getMessage()), t);
} finally {
GFLauncherLogger.removeLogFileHandler();
}
@@ -250,7 +249,7 @@ public final void launchJVM(List cmdsIn) throws GFLauncherException {
throw gfe;
} catch (Throwable t) {
// hk2 might throw a java.lang.Error
- throw new GFLauncherException(strings.get("unknownError", t.getMessage()), t);
+ throw new GFLauncherException(I18N.get("unknownError", t.getMessage()), t);
} finally {
GFLauncherLogger.removeLogFileHandler();
}
@@ -307,6 +306,7 @@ public void setup() throws GFLauncherException, MiniXmlParserException {
GFLauncherLogger.addLogFileHandler(logFilename);
setJavaExecutable();
+ setModulepath();
setClasspath();
setCommandLine();
setJvmOptions();
@@ -390,7 +390,7 @@ public final ProcessStreamDrainer getProcessStreamDrainer() throws GFLauncherExc
*/
public String getLogFilename() throws GFLauncherException {
if (!logFilenameWasFixed) {
- throw new GFLauncherException(strings.get("internalError") + " call to getLogFilename() before it has been initialized");
+ throw new GFLauncherException(I18N.get("internalError") + " call to getLogFilename() before it has been initialized");
}
return logFilename;
@@ -540,6 +540,8 @@ final long getStartTime() {
return startTime;
}
+ abstract List getMainModulepath() throws GFLauncherException;
+
abstract List getMainClasspath() throws GFLauncherException;
abstract String getMainClass() throws GFLauncherException;
@@ -750,8 +752,12 @@ boolean setJavaExecutableIfValid(String filename) {
return false;
}
+ void setModulepath() throws GFLauncherException {
+ setModulepath(GFLauncherUtils.fileListToPathString(getMainModulepath()));
+ }
+
void setClasspath() throws GFLauncherException {
- List mainCP = getMainClasspath(); // subclass provides this
+ List mainCP = getMainClasspath();
List envCP = domainXMLjavaConfig.getEnvClasspath();
List sysCP = domainXMLjavaConfig.getSystemClasspath();
List prefixCP = domainXMLjavaConfig.getPrefixClasspath();
@@ -766,15 +772,24 @@ void setClasspath() throws GFLauncherException {
all.addAll(sysCP);
all.addAll(envCP);
all.addAll(suffixCP);
- setClasspath(GFLauncherUtils.fileListToPathString(all));
+ setClasspath(all.isEmpty() ? null : GFLauncherUtils.fileListToPathString(all));
}
void setCommandLine() throws GFLauncherException {
List cmdLine = getCommandLine();
cmdLine.clear();
addIgnoreNull(cmdLine, javaExe);
- addIgnoreNull(cmdLine, "-cp");
- addIgnoreNull(cmdLine, getClasspath());
+ if (getModulepath() != null) {
+ cmdLine.add("--module-path");
+ cmdLine.add(getModulepath());
+ cmdLine.add("--add-modules");
+ cmdLine.add("ALL-MODULE-PATH");
+ }
+ cmdLine.add("-verbose");
+ if (getClasspath() != null) {
+ addIgnoreNull(cmdLine, "-cp");
+ addIgnoreNull(cmdLine, getClasspath());
+ }
addIgnoreNull(cmdLine, domainXMLjavaConfigDebugOptions);
String CLIStartTime = System.getProperty("WALL_CLOCK_START");
@@ -800,7 +815,7 @@ void setCommandLine() throws GFLauncherException {
} catch (GFLauncherException gfle) {
throw gfle;
} catch (Exception e) {
- // harmless
+ throw new GFLauncherException(e);
}
}
@@ -868,7 +883,7 @@ private void setShutdownHook(final Process p) {
if (processWhacker == null) {
Runtime runtime = Runtime.getRuntime();
- final String msg = strings.get("serverStopped", callerParameters.getType());
+ final String msg = I18N.get("serverStopped", callerParameters.getType());
processWhacker = new ProcessWhacker(p, msg);
runtime.addShutdownHook(new Thread(processWhacker));
@@ -943,7 +958,7 @@ private String getDeadProcessTrace(Process sp) throws GFLauncherException {
int ev = sp.exitValue();
ProcessStreamDrainer psd1 = getProcessStreamDrainer();
String output = psd1.getOutErrString();
- String trace = strings.get("server_process_died", ev, output);
+ String trace = I18N.get("server_process_died", ev, output);
return trace;
} catch (IllegalThreadStateException e) {
// the glassFishProcess is still running and we are ok
@@ -966,7 +981,7 @@ private void setupUpgradeSecurity() throws GFLauncherException {
// the actual error is wrapped differently depending on
// whether the problem was with the source or target
Throwable cause = ioe.getCause() == null ? ioe : ioe.getCause();
- throw new GFLauncherException(strings.get("copy_server_policy_error", cause.getMessage()), ioe);
+ throw new GFLauncherException(I18N.get("copy_server_policy_error", cause.getMessage()), ioe);
}
}
}
@@ -986,7 +1001,7 @@ private void renameOsgiCache() throws GFLauncherException {
if (FileUtils.renameFile(osgiCacheDir, backupOsgiCacheDir)) {
GFLauncherLogger.fine("rename_osgi_cache_succeeded", osgiCacheDir, backupOsgiCacheDir);
} else {
- throw new GFLauncherException(strings.get("rename_osgi_cache_failed", osgiCacheDir, backupOsgiCacheDir));
+ throw new GFLauncherException(I18N.get("rename_osgi_cache_failed", osgiCacheDir, backupOsgiCacheDir));
}
}
}
@@ -1029,7 +1044,7 @@ private String getMonitoringAgentJvmOptionString() throws GFLauncherException {
if (flashlightJarFile.isFile()) {
return "javaagent:" + getCleanPath(flashlightJarFile);
} else {
- String msg = strings.get("no_flashlight_agent", flashlightJarFile);
+ String msg = I18N.get("no_flashlight_agent", flashlightJarFile);
GFLauncherLogger.warning(GFLauncherLogger.NO_FLASHLIGHT_AGENT, flashlightJarFile);
throw new GFLauncherException(msg);
}
@@ -1055,6 +1070,14 @@ void setClasspath(String s) {
classpath = s;
}
+ String getModulepath() {
+ return modulepath;
+ }
+
+ void setModulepath(String modulepath) {
+ this.modulepath = modulepath;
+ }
+
private List propsToJvmOptions(Map map) {
List ss = new ArrayList<>();
Set> entries = map.entrySet();
@@ -1107,7 +1130,7 @@ private void closeStandardStreamsMaybe() {
sname = callerParameters.getInstanceName();
}
- System.out.println(strings.get("ssh", sname));
+ System.out.println(I18N.get("ssh", sname));
try {
System.in.close();
} catch (Exception e) { // ignore
diff --git a/nucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GFLauncherInfo.java b/nucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GFLauncherInfo.java
index f888ac40e1d..8d613826654 100644
--- a/nucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GFLauncherInfo.java
+++ b/nucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GFLauncherInfo.java
@@ -44,12 +44,12 @@ public class GFLauncherInfo {
private final static String CONFIG_FILENAME = "domain.xml";
// Set by contructor
- private RuntimeType type;
+ private final RuntimeType type;
/**
* Incoming arguments from caller
*/
- private List argsRaw = new ArrayList<>();
+ private final List argsRaw = new ArrayList<>();
/**
* Intermediate map form of arguments from caller
@@ -352,8 +352,8 @@ public Map getArgs() throws GFLauncherException {
return map;
}
- public void setRespawnInfo(String classname, String classpath, String[] args) {
- respawnInfo = new RespawnInfo(classname, classpath, args);
+ public void setRespawnInfo(String classname, String modulePath, String classpath, String[] args) {
+ respawnInfo = new RespawnInfo(classname, modulePath, classpath, args);
}
/**
diff --git a/nucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GFLauncherNativeHelper.java b/nucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GFLauncherNativeHelper.java
index 559ad70f3f2..744cc881e71 100644
--- a/nucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GFLauncherNativeHelper.java
+++ b/nucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GFLauncherNativeHelper.java
@@ -85,9 +85,11 @@ List getCommands() {
// * all duplicate directories are removed
// * junk is removed, e.g. ":xxx::yy::::::" goes to "xxx:yy"
- String finalPathString = GFLauncherUtils.fileListToPathString(GFLauncherUtils.stringToFiles(sb.toString()));
- String nativeCommand = "-D" + JAVA_NATIVE_SYSPROP_NAME + "=" + finalPathString;
- list.add(nativeCommand);
+ List files = GFLauncherUtils.stringToFiles(sb.toString());
+ if (!files.isEmpty()) {
+ String nativeCommand = "-D" + JAVA_NATIVE_SYSPROP_NAME + "=" + GFLauncherUtils.fileListToPathString(files);
+ list.add(nativeCommand);
+ }
return list;
}
diff --git a/nucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GlassFishMainLauncher.java b/nucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GlassFishMainLauncher.java
index 4789bfa4bd4..d5ad1ca10f9 100644
--- a/nucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GlassFishMainLauncher.java
+++ b/nucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GlassFishMainLauncher.java
@@ -21,10 +21,7 @@
import java.io.File;
import java.nio.file.Path;
-import java.util.ArrayList;
import java.util.List;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
import static com.sun.enterprise.util.SystemPropertyConstants.INSTALL_ROOT_PROPERTY;
@@ -64,24 +61,13 @@ void internalLaunch() throws GFLauncherException {
@Override
List getMainClasspath() throws GFLauncherException {
- Path dir = Path.of(getEnvProps().get(INSTALL_ROOT_PROPERTY), "lib", "bootstrap");
- List classpath = Stream
- .of("glassfish.jar", "glassfish-jul-extension.jar", "glassfish-jdk-extensions.jar",
- "simple-glassfish-api.jar")
- .map(dir::resolve).map(Path::toFile).map(SmartFile::sanitize).collect(Collectors.toList());
- if (isFakeLaunch()) {
- return classpath;
- }
- List missing = new ArrayList<>(classpath.size());
- for (File file : classpath) {
- if (!file.exists()) {
- missing.add(file);
- }
- }
- if (missing.isEmpty()) {
- return classpath;
- }
- throw new GFLauncherException("nobootjar", missing);
+ return List.of();
+ }
+
+ @Override
+ List getMainModulepath() throws GFLauncherException {
+ return List
+ .of(SmartFile.sanitize(Path.of(getEnvProps().get(INSTALL_ROOT_PROPERTY), "lib", "bootstrap").toFile()));
}
@Override
diff --git a/nucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/RespawnInfo.java b/nucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/RespawnInfo.java
index fb9d0d99b11..2d66f475406 100644
--- a/nucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/RespawnInfo.java
+++ b/nucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/RespawnInfo.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2024 Contributors to the Eclipse Foundation
* Copyright (c) 2008, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -24,28 +25,31 @@
*/
class RespawnInfo {
- private String classname;
- private String classpath;
- private String[] args;
+ private final String classname;
+ private final String classpath;
+ private final String modulepath;
+ private final String[] args;
private static final String PREFIX = "-asadmin-";
private static final String SEPARATOR = ",,,";
- RespawnInfo(String cn, String cp, String[] a) {
- classname = cn;
- classpath = cp;
+ RespawnInfo(String cn, String modulepath, String cp, String[] args) {
+ this.classname = cn;
+ this.classpath = cp;
+ this.modulepath = modulepath;
- if (a == null) {
- a = new String[0];
+ if (args == null) {
+ args = new String[0];
}
- args = a;
+ this.args = args;
}
void put(Map map) throws GFLauncherException {
validate();
map.put(PREFIX + "classname", classname);
map.put(PREFIX + "classpath", classpath);
+ map.put(PREFIX + "modulepath", modulepath);
putArgs(map);
}
diff --git a/nucleus/admin/server-mgmt/src/main/java/com/sun/enterprise/admin/servermgmt/cli/StartDomainCommand.java b/nucleus/admin/server-mgmt/src/main/java/com/sun/enterprise/admin/servermgmt/cli/StartDomainCommand.java
index 0449e383d67..f3f08a664b6 100644
--- a/nucleus/admin/server-mgmt/src/main/java/com/sun/enterprise/admin/servermgmt/cli/StartDomainCommand.java
+++ b/nucleus/admin/server-mgmt/src/main/java/com/sun/enterprise/admin/servermgmt/cli/StartDomainCommand.java
@@ -220,7 +220,7 @@ public void createLauncher() throws GFLauncherException, MiniXmlParserException
launchParameters.setWatchdog(watchdog);
launchParameters.setDropInterruptedCommands(drop_interrupted_commands);
- launchParameters.setRespawnInfo(programOpts.getClassName(), programOpts.getClassPath(), respawnArgs());
+ launchParameters.setRespawnInfo(programOpts.getClassName(), programOpts.getModulePath(), programOpts.getClassPath(), respawnArgs());
glassFishLauncher.setup();
}
diff --git a/nucleus/cluster/admin/src/main/java/com/sun/enterprise/v3/admin/cluster/NodeUtils.java b/nucleus/cluster/admin/src/main/java/com/sun/enterprise/v3/admin/cluster/NodeUtils.java
index cbaf592102f..1192347a477 100644
--- a/nucleus/cluster/admin/src/main/java/com/sun/enterprise/v3/admin/cluster/NodeUtils.java
+++ b/nucleus/cluster/admin/src/main/java/com/sun/enterprise/v3/admin/cluster/NodeUtils.java
@@ -71,7 +71,7 @@ public class NodeUtils {
static final String PARAM_TYPE = "type";
static final String PARAM_INSTALL = "install";
public static final String PARAM_WINDOWS_DOMAIN = "windowsdomain";
- static final String LANDMARK_FILE = "glassfish/modules/admin-cli.jar";
+ static final String LANDMARK_FILE = "glassfish/admin-cli.jar";
private static final String NL = System.lineSeparator();
private TokenResolver resolver = null;
private Logger logger = null;
diff --git a/nucleus/cluster/cli/pom.xml b/nucleus/cluster/cli/pom.xml
index 749d402f1e9..103af3067fe 100755
--- a/nucleus/cluster/cli/pom.xml
+++ b/nucleus/cluster/cli/pom.xml
@@ -124,23 +124,5 @@
-
-
- maven-jar-plugin
-
-
-
-
- ../../modules/cluster-common.jar
- ../../modules/cluster-ssh.jar
- ../../modules/config-api.jar
- ../../modules/internal-api.jar
- ../../modules/config-types.jar
- ../../modules/shoal-gms-impl.jar
-
-
-
-
-
diff --git a/nucleus/cluster/cli/src/main/java/com/sun/enterprise/admin/cli/cluster/StartLocalInstanceCommand.java b/nucleus/cluster/cli/src/main/java/com/sun/enterprise/admin/cli/cluster/StartLocalInstanceCommand.java
index 1e1cad3d65a..3d609a394ca 100644
--- a/nucleus/cluster/cli/src/main/java/com/sun/enterprise/admin/cli/cluster/StartLocalInstanceCommand.java
+++ b/nucleus/cluster/cli/src/main/java/com/sun/enterprise/admin/cli/cluster/StartLocalInstanceCommand.java
@@ -195,20 +195,18 @@ protected int executeCommand() throws CommandException {
* Sets the launcher and info fields.
*/
@Override
- public void createLauncher()
- throws GFLauncherException, MiniXmlParserException {
- setLauncher(GFLauncherFactory.getInstance(getType()));
- setInfo(getLauncher().getInfo());
- getInfo().setInstanceName(instanceName);
- getInfo().setInstanceRootDir(instanceDir);
- getInfo().setVerbose(verbose);
- getInfo().setWatchdog(watchdog);
- getInfo().setDebug(debug);
- getInfo().setRespawnInfo(programOpts.getClassName(),
- programOpts.getClassPath(),
- respawnArgs());
-
- getLauncher().setup();
+ public void createLauncher() throws GFLauncherException, MiniXmlParserException {
+ setLauncher(GFLauncherFactory.getInstance(getType()));
+ setInfo(getLauncher().getInfo());
+ getInfo().setInstanceName(instanceName);
+ getInfo().setInstanceRootDir(instanceDir);
+ getInfo().setVerbose(verbose);
+ getInfo().setWatchdog(watchdog);
+ getInfo().setDebug(debug);
+ getInfo().setRespawnInfo(programOpts.getClassName(), programOpts.getModulePath(), programOpts.getClassPath(),
+ respawnArgs());
+
+ getLauncher().setup();
}
/**
diff --git a/nucleus/cluster/gms-adapter/pom.xml b/nucleus/cluster/gms-adapter/pom.xml
index cb039e26223..f7ac9a2640c 100644
--- a/nucleus/cluster/gms-adapter/pom.xml
+++ b/nucleus/cluster/gms-adapter/pom.xml
@@ -93,16 +93,6 @@
-
- maven-jar-plugin
-
-
-
- shoal-gms-impl.jar
-
-
-
-
diff --git a/nucleus/common/common-util/src/main/java/com/sun/enterprise/universal/process/JavaClassRunner.java b/nucleus/common/common-util/src/main/java/com/sun/enterprise/universal/process/JavaClassRunner.java
index 4a48cf172ee..76d47217789 100644
--- a/nucleus/common/common-util/src/main/java/com/sun/enterprise/universal/process/JavaClassRunner.java
+++ b/nucleus/common/common-util/src/main/java/com/sun/enterprise/universal/process/JavaClassRunner.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -48,14 +48,14 @@ public class JavaClassRunner {
}
final Path javaroot = Path.of(System.getProperty("java.home"));
javaExecutable = javaroot.resolve("bin").resolve(javaName);
- }
-
- public JavaClassRunner(String classpath, String[] sysprops, String classname, String[] args) throws IOException {
- if (javaExecutable == null) {
- throw new IOException("Can not find a jvm");
+ if (!javaExecutable.toFile().canExecute()) {
+ throw new Error(javaExecutable + " is not an existing executable file.");
}
+ }
- if (!isEmpty(classname)) {
+ public JavaClassRunner(String modulepath, String classpath, String[] sysprops, String classname, String[] args)
+ throws IOException {
+ if (!isSet(classname)) {
throw new IllegalArgumentException("classname was null");
}
@@ -64,7 +64,13 @@ public JavaClassRunner(String classpath, String[] sysprops, String classname, St
cmdline.add("nohup");
}
cmdline.add(javaExecutable.toString());
- if (isEmpty(classpath)) {
+ if (isSet(modulepath)) {
+ cmdline.add("--module-path");
+ cmdline.add(modulepath);
+ cmdline.add("--add-modules");
+ cmdline.add("ALL-MODULE-PATH");
+ }
+ if (isSet(classpath)) {
cmdline.add("-cp");
cmdline.add(classpath);
}
@@ -97,7 +103,7 @@ public void run() throws IOException {
}
}
- private boolean isEmpty(String s) {
+ private boolean isSet(String s) {
return s != null && !s.isEmpty();
}
}
diff --git a/nucleus/core/bootstrap/src/main/java/com/sun/enterprise/glassfish/bootstrap/GlassFishMain.java b/nucleus/core/bootstrap/src/main/java/com/sun/enterprise/glassfish/bootstrap/GlassFishMain.java
index 359ba83409c..d52e5f11835 100644
--- a/nucleus/core/bootstrap/src/main/java/com/sun/enterprise/glassfish/bootstrap/GlassFishMain.java
+++ b/nucleus/core/bootstrap/src/main/java/com/sun/enterprise/glassfish/bootstrap/GlassFishMain.java
@@ -101,6 +101,7 @@ private static Properties initProperties(String[] args) {
map.put("default", args[i]);
}
}
+ // no sense doing this if we were started by CLI...
if (!wasStartedByCLI(map)) {
for (int i = 0; i < args.length; i++) {
if (i > 0) {
@@ -109,9 +110,9 @@ private static Properties initProperties(String[] args) {
sb.append(args[i]);
}
map.setProperty(BootstrapKeys.ORIGINAL_ARGS, sb.toString());
- // no sense doing this if we were started by CLI...
map.setProperty(BootstrapKeys.ORIGINAL_CP, System.getProperty("java.class.path"));
map.setProperty(BootstrapKeys.ORIGINAL_CN, GlassFishMain.class.getName());
+ map.setProperty(BootstrapKeys.ORIGINAL_MP, System.getProperty("jdk.module.path"));
}
return map;
}
diff --git a/nucleus/core/bootstrap/src/main/java/com/sun/enterprise/glassfish/bootstrap/cfg/BootstrapKeys.java b/nucleus/core/bootstrap/src/main/java/com/sun/enterprise/glassfish/bootstrap/cfg/BootstrapKeys.java
index e6f2331ea14..1eb2182de0a 100644
--- a/nucleus/core/bootstrap/src/main/java/com/sun/enterprise/glassfish/bootstrap/cfg/BootstrapKeys.java
+++ b/nucleus/core/bootstrap/src/main/java/com/sun/enterprise/glassfish/bootstrap/cfg/BootstrapKeys.java
@@ -26,10 +26,12 @@ public final class BootstrapKeys {
/** bundle containing module startup */
public static final String GF_KERNEL = "org.glassfish.core.kernel";
+ public static final String ASADMIN_MP = "-asadmin-modulepath";
public static final String ASADMIN_CP = "-asadmin-classpath";
public static final String ASADMIN_CN = "-asadmin-classname";
public static final String ASADMIN_ARGS = "-asadmin-args";
+ public static final String ORIGINAL_MP = "-startup-modulepath";
public static final String ORIGINAL_CP = "-startup-classpath";
public static final String ORIGINAL_CN = "-startup-classname";
public static final String ORIGINAL_ARGS = "-startup-args";
diff --git a/nucleus/core/bootstrap/src/main/java/com/sun/enterprise/glassfish/bootstrap/launch/GlassfishOsgiBootstrapClassLoader.java b/nucleus/core/bootstrap/src/main/java/com/sun/enterprise/glassfish/bootstrap/launch/GlassfishOsgiBootstrapClassLoader.java
index 73548358a33..24b8ad1a784 100644
--- a/nucleus/core/bootstrap/src/main/java/com/sun/enterprise/glassfish/bootstrap/launch/GlassfishOsgiBootstrapClassLoader.java
+++ b/nucleus/core/bootstrap/src/main/java/com/sun/enterprise/glassfish/bootstrap/launch/GlassfishOsgiBootstrapClassLoader.java
@@ -72,8 +72,8 @@ public void launchGlassFishServer(final Properties properties) {
private static URL[] createUrls(final File glassfishDir) throws IOException {
final List urls = new ArrayList<>();
- final File libDir = glassfishDir.toPath().resolve(Path.of("lib", "bootstrap")).toFile();
- urls.add(getURL(libDir, "glassfish-osgi-bootstrap"));
+ final File moduleDir = glassfishDir.toPath().resolve(Path.of("modules")).toFile();
+ urls.add(getURL(moduleDir, "glassfish-osgi-bootstrap"));
return urls.toArray(URL[]::new);
}
diff --git a/nucleus/core/kernel/src/main/java/com/sun/enterprise/v3/admin/RestartServer.java b/nucleus/core/kernel/src/main/java/com/sun/enterprise/v3/admin/RestartServer.java
index 5eb65d270f2..90c9f317e17 100644
--- a/nucleus/core/kernel/src/main/java/com/sun/enterprise/v3/admin/RestartServer.java
+++ b/nucleus/core/kernel/src/main/java/com/sun/enterprise/v3/admin/RestartServer.java
@@ -52,11 +52,13 @@ public class RestartServer {
private Properties props;
private Logger logger;
private boolean verbose;
+ private String modulepath;
private String classpath;
private String classname;
private String argsString;
private String[] args;
private String serverName = "";
+
private static final LocalStringsImpl strings = new LocalStringsImpl(RestartServer.class);
private static final String magicProperty = "-DAS_RESTART=" + ProcessHandle.current().pid();
private static final String[] normalProps = { magicProperty };
@@ -151,7 +153,7 @@ private void doReincarnation() throws RDCException {
sysProps = normalProps;
}
- JavaClassRunner runner = new JavaClassRunner(classpath, sysProps, classname, args);
+ JavaClassRunner runner = new JavaClassRunner(modulepath, classpath, sysProps, classname, args);
runner.run();
} catch (Exception e) {
throw new RDCException(e);
@@ -159,6 +161,7 @@ private void doReincarnation() throws RDCException {
}
private boolean setupReincarnationWithAsadmin() throws RDCException {
+ modulepath = props.getProperty(BootstrapKeys.ASADMIN_MP);
classpath = props.getProperty(BootstrapKeys.ASADMIN_CP);
classname = props.getProperty(BootstrapKeys.ASADMIN_CN);
argsString = props.getProperty(BootstrapKeys.ASADMIN_ARGS);
@@ -167,7 +170,7 @@ private boolean setupReincarnationWithAsadmin() throws RDCException {
}
private boolean setupReincarnationWithOther() throws RDCException {
-
+ modulepath = props.getProperty(BootstrapKeys.ORIGINAL_MP);
classpath = props.getProperty(BootstrapKeys.ORIGINAL_CP);
classname = props.getProperty(BootstrapKeys.ORIGINAL_CN);
argsString = props.getProperty(BootstrapKeys.ORIGINAL_ARGS);
@@ -283,7 +286,7 @@ private void stripOperandFromArgs() {
}
private boolean ok(String s) {
- return s != null && s.length() > 0;
+ return s != null && !s.isEmpty();
}
// We use this simply to tell the difference between fatal errors and other
diff --git a/nucleus/distributions/atomic/src/main/assembly/atomic.xml b/nucleus/distributions/atomic/src/main/assembly/atomic.xml
index bd585499e9a..572461982c9 100644
--- a/nucleus/distributions/atomic/src/main/assembly/atomic.xml
+++ b/nucleus/distributions/atomic/src/main/assembly/atomic.xml
@@ -75,7 +75,6 @@
${temp.dir}
glassfish.jar
- glassfish-osgi-bootstrap.jar
glassfish-jdk-extensions.jar
glassfish-jul-extension.jar
simple-glassfish-api.jar
@@ -83,6 +82,15 @@
${install.dir.name}/lib/bootstrap
+
+
+ ${temp.dir}
+
+ admin-cli.jar
+
+ ${install.dir.name}
+
+
${temp.dir}
@@ -131,6 +139,7 @@
*.jar
+ admin-cli.jar
server-mgmt.jar
osgi-cli-interactive.jar
flashlight-agent.jar
@@ -145,7 +154,6 @@
felix.jar
nucleus-domain.jar
glassfish.jar
- glassfish-osgi-bootstrap.jar
glassfish-jdk-extensions.jar
glassfish-jul-extension.jar
simple-glassfish-api.jar
diff --git a/nucleus/distributions/nucleus-common/src/main/resources/bin/nadmin b/nucleus/distributions/nucleus-common/src/main/resources/bin/nadmin
index 9cfd62ed4c4..afd2a85244a 100644
--- a/nucleus/distributions/nucleus-common/src/main/resources/bin/nadmin
+++ b/nucleus/distributions/nucleus-common/src/main/resources/bin/nadmin
@@ -21,9 +21,12 @@ case "`uname`" in
CYGWIN*) AS_INSTALL=`cygpath --windows $AS_INSTALL`
esac
. "${AS_INSTALL}/config/asenv.conf"
+
JAVA=java
#Depends upon Java from asenv.conf
if [ ${AS_JAVA} ]; then
JAVA=${AS_JAVA}/bin/java
fi
-exec "$JAVA" -Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager -jar "$AS_INSTALL/modules/admin-cli.jar" "$@"
+
+ASADMIN_CLASSPATH="$AS_INSTALL/admin-cli.jar:$AS_INSTALL/modules/*"
+exec "$JAVA" "${ASADMIN_JVM_OPTIONS}" --module-path "${ASADMIN_MODULEPATH}" --add-modules ALL-MODULE-PATH -cp "$ASADMIN_CLASSPATH" com.sun.enterprise.admin.cli.AdminMain "$@"
diff --git a/nucleus/distributions/nucleus-common/src/main/resources/bin/nadmin.bat b/nucleus/distributions/nucleus-common/src/main/resources/bin/nadmin.bat
index 1e628a33f68..84ea758a195 100644
--- a/nucleus/distributions/nucleus-common/src/main/resources/bin/nadmin.bat
+++ b/nucleus/distributions/nucleus-common/src/main/resources/bin/nadmin.bat
@@ -1,31 +1,36 @@
-@echo off
-REM
-REM Copyright (c) 2024 Contributors to the Eclipse Foundation
-REM Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
-REM
-REM This program and the accompanying materials are made available under the
-REM terms of the Eclipse Public License v. 2.0, which is available at
-REM http://www.eclipse.org/legal/epl-2.0.
-REM
-REM This Source Code may also be made available under the following Secondary
-REM Licenses when the conditions for such availability set forth in the
-REM Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
-REM version 2 with the GNU Classpath Exception, which is available at
-REM https://www.gnu.org/software/classpath/license.html.
-REM
-REM SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-REM
-VERIFY OTHER 2>nul
-setlocal ENABLEEXTENSIONS
-if ERRORLEVEL 0 goto ok
-echo "Unable to enable extensions"
-exit /B 1
-:ok
-call "%~dp0..\config\asenv.bat"
-if "%AS_JAVA%x" == "x" goto UsePath
-set JAVA="%AS_JAVA%\bin\java"
-goto run
-:UsePath
-set JAVA=java
-:run
-%JAVA% "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "%AS_INSTALL%\modules\admin-cli.jar" %*
+@echo off
+REM
+REM Copyright (c) 2024 Contributors to the Eclipse Foundation
+REM Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
+REM
+REM This program and the accompanying materials are made available under the
+REM terms of the Eclipse Public License v. 2.0, which is available at
+REM http://www.eclipse.org/legal/epl-2.0.
+REM
+REM This Source Code may also be made available under the following Secondary
+REM Licenses when the conditions for such availability set forth in the
+REM Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+REM version 2 with the GNU Classpath Exception, which is available at
+REM https://www.gnu.org/software/classpath/license.html.
+REM
+REM SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+REM
+
+VERIFY OTHER 2>nul
+setlocal ENABLEEXTENSIONS
+if ERRORLEVEL 0 goto ok
+echo "Unable to enable extensions"
+exit /B 1
+
+:ok
+call "%~dp0..\config\asenv.bat"
+if "%AS_JAVA%x" == "x" goto UsePath
+set JAVA="%AS_JAVA%\bin\java"
+goto run
+
+:UsePath
+set JAVA=java
+
+:run
+set ASADMIN_CLASSPATH="%AS_INSTALL%/admin-cli.jar:%AS_INSTALL%/modules/*"
+%JAVA% "%ASADMIN_JVM_OPTIONS%" --module-path "%ASADMIN_MODULEPATH%" --add-modules ALL-MODULE-PATH -cp "%ASADMIN_CLASSPATH%" com.sun.enterprise.admin.cli.AdminMain %*
diff --git a/nucleus/distributions/nucleus-common/src/main/resources/bin/startserv b/nucleus/distributions/nucleus-common/src/main/resources/bin/startserv
index b729e5ba6a9..7afb22a1065 100644
--- a/nucleus/distributions/nucleus-common/src/main/resources/bin/startserv
+++ b/nucleus/distributions/nucleus-common/src/main/resources/bin/startserv
@@ -20,17 +20,19 @@ AS_INSTALL=`dirname "$0"`/..
case "`uname`" in
CYGWIN*) AS_INSTALL=`cygpath --windows $AS_INSTALL`
esac
-AS_INSTALL_LIB="$AS_INSTALL/modules"
. "${AS_INSTALL}/config/asenv.conf"
+
JAVA=java
#Depends upon Java from ../config/asenv.conf
if [ ${AS_JAVA} ]; then
JAVA=${AS_JAVA}/bin/java
fi
+ASADMIN_CLASSPATH="$AS_INSTALL/admin-cli.jar:$AS_INSTALL/modules/*"
+
start_as_main_process () {
if [[ "$@" == "--help" ]] || [[ "$@" == "--help=true" ]] || [[ "$@" == "-?" ]]; then
- exec java "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "$ASADMIN_JAR" start-domain --help
+ exec "$JAVA" "${ASADMIN_JVM_OPTIONS}" --module-path "${ASADMIN_MODULEPATH}" --add-modules ALL-MODULE-PATH -cp "$ASADMIN_CLASSPATH" com.sun.enterprise.admin.cli.AdminMain start-domain --help
fi
# Execute start-domain --dry-run and store the output line by line into an array.
@@ -50,7 +52,7 @@ start_as_main_process () {
else
DRY_RUN_OUTPUT+=("$COM");
fi
- done < <(java "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "$ASADMIN_JAR" start-domain --dry-run "$@" || echo "FAILED" )
+ done < <("$JAVA" "${ASADMIN_JVM_OPTIONS}" --module-path "${ASADMIN_MODULEPATH}" --add-modules ALL-MODULE-PATH -cp "$ASADMIN_CLASSPATH" com.sun.enterprise.admin.cli.AdminMain start-domain --dry-run "$@" || echo "FAILED")
if [[ x"$DRY_RUN_OUTPUT" == x ]]
then
echo -n -e "${DRY_RUN_OUTPUT_BEFORE_DUMP}" >&2
@@ -65,7 +67,6 @@ start_as_main_process () {
}
-ASADMIN_JAR="$AS_INSTALL_LIB/admin-cli.jar"
start_as_main_process "$@"
# Alternatively, run the following:
diff --git a/nucleus/distributions/nucleus-common/src/main/resources/bin/startserv.bat b/nucleus/distributions/nucleus-common/src/main/resources/bin/startserv.bat
index c83f7ce9b01..b50ca87989d 100644
--- a/nucleus/distributions/nucleus-common/src/main/resources/bin/startserv.bat
+++ b/nucleus/distributions/nucleus-common/src/main/resources/bin/startserv.bat
@@ -16,5 +16,21 @@ REM
REM SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
REM
+VERIFY OTHER 2>nul
+setlocal ENABLEEXTENSIONS
+if ERRORLEVEL 0 goto ok
+echo "Unable to enable extensions"
+exit /B 1
-java "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "%~dp0..\modules\admin-cli.jar" start-domain --verbose %*
+:ok
+call "%~dp0..\config\asenv.bat"
+if "%AS_JAVA%x" == "x" goto UsePath
+set JAVA="%AS_JAVA%\bin\java"
+goto run
+
+:UsePath
+set JAVA=java
+
+:run
+set ASADMIN_CLASSPATH="%AS_INSTALL%/admin-cli.jar:%AS_INSTALL%/modules/*"
+%JAVA% "%ASADMIN_JVM_OPTIONS%" --module-path "%ASADMIN_MODULEPATH%" --add-modules ALL-MODULE-PATH -cp "%ASADMIN_CLASSPATH%" com.sun.enterprise.admin.cli.AdminMain start-domain --verbose %*
diff --git a/nucleus/distributions/nucleus-common/src/main/resources/bin/stopserv b/nucleus/distributions/nucleus-common/src/main/resources/bin/stopserv
index d6b9421a3ee..02014ede1e0 100644
--- a/nucleus/distributions/nucleus-common/src/main/resources/bin/stopserv
+++ b/nucleus/distributions/nucleus-common/src/main/resources/bin/stopserv
@@ -17,6 +17,5 @@
#
AS_INSTALL=`dirname "$0"`/..
-AS_INSTALL_LIB="$AS_INSTALL/modules"
-exec java "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "$AS_INSTALL_LIB/admin-cli.jar" stop-domain "$@"
+exec java "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "$AS_INSTALL/admin-cli.jar" stop-domain "$@"
diff --git a/nucleus/distributions/nucleus-common/src/main/resources/bin/stopserv.bat b/nucleus/distributions/nucleus-common/src/main/resources/bin/stopserv.bat
index 7a506976488..0f10d2bfad9 100644
--- a/nucleus/distributions/nucleus-common/src/main/resources/bin/stopserv.bat
+++ b/nucleus/distributions/nucleus-common/src/main/resources/bin/stopserv.bat
@@ -1,20 +1,20 @@
-@echo off
-REM
-REM Copyright (c) 2024 Contributors to the Eclipse Foundation
-REM Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
-REM
-REM This program and the accompanying materials are made available under the
-REM terms of the Eclipse Public License v. 2.0, which is available at
-REM http://www.eclipse.org/legal/epl-2.0.
-REM
-REM This Source Code may also be made available under the following Secondary
-REM Licenses when the conditions for such availability set forth in the
-REM Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
-REM version 2 with the GNU Classpath Exception, which is available at
-REM https://www.gnu.org/software/classpath/license.html.
-REM
-REM SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-REM
-
-
-java "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "%~dp0..\modules\admin-cli.jar" stop-domain %*
+@echo off
+REM
+REM Copyright (c) 2024 Contributors to the Eclipse Foundation
+REM Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
+REM
+REM This program and the accompanying materials are made available under the
+REM terms of the Eclipse Public License v. 2.0, which is available at
+REM http://www.eclipse.org/legal/epl-2.0.
+REM
+REM This Source Code may also be made available under the following Secondary
+REM Licenses when the conditions for such availability set forth in the
+REM Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+REM version 2 with the GNU Classpath Exception, which is available at
+REM https://www.gnu.org/software/classpath/license.html.
+REM
+REM SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+REM
+
+
+java "-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager" -jar "%~dp0..\admin-cli.jar" stop-domain %*
diff --git a/nucleus/distributions/nucleus-common/src/main/resources/config/asenv.bat b/nucleus/distributions/nucleus-common/src/main/resources/config/asenv.bat
index 20642050f73..d43288cb854 100644
--- a/nucleus/distributions/nucleus-common/src/main/resources/config/asenv.bat
+++ b/nucleus/distributions/nucleus-common/src/main/resources/config/asenv.bat
@@ -45,3 +45,6 @@ set AS_INSTALL=..
set AS_DEF_DOMAINS_PATH=..\domains
set AS_DEF_NODES_PATH=..\nodes
set AS_DERBY_INSTALL=..\..\javadb
+
+set ASADMIN_MODULEPATH="%AS_INSTALL%/lib/bootstrap"
+set ASADMIN_JVM_OPTIONS="-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager"
diff --git a/nucleus/distributions/nucleus-common/src/main/resources/config/asenv.conf b/nucleus/distributions/nucleus-common/src/main/resources/config/asenv.conf
index 53793cb53cb..a7052fe9950 100644
--- a/nucleus/distributions/nucleus-common/src/main/resources/config/asenv.conf
+++ b/nucleus/distributions/nucleus-common/src/main/resources/config/asenv.conf
@@ -44,3 +44,6 @@ AS_INSTALL="${AS_INSTALL:-..}"
AS_DEF_DOMAINS_PATH="${AS_DEF_DOMAINS_PATH:-../domains}"
AS_DEF_NODES_PATH="${AS_DEF_NODES_PATH:-../nodes}"
AS_DERBY_INSTALL="${AS_DERBY_INSTALL:-../../javadb}"
+
+ASADMIN_MODULEPATH="${AS_INSTALL}/lib/bootstrap"
+ASADMIN_JVM_OPTIONS="-Djava.util.logging.manager=org.glassfish.main.jul.GlassFishLogManager"
diff --git a/nucleus/distributions/nucleus-common/src/main/resources/config/osgi.properties b/nucleus/distributions/nucleus-common/src/main/resources/config/osgi.properties
index bd5744cacc4..20a74f553a3 100755
--- a/nucleus/distributions/nucleus-common/src/main/resources/config/osgi.properties
+++ b/nucleus/distributions/nucleus-common/src/main/resources/config/osgi.properties
@@ -100,7 +100,7 @@ com.sun.enterprise.hk2.cacheDir=${org.osgi.framework.storage}
# Then we autostart GlassFish core bundles followed by optional services.
# The reason for using installRootURI is to make sure any char like white space is properly encoded.
glassfish.osgi.auto.install=\
- ${com.sun.aas.installRootURI}lib/bootstrap/glassfish-osgi-bootstrap.jar \
+ ${com.sun.aas.installRootURI}modules/glassfish-osgi-bootstrap.jar \
${com.sun.aas.installRootURI}modules/osgi-resource-locator.jar \
${com.sun.aas.installRootURI}modules/ \
${com.sun.aas.installRootURI}modules/autostart/
@@ -131,7 +131,7 @@ hk2.bundles=\
core.bundles=\
${hk2.bundles} \
- ${com.sun.aas.installRootURI}lib/bootstrap/glassfish-osgi-bootstrap.jar
+ ${com.sun.aas.installRootURI}modules/glassfish-osgi-bootstrap.jar
autostart.bundles=${com.sun.aas.installRootURI}modules/autostart/
diff --git a/nucleus/distributions/nucleus/src/main/assembly/nucleus-new.xml b/nucleus/distributions/nucleus/src/main/assembly/nucleus-new.xml
index ae7d1e9f305..b689e216c5d 100644
--- a/nucleus/distributions/nucleus/src/main/assembly/nucleus-new.xml
+++ b/nucleus/distributions/nucleus/src/main/assembly/nucleus-new.xml
@@ -65,8 +65,16 @@
${install.dir.name}/lib/schemas
-
+
+
+ ${temp.dir}
+
+ admin-cli.jar
+
+ ${install.dir.name}
+
+
${temp.dir}
@@ -100,7 +108,6 @@
${temp.dir}
glassfish.jar
- glassfish-osgi-bootstrap.jar
glassfish-jdk-extensions.jar
glassfish-jul-extension.jar
simple-glassfish-api.jar
@@ -136,6 +143,7 @@
*.jar
+ admin-cli.jar
server-mgmt.jar
osgi-cli-interactive.jar
flashlight-agent.jar
@@ -148,7 +156,6 @@
org.osgi.util.function.jar
org.osgi.util.promise.jar
glassfish.jar
- glassfish-osgi-bootstrap.jar
glassfish-jdk-extensions.jar
glassfish-jul-extension.jar
simple-glassfish-api.jar
diff --git a/nucleus/osgi-platforms/felix/src/main/resources/config/osgi.properties b/nucleus/osgi-platforms/felix/src/main/resources/config/osgi.properties
index bd5744cacc4..20a74f553a3 100755
--- a/nucleus/osgi-platforms/felix/src/main/resources/config/osgi.properties
+++ b/nucleus/osgi-platforms/felix/src/main/resources/config/osgi.properties
@@ -100,7 +100,7 @@ com.sun.enterprise.hk2.cacheDir=${org.osgi.framework.storage}
# Then we autostart GlassFish core bundles followed by optional services.
# The reason for using installRootURI is to make sure any char like white space is properly encoded.
glassfish.osgi.auto.install=\
- ${com.sun.aas.installRootURI}lib/bootstrap/glassfish-osgi-bootstrap.jar \
+ ${com.sun.aas.installRootURI}modules/glassfish-osgi-bootstrap.jar \
${com.sun.aas.installRootURI}modules/osgi-resource-locator.jar \
${com.sun.aas.installRootURI}modules/ \
${com.sun.aas.installRootURI}modules/autostart/
@@ -131,7 +131,7 @@ hk2.bundles=\
core.bundles=\
${hk2.bundles} \
- ${com.sun.aas.installRootURI}lib/bootstrap/glassfish-osgi-bootstrap.jar
+ ${com.sun.aas.installRootURI}modules/glassfish-osgi-bootstrap.jar
autostart.bundles=${com.sun.aas.installRootURI}modules/autostart/
diff --git a/nucleus/osgi-platforms/osgi-cli-interactive/src/main/java/org/glassfish/osgi/cli/interactive/LocalOSGiShellCommand.java b/nucleus/osgi-platforms/osgi-cli-interactive/src/main/java/org/glassfish/osgi/cli/interactive/LocalOSGiShellCommand.java
index 2dc210fe511..24029925027 100644
--- a/nucleus/osgi-platforms/osgi-cli-interactive/src/main/java/org/glassfish/osgi/cli/interactive/LocalOSGiShellCommand.java
+++ b/nucleus/osgi-platforms/osgi-cli-interactive/src/main/java/org/glassfish/osgi/cli/interactive/LocalOSGiShellCommand.java
@@ -357,6 +357,7 @@ private int executeCommands(LineReader reader) throws CommandException {
*/
final ProgramOptions programOptions = new ProgramOptions(env);
// copy over AsadminMain info
+ programOptions.setModulePath(programOpts.getModulePath());
programOptions.setClassPath(programOpts.getClassPath());
programOptions.setClassName(programOpts.getClassName());
// remove the old one and replace it