Merge pull request #23901 from dmatej/sync-6.x-to-master220412

Sync 6.x to master220412 + Fixed OSGI Shell
diff --git a/README.md b/README.md
index e5da273..9ece752 100644
--- a/README.md
+++ b/README.md
@@ -24,7 +24,7 @@
 ### Prerequisites
 
 * JDK11+
-* Maven 3.5.4+
+* Maven 3.6.0+
 
 ### Execution
 
@@ -84,8 +84,6 @@
 * `./runtests.sh web_jsp` - Usual time: 8 minutes
 * `./runtests.sh webservice_all` - Usual time: 10 minutes
 * `./gfbuild.sh archive_bundles && ./gftest.sh ejb_web_all` - Usual time: 4 minutes
-* `./gfbuild.sh archive_bundles && ./gftest.sh nucleus_admin_all` - Not fixed yet
-* `./gfbuild.sh archive_bundles && ./gftest.sh ql_gf_nucleus_all` - Not fixed yet
 * `./gfbuild.sh archive_bundles && ./gftest.sh ql_gf_web_profile_all` - Usual time: 2 minutes
 * `./gfbuild.sh archive_bundles && ./gftest.sh ql_gf_full_profile_all` - Usual time: 4 minutes
 
diff --git a/appserver/admingui/jms-plugin/src/main/java/org/glassfish/admingui/plugin/jms/JmsHandlers.java b/appserver/admingui/jms-plugin/src/main/java/org/glassfish/admingui/plugin/jms/JmsHandlers.java
index 3167649..4024b75 100644
--- a/appserver/admingui/jms-plugin/src/main/java/org/glassfish/admingui/plugin/jms/JmsHandlers.java
+++ b/appserver/admingui/jms-plugin/src/main/java/org/glassfish/admingui/plugin/jms/JmsHandlers.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2009, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -138,7 +139,7 @@
         Map valueMap = new HashMap();
         try {
             String objectName = getJmsDestinationObjectName(SUBTYPE_CONFIG, name, type);
-            AttributeList attributes = (AttributeList) JMXUtil.getMBeanServer().getAttributes(new ObjectName(objectName), ATTRS_CONFIG);
+            AttributeList attributes = JMXUtil.getMBeanServer().getAttributes(new ObjectName(objectName), ATTRS_CONFIG);
             for (Attribute attribute : attributes.asList()) {
                 valueMap.put(attribute.getName(), (attribute.getValue() != null) ? attribute.getValue().toString() : null);
             }
@@ -168,7 +169,7 @@
             insureJmsBrokerIsRunning();
 
             String objectName = getJmsDestinationObjectName(SUBTYPE_MONITOR, name, type);
-            AttributeList attributes = (AttributeList) getMBeanServerConnection(target).getAttributes(new ObjectName(objectName), ATTRS_MONITOR);
+            AttributeList attributes = getMBeanServerConnection(target).getAttributes(new ObjectName(objectName), ATTRS_MONITOR);
             ResourceBundle bundle = GuiUtil.getBundle("org.glassfish.jms.admingui.Strings");
             statsList.add(createRow("Name", name, ""));
             statsList.add(createRow("Type", type.substring(0, 1).toUpperCase(GuiUtil.guiLocale) + type.substring(1), ""));
@@ -208,12 +209,12 @@
             List<Map> selectedList = (List) handlerCtx.getInputValue("selectedRows");
             boolean hasOrig = (selectedList == null || selectedList.size() == 0) ? false : true;
 
-            for (int i = 0; i < objectNames.length; i++) {
+            for (ObjectName objectName : objectNames) {
                 // getAttributes for the given objectName...
                 HashMap oneRow = new HashMap();
-                oneRow.put("name", objectNames[i].getKeyProperty(PROP_NAME).replaceAll("\"", ""));
-                oneRow.put("type", "t".equals(objectNames[i].getKeyProperty(PROP_DEST_TYPE)) ? "topic" : "queue");
-                oneRow.put("selected", (hasOrig) ? isSelected(objectNames[i].getKeyProperty(PROP_NAME), selectedList) : false);
+                oneRow.put("name", objectName.getKeyProperty(PROP_NAME).replaceAll("\"", ""));
+                oneRow.put("type", "t".equals(objectName.getKeyProperty(PROP_DEST_TYPE)) ? "topic" : "queue");
+                oneRow.put("selected", (hasOrig) ? isSelected(objectName.getKeyProperty(PROP_NAME), selectedList) : false);
                 result.add(oneRow);
             }
 
@@ -287,7 +288,7 @@
     public static void deleteJMSDest(HandlerContext handlerCtx) {
 //        String configName = ((String) handlerCtx.getInputValue("targetName"));
         List obj = (List) handlerCtx.getInputValue("selectedRows");
-        List<Map> selectedRows = (List) obj;
+        List<Map> selectedRows = obj;
         try {
             for (Map oneRow : selectedRows) {
                 String name = (String) oneRow.get("name");
@@ -403,7 +404,7 @@
         list.add(new Attribute(ATTR_MAX_NUM_MSGS, Long.parseLong((String) attrMap.get(ATTR_MAX_NUM_MSGS))));
         list.add(new Attribute(ATTR_MAX_BYTES_PER_MSG, Long.parseLong((String) attrMap.get(ATTR_MAX_BYTES_PER_MSG))));
         list.add(new Attribute(ATTR_MAX_TOTAL_MSG_BYTES, Long.parseLong((String) attrMap.get(ATTR_MAX_TOTAL_MSG_BYTES))));
-        list.add(new Attribute(ATTR_LIMIT_BEHAVIOR, (String) attrMap.get(ATTR_LIMIT_BEHAVIOR)));
+        list.add(new Attribute(ATTR_LIMIT_BEHAVIOR, attrMap.get(ATTR_LIMIT_BEHAVIOR)));
         list.add(new Attribute(ATTR_MAX_NUM_PRODUCERS, Integer.parseInt((String) attrMap.get(ATTR_MAX_NUM_PRODUCERS))));
         if ("queue".equals(type)) {
             list.add(new Attribute(ATTR_MAX_NUM_ACTIVE_CONSUMERS, Integer.parseInt((String) attrMap.get(ATTR_MAX_NUM_ACTIVE_CONSUMERS))));
@@ -413,7 +414,7 @@
         list.add(new Attribute(ATTR_CONSUMER_FLOW_LIMIT, Long.parseLong((String) attrMap.get(ATTR_CONSUMER_FLOW_LIMIT))));
         list.add(new Attribute(ATTR_USE_DMQ, Boolean.valueOf((String) attrMap.get(ATTR_USE_DMQ))));
         list.add(new Attribute(ATTR_VALIDATE_XML_SCHEMA_ENABLED, Boolean.valueOf((String) attrMap.get(ATTR_VALIDATE_XML_SCHEMA_ENABLED))));
-        list.add(new Attribute(ATTR_XML_SCHEMA_URI_LIST, (String) attrMap.get(ATTR_XML_SCHEMA_URI_LIST)));
+        list.add(new Attribute(ATTR_XML_SCHEMA_URI_LIST, attrMap.get(ATTR_XML_SCHEMA_URI_LIST)));
     }
 
     protected static void insureJmsBrokerIsRunning() throws ConnectorRuntimeException {
@@ -444,14 +445,15 @@
         }
 
         PhysicalDestinations pd = new PhysicalDestinations();
-        MQJMXConnectorInfo mqInfo = pd.getConnectorInfo(target, configRef, habitat, domain);
-
-        return mqInfo.getMQMBeanServerConnection();
+        try (MQJMXConnectorInfo mqInfo = pd.createConnectorInfo(target, configRef, habitat, domain)) {
+            // fyi, the connection is just a description, not closeable.
+            return mqInfo.getMQMBeanServerConnection();
+        }
     }
 
     private static class PhysicalDestinations extends JMSDestination {
-        public MQJMXConnectorInfo getConnectorInfo(String target, String configName, ServiceLocator habitat, Domain domain) throws Exception {
-            return getMQJMXConnectorInfo(target, domain.getConfigNamed(configName), habitat.<ServerContext>getService(ServerContext.class),
+        public MQJMXConnectorInfo createConnectorInfo(String target, String configName, ServiceLocator habitat, Domain domain) throws Exception {
+            return createMQJMXConnectorInfo(target, domain.getConfigNamed(configName), habitat.<ServerContext>getService(ServerContext.class),
                 domain, habitat.<ConnectorRuntime>getService(ConnectorRuntime.class));
         }
     }
diff --git a/appserver/appclient/client/acc/src/main/java/org/glassfish/appclient/client/acc/AppClientContainer.java b/appserver/appclient/client/acc/src/main/java/org/glassfish/appclient/client/acc/AppClientContainer.java
index e860f2d..5456775 100644
--- a/appserver/appclient/client/acc/src/main/java/org/glassfish/appclient/client/acc/AppClientContainer.java
+++ b/appserver/appclient/client/acc/src/main/java/org/glassfish/appclient/client/acc/AppClientContainer.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 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
@@ -236,7 +237,7 @@
 
     private URLClassLoader classLoader = (URLClassLoader) Thread.currentThread().getContextClassLoader();
 
-    private Collection<EntityManagerFactory> emfs = null;
+    private final Collection<EntityManagerFactory> emfs = null;
 
 //    private boolean isJWS = false;
 
@@ -354,7 +355,7 @@
          * Allow pre-destroy handling to work on the main class during clean-up.
          */
         cleanup.setInjectionManager(injectionManager,
-                clientMainClassSetting.clientMainClass);
+                ClientMainClassSetting.clientMainClass);
 
         /*
          * If this app client contains persistence unit refs, then initialize
@@ -456,9 +457,10 @@
 
     private void cleanupWhenSafe() {
         if (isEDTRunning()) {
-            final AtomicReference<Thread> edt = new AtomicReference<Thread>();
+            final AtomicReference<Thread> edt = new AtomicReference<>();
             try {
                 SwingUtilities.invokeAndWait(new Runnable() {
+                    @Override
                     public void run() {
                         edt.set(Thread.currentThread());
                     }
@@ -495,7 +497,7 @@
         // String[] as the only argument
         Method result = null;
 
-        result = clientMainClassSetting.getClientMainClass(
+        result = ClientMainClassSetting.getClientMainClass(
                 classLoader,
                 injectionManager,
                 invocationManager,
@@ -726,14 +728,14 @@
      */
     public interface Builder {
 
-        public AppClientContainer newContainer(URI archiveURI) throws Exception, UserError;
+        AppClientContainer newContainer(URI archiveURI) throws Exception, UserError;
 
-        public AppClientContainer newContainer(URI archiveURI,
+        AppClientContainer newContainer(URI archiveURI,
                 CallbackHandler callbackHandler,
                 String mainClassName,
                 String appName) throws Exception, UserError;
 
-        public AppClientContainer newContainer(URI archiveURI,
+        AppClientContainer newContainer(URI archiveURI,
                 CallbackHandler callbackHandler,
                 String mainClassName,
                 String appName,
@@ -741,9 +743,9 @@
 
 
 
-        public AppClientContainer newContainer(Class mainClass) throws Exception, UserError;
+        AppClientContainer newContainer(Class mainClass) throws Exception, UserError;
 
-        public TargetServer[] getTargetServers();
+        TargetServer[] getTargetServers();
 
         /**
          * Adds an optional {@link MessageSecurityConfig} setting.
@@ -751,9 +753,9 @@
          * @param msConfig the new MessageSecurityConfig
          * @return the <code>Builder</code> instance
          */
-        public Builder addMessageSecurityConfig(final MessageSecurityConfig msConfig);
+        Builder addMessageSecurityConfig(final MessageSecurityConfig msConfig);
 
-        public List<MessageSecurityConfig> getMessageSecurityConfig();
+        List<MessageSecurityConfig> getMessageSecurityConfig();
 
        /**
          * Sets the optional authentication realm for the ACC.
@@ -764,9 +766,9 @@
          * @param className name of the class which implements the realm
          * @return the <code>Builder</code> instance
          */
-        public Builder authRealm(final String className);
+        Builder authRealm(final String className);
 
-        public AuthRealm getAuthRealm();
+        AuthRealm getAuthRealm();
 
 //        /**
 //         * Sets the callback handler the ACC will use when authentication is
@@ -799,9 +801,9 @@
          * @param password password valid in the default realm on the server for the username
          * @return the <code>Builder</code> instance
         */
-        public Builder clientCredentials(final String user, final char[] password);
+        Builder clientCredentials(final String user, final char[] password);
 
-        public ClientCredential getClientCredential();
+        ClientCredential getClientCredential();
 
         /**
          * Sets the optional client credentials and server-side realm to be used during
@@ -816,7 +818,7 @@
          * @param realmName name of the realm on the server within which the credentials are valid
          * @return the <code>Builder</code> instance
          */
-        public Builder clientCredentials(final String user, final char[] password, final String realm);
+        Builder clientCredentials(final String user, final char[] password, final String realm);
 
         /**
          * Sets the container-level Properties.
@@ -824,7 +826,7 @@
          * @param containerProperties
          * @return
          */
-        public Builder containerProperties(final Properties containerProperties);
+        Builder containerProperties(final Properties containerProperties);
 
         /**
          * Sets the container-level properties.
@@ -835,13 +837,13 @@
          * @param containerProperties Property objects to use in setting the properties
          * @return
          */
-        public Builder containerProperties(final List<Property> containerProperties);
+        Builder containerProperties(final List<Property> containerProperties);
 
         /**
          * Returns the container-level Properties.
          * @return container-level properties
          */
-        public Properties getContainerProperties();
+        Properties getContainerProperties();
 
         /**
          * Sets the logger which the ACC should use as it runs.
@@ -849,9 +851,9 @@
          * @param logger
          * @return
          */
-        public Builder logger(final Logger logger);
+        Builder logger(final Logger logger);
 
-        public Logger getLogger();
+        Logger getLogger();
 
         /**
          * Sets whether the ACC should send the password to the server during
@@ -860,9 +862,9 @@
          * @param sendPassword
          * @return
          */
-        public Builder sendPassword(final boolean sendPassword);
+        Builder sendPassword(final boolean sendPassword);
 
-        public boolean getSendPassword();
+        boolean getSendPassword();
 
     }
 
diff --git a/appserver/common/container-common/src/main/java/org/glassfish/ha/commands/ListPersistenceTypesCommand.java b/appserver/common/container-common/src/main/java/org/glassfish/ha/commands/ListPersistenceTypesCommand.java
index 8cadb03..f26bd4e 100644
--- a/appserver/common/container-common/src/main/java/org/glassfish/ha/commands/ListPersistenceTypesCommand.java
+++ b/appserver/common/container-common/src/main/java/org/glassfish/ha/commands/ListPersistenceTypesCommand.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2010, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -17,7 +18,14 @@
 package org.glassfish.ha.commands;
 
 import com.sun.enterprise.config.serverbeans.Domain;
-import java.util.*;
+
+import jakarta.validation.constraints.Pattern;
+
+import java.util.ArrayList;
+import java.util.Properties;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 import org.glassfish.api.ActionReport;
 import org.glassfish.api.I18n;
@@ -25,15 +33,11 @@
 import org.glassfish.api.admin.AdminCommand;
 import org.glassfish.api.admin.AdminCommandContext;
 import org.glassfish.api.admin.CommandLock;
-
-import org.jvnet.hk2.annotations.Service;
-import org.glassfish.hk2.api.PerLookup;
-
-import jakarta.validation.constraints.Pattern;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import org.glassfish.api.admin.*;
+import org.glassfish.api.admin.RestEndpoint;
+import org.glassfish.api.admin.RestEndpoints;
 import org.glassfish.ha.store.spi.BackingStoreFactoryRegistry;
+import org.glassfish.hk2.api.PerLookup;
+import org.jvnet.hk2.annotations.Service;
 
 /**
  * The list-persistence-types command lists different kinds of persistence options for session data
@@ -51,10 +55,12 @@
 })
 public class ListPersistenceTypesCommand implements AdminCommand {
 
-    @Param(name="type", optional=false, primary=false)
+    private static final String CONTAINER_TYPES = "(ejb|web)";
+
+    @Param(name = "type", optional = false, primary = false)
     @I18n("list.persistence.types.container")
-    @Pattern(regexp = "(ejb|web)")
-    private String containerType = "";
+    @Pattern(regexp = CONTAINER_TYPES, message = "Valid values: " + CONTAINER_TYPES)
+    private final String containerType = "";
 
     private Logger logger;
     private static final String EOL = "\n";
@@ -89,7 +95,7 @@
             output = output.substring(0, output.length()-1);
         }
         Properties extraProperties = new Properties();
-        extraProperties.put("types", new ArrayList<String>(allPersistenceTypes));
+        extraProperties.put("types", new ArrayList<>(allPersistenceTypes));
 
         report.setExtraProperties(extraProperties);
         report.setMessage(output);
diff --git a/appserver/connectors/connectors-internal-api/src/main/java/org/glassfish/connectors/config/ResourceAdapterConfig.java b/appserver/connectors/connectors-internal-api/src/main/java/org/glassfish/connectors/config/ResourceAdapterConfig.java
index 27a841d..c3a0dec 100644
--- a/appserver/connectors/connectors-internal-api/src/main/java/org/glassfish/connectors/config/ResourceAdapterConfig.java
+++ b/appserver/connectors/connectors-internal-api/src/main/java/org/glassfish/connectors/config/ResourceAdapterConfig.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -17,27 +18,28 @@
 package org.glassfish.connectors.config;
 
 import com.sun.enterprise.config.serverbeans.Resource;
-import org.glassfish.resourcebase.resources.ResourceDeploymentOrder;
-import org.glassfish.resourcebase.resources.ResourceTypeOrder;
-import org.jvnet.hk2.config.*;
+
+import jakarta.validation.constraints.Pattern;
 
 import java.beans.PropertyVetoException;
 import java.util.List;
 
+import org.glassfish.api.admin.RestRedirect;
+import org.glassfish.api.admin.RestRedirects;
 import org.glassfish.api.admin.config.PropertiesDesc;
+import org.glassfish.quality.ToDo;
+import org.glassfish.resourcebase.resources.ResourceDeploymentOrder;
+import org.glassfish.resourcebase.resources.ResourceTypeOrder;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.DuckTyped;
+import org.jvnet.hk2.config.Element;
 import org.jvnet.hk2.config.types.Property;
 import org.jvnet.hk2.config.types.PropertyBag;
-import org.glassfish.api.admin.RestRedirects;
-import org.glassfish.api.admin.RestRedirect;
+
 import static org.glassfish.config.support.Constants.NAME_REGEX;
 
-import org.glassfish.quality.ToDo;
-
-import jakarta.validation.constraints.Pattern;
-/**
- *
- */
-
 /* @XmlType(name = "", propOrder = {
     "property"
 }) */
@@ -56,6 +58,8 @@
 @ResourceTypeOrder(deploymentOrder= ResourceDeploymentOrder.RESOURCEADAPTERCONFIG_RESOURCE)
 public interface ResourceAdapterConfig extends ConfigBeanProxy, Resource, PropertyBag {
 
+    String PATTERN_RA_NAME = "[^',][^',\\\\]*";
+
     /**
      * Gets the value of the name property.
      *
@@ -63,16 +67,16 @@
      *         {@link String }
      */
     @Attribute
-    @Pattern(regexp=NAME_REGEX)
-    public String getName();
+    @Pattern(regexp = NAME_REGEX, message = "Pattern: " + NAME_REGEX)
+    String getName();
 
     /**
      * Sets the value of the name property.
      *
      * @param value allowed object is
-     *              {@link String }
+     *            {@link String }
      */
-    public void setName(String value) throws PropertyVetoException;
+    void setName(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the threadPoolIds property.
@@ -81,15 +85,15 @@
      *         {@link String }
      */
     @Attribute
-    public String getThreadPoolIds();
+    String getThreadPoolIds();
 
     /**
      * Sets the value of the threadPoolIds property.
      *
      * @param value allowed object is
-     *              {@link String }
+     *            {@link String }
      */
-    public void setThreadPoolIds(String value) throws PropertyVetoException;
+    void setThreadPoolIds(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the resourceAdapterName property.
@@ -97,31 +101,34 @@
      * @return possible object is
      *         {@link String }
      */
-    @Attribute(key=true)
-    @Pattern(regexp="[^',][^',\\\\]*")
-    public String getResourceAdapterName();
+    @Attribute(key = true)
+    @Pattern(regexp = PATTERN_RA_NAME, message = "Pattern: " + PATTERN_RA_NAME)
+    String getResourceAdapterName();
 
     /**
      * Sets the value of the resourceAdapterName property.
      *
      * @param value allowed object is
-     *              {@link String }
+     *            {@link String }
      */
-    public void setResourceAdapterName(String value) throws PropertyVetoException;
+    void setResourceAdapterName(String value) throws PropertyVetoException;
 
     /**
-        Properties as per {@link org.jvnet.hk2.config.types.PropertyBag}
+     * Properties as per {@link org.jvnet.hk2.config.types.PropertyBag}
      */
-    @ToDo(priority=ToDo.Priority.IMPORTANT, details="Provide PropertyDesc for legal props" )
-    @PropertiesDesc(props={})
+    @Override
+    @ToDo(priority = ToDo.Priority.IMPORTANT, details = "Provide PropertyDesc for legal props")
+    @PropertiesDesc(props = {})
     @Element
     List<Property> getProperty();
 
+    @Override
     @DuckTyped
     String getIdentity();
 
     class Duck {
-        public static String getIdentity(ResourceAdapterConfig resource){
+
+        public static String getIdentity(ResourceAdapterConfig resource) {
             return resource.getResourceAdapterName();
         }
     }
diff --git a/appserver/connectors/connectors-internal-api/src/main/java/org/glassfish/connectors/config/SecurityMap.java b/appserver/connectors/connectors-internal-api/src/main/java/org/glassfish/connectors/config/SecurityMap.java
index f5adfda..99566fe 100644
--- a/appserver/connectors/connectors-internal-api/src/main/java/org/glassfish/connectors/config/SecurityMap.java
+++ b/appserver/connectors/connectors-internal-api/src/main/java/org/glassfish/connectors/config/SecurityMap.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,17 +17,18 @@
 
 package org.glassfish.connectors.config;
 
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.Element;
-import org.jvnet.hk2.config.ConfigBeanProxy;
-import static org.glassfish.config.support.Constants.NAME_REGEX;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
 
 import java.beans.PropertyVetoException;
 import java.util.List;
 
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Pattern;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.Element;
+
+import static org.glassfish.config.support.Constants.NAME_REGEX;
 
 /**
  * Perform mapping from principal received during Servlet/EJB authentication,
@@ -49,18 +51,18 @@
      * @return possible object is
      *         {@link String }
      */
-    @Attribute(key=true)
+    @Attribute(key = true)
     @NotNull
-    @Pattern(regexp=NAME_REGEX)
-    public String getName();
+    @Pattern(regexp = NAME_REGEX, message = "Pattern: " + NAME_REGEX)
+    String getName();
 
     /**
      * Sets the value of the name property.
      *
      * @param value allowed object is
-     *              {@link String }
+     *            {@link String }
      */
-    public void setName(String value) throws PropertyVetoException;
+    void setName(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the backendPrincipal property.
@@ -68,33 +70,34 @@
      * @return possible object is
      *         {@link BackendPrincipal }
      */
-    @Element(required=true)
-    public BackendPrincipal getBackendPrincipal();
+    @Element(required = true)
+    BackendPrincipal getBackendPrincipal();
 
     /**
      * Sets the value of the backendPrincipal property.
      *
      * @param value allowed object is
-     *              {@link BackendPrincipal }
+     *            {@link BackendPrincipal }
      */
-    public void setBackendPrincipal(BackendPrincipal value) throws PropertyVetoException;
+    void setBackendPrincipal(BackendPrincipal value) throws PropertyVetoException;
 
     /**
      * get the list of principals to be mapped to backend-principal
+     *
      * @return list of principals
      */
     @Element
-    public List<String> getPrincipal();
+    List<String> getPrincipal();
 
     void setPrincipal(List<String> principals) throws PropertyVetoException;
 
-
     /**
      * get the list of user-groups to be mapped to backend principal
+     *
      * @return list of user-groups
      */
     @Element
-    public List<String> getUserGroup();
+    List<String> getUserGroup();
 
     void setUserGroup(List<String> userGroups) throws PropertyVetoException;
 }
diff --git a/appserver/connectors/connectors-internal-api/src/main/java/org/glassfish/connectors/config/WorkSecurityMap.java b/appserver/connectors/connectors-internal-api/src/main/java/org/glassfish/connectors/config/WorkSecurityMap.java
index 437f5fd..e6fd47f 100644
--- a/appserver/connectors/connectors-internal-api/src/main/java/org/glassfish/connectors/config/WorkSecurityMap.java
+++ b/appserver/connectors/connectors-internal-api/src/main/java/org/glassfish/connectors/config/WorkSecurityMap.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,19 +17,27 @@
 
 package org.glassfish.connectors.config;
 
-import com.sun.enterprise.config.serverbeans.*;
-import org.glassfish.resourcebase.resources.ResourceDeploymentOrder;
-import org.glassfish.resourcebase.resources.ResourceTypeOrder;
-import org.jvnet.hk2.config.*;
+import com.sun.enterprise.config.serverbeans.Resource;
 
 import jakarta.validation.constraints.NotNull;
 import jakarta.validation.constraints.Pattern;
+
 import java.beans.PropertyVetoException;
 import java.util.List;
 
+import org.glassfish.resourcebase.resources.ResourceDeploymentOrder;
+import org.glassfish.resourcebase.resources.ResourceTypeOrder;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.DuckTyped;
+import org.jvnet.hk2.config.Element;
+
 @Configured
-@ResourceTypeOrder(deploymentOrder= ResourceDeploymentOrder.WORKSECURITYMAP_RESOURCE)
-public interface WorkSecurityMap  extends /*Named,*/ ConfigBeanProxy, Resource {
+@ResourceTypeOrder(deploymentOrder = ResourceDeploymentOrder.WORKSECURITYMAP_RESOURCE)
+public interface WorkSecurityMap extends ConfigBeanProxy, Resource {
+
+    String PATTERN_RA_NAME = "[^',][^',\\\\]*";
 
     /**
      * Gets the value of the enabled property.
@@ -36,14 +45,14 @@
      * @return possible object is
      *         {@link String }
      */
-    @Attribute (defaultValue="true",dataType=Boolean.class)
+    @Attribute(defaultValue = "true", dataType = Boolean.class)
     String getEnabled();
 
     /**
      * Sets the value of the enabled property.
      *
      * @param value allowed object is
-     *              {@link String }
+     *            {@link String }
      */
     void setEnabled(String value) throws PropertyVetoException;
 
@@ -60,11 +69,10 @@
      * Sets the value of the description property.
      *
      * @param value allowed object is
-     *              {@link String }
+     *            {@link String }
      */
     void setDescription(String value) throws PropertyVetoException;
 
-
     /**
      * Gets the value of the ra name
      *
@@ -73,53 +81,55 @@
      */
     @Attribute
     @NotNull
-    @Pattern(regexp="[^',][^',\\\\]*")
-    public String getResourceAdapterName();
+    @Pattern(regexp = PATTERN_RA_NAME, message = "Pattern: " + PATTERN_RA_NAME)
+    String getResourceAdapterName();
 
     /**
      * Sets the value of the ra name
      *
      * @param value allowed object is
-     *              {@link String }
+     *            {@link String }
      */
-    public void setResourceAdapterName(String value) throws PropertyVetoException;
+    void setResourceAdapterName(String value) throws PropertyVetoException;
 
     /**
      * Gets the group map
-     * @return group map
      *
+     * @return group map
      */
     @Element
     @NotNull
-    public List<GroupMap> getGroupMap();
+    List<GroupMap> getGroupMap();
 
     /**
      * gets the principal map
+     *
      * @return principal map
      */
     @Element
     @NotNull
-    public List<PrincipalMap> getPrincipalMap();
+    List<PrincipalMap> getPrincipalMap();
 
     /**
-     *  Name of the configured object
+     * Name of the configured object
      *
      * @return name of the configured object
      */
-    @Attribute(required=true, key=true)
-    @Pattern(regexp="[^',][^',\\\\]*")
+    @Attribute(required = true, key = true)
+    @Pattern(regexp = PATTERN_RA_NAME, message = "Pattern: " + PATTERN_RA_NAME)
     @NotNull
-    public String getName();
+    String getName();
 
-    public void setName(String value) throws PropertyVetoException;
+    void setName(String value) throws PropertyVetoException;
 
+    @Override
     @DuckTyped
     String getIdentity();
 
     class Duck {
-        public static String getIdentity(WorkSecurityMap wsm){
-            return ("resource-adapter : " + wsm.getResourceAdapterName()
-                    + " : security-map : " +  wsm.getName());
+
+        public static String getIdentity(WorkSecurityMap wsm) {
+            return ("resource-adapter : " + wsm.getResourceAdapterName() + " : security-map : " + wsm.getName());
         }
     }
 }
diff --git a/appserver/deployment/dol/src/main/java/com/sun/enterprise/deployment/node/SaxParserHandler.java b/appserver/deployment/dol/src/main/java/com/sun/enterprise/deployment/node/SaxParserHandler.java
index d5f625c..264d1bf 100644
--- a/appserver/deployment/dol/src/main/java/com/sun/enterprise/deployment/node/SaxParserHandler.java
+++ b/appserver/deployment/dol/src/main/java/com/sun/enterprise/deployment/node/SaxParserHandler.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 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
@@ -22,8 +23,28 @@
 import com.sun.enterprise.deployment.xml.TagNames;
 import com.sun.enterprise.util.LocalStringManagerImpl;
 
-import org.jvnet.hk2.annotations.Service;
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EmptyStackException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Stack;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.CopyOnWriteArraySet;
+import java.util.logging.Level;
+
 import org.glassfish.hk2.api.PerLookup;
+import org.jvnet.hk2.annotations.Service;
 import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
@@ -31,13 +52,6 @@
 import org.xml.sax.helpers.DefaultHandler;
 import org.xml.sax.helpers.NamespaceSupport;
 
-import java.io.*;
-import java.util.*;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.CopyOnWriteArraySet;
-import java.util.logging.Level;
-
 
 /**
  * This class implements all the callbacks for the SAX Parser in JAXP 1.1
@@ -57,8 +71,8 @@
     private static final String FALSE_STR = "false";
 
     private static final class MappingStuff {
-        public final ConcurrentMap<String, Boolean> mBundleRegistrationStatus = new ConcurrentHashMap<String, Boolean>();
-        public final ConcurrentMap<String,String> mMapping = new ConcurrentHashMap<String,String>();
+        public final ConcurrentMap<String, Boolean> mBundleRegistrationStatus = new ConcurrentHashMap<>();
+        public final ConcurrentMap<String,String> mMapping = new ConcurrentHashMap<>();
 
         private final ConcurrentMap<String,Class> mRootNodesMutable;
         public final Map<String,Class>            mRootNodes;
@@ -72,33 +86,33 @@
         private final Map<String, List<VersionUpgrade>> mVersionUpgrades;
 
         MappingStuff() {
-            mRootNodesMutable  = new ConcurrentHashMap<String,Class>();
+            mRootNodesMutable  = new ConcurrentHashMap<>();
             mRootNodes         = Collections.unmodifiableMap( mRootNodesMutable );
 
-            mElementsAllowingEmptyValuesMutable = new CopyOnWriteArraySet<String>();
+            mElementsAllowingEmptyValuesMutable = new CopyOnWriteArraySet<>();
             mElementsAllowingEmptyValues = Collections.unmodifiableSet(mElementsAllowingEmptyValuesMutable);
 
-            mElementsPreservingWhiteSpaceMutable = new CopyOnWriteArraySet<String>();
+            mElementsPreservingWhiteSpaceMutable = new CopyOnWriteArraySet<>();
             mElementsPreservingWhiteSpace = Collections.unmodifiableSet(mElementsPreservingWhiteSpaceMutable);
-            mVersionUpgradeClasses = new ConcurrentHashMap<String, List<Class>>();
-            mVersionUpgrades = new ConcurrentHashMap<String, List<VersionUpgrade>>();
+            mVersionUpgradeClasses = new ConcurrentHashMap<>();
+            mVersionUpgrades = new ConcurrentHashMap<>();
         }
     }
 
     private static final MappingStuff _mappingStuff = new MappingStuff();
 
-    private final List<XMLNode> nodes = new ArrayList<XMLNode>();
+    private final List<XMLNode> nodes = new ArrayList<>();
     public XMLNode topNode = null;
-    protected String publicID=null;
-    private StringBuffer elementData=null;
-    private Map<String, String> prefixMapping=null;
+    protected String publicID = null;
+    private StringBuffer elementData = null;
+    private Map<String, String> prefixMapping = null;
 
     private boolean stopOnXMLErrors = false;
 
     private boolean pushedNamespaceContext=false;
-    private NamespaceSupport namespaces = new NamespaceSupport();
+    private final NamespaceSupport namespaces = new NamespaceSupport();
 
-    private Stack elementStack = new Stack();
+    private final Stack elementStack = new Stack();
 
     private static final LocalStringManagerImpl localStrings = new LocalStringManagerImpl(SaxParserHandler.class);
 
@@ -112,9 +126,10 @@
             return versionUpgradeList;
         }
         List<Class> classList = _mappingStuff.mVersionUpgradeClasses.get(key);
-        if (classList == null)
+        if (classList == null) {
             return null;
-        versionUpgradeList = new ArrayList<VersionUpgrade>();
+        }
+        versionUpgradeList = new ArrayList<>();
         for (int n = 0; n < classList.size(); ++n) {
             VersionUpgrade versionUpgrade = null;
             try {
@@ -154,8 +169,8 @@
             return;
         }
 
-        final HashMap<String, String> dtdMapping = new HashMap<String, String>();
-        final Map<String, List<Class>> versionUpgrades = new HashMap<String, List<Class>>();
+        final HashMap<String, String> dtdMapping = new HashMap<>();
+        final Map<String, List<Class>> versionUpgrades = new HashMap<>();
 
         String rootNodeKey = bn.registerBundle(dtdMapping);
         _mappingStuff.mRootNodesMutable.putIfAbsent(rootNodeKey, bn.getClass());
@@ -199,6 +214,7 @@
         _mappingStuff.mBundleRegistrationStatus.put(rootNodeKey, Boolean.TRUE);
     }
 
+    @Override
     public InputSource resolveEntity(String publicID, String systemID) throws SAXException {
         try {
             if(DOLUtils.getDefaultLogger().isLoggable(Level.FINE)) {
@@ -229,7 +245,7 @@
                             "Requested schema is not found in local repository, please ensure that there are no typos in the XML namespace declaration."));
                 }
                 if (DOLUtils.getDefaultLogger().isLoggable(Level.FINE)) {
-                  DOLUtils.getDefaultLogger().fine("Resolved to " + fileName);;
+                  DOLUtils.getDefaultLogger().fine("Resolved to " + fileName);
                 }
                 return new InputSource(fileName);
             }
@@ -251,8 +267,9 @@
     }
 
 
+    @Override
     public void error(SAXParseException spe) throws SAXParseException {
-        DOLUtils.getDefaultLogger().log(Level.SEVERE, "enterprise.deployment.backend.invalidDescriptorFailure",
+        DOLUtils.getDefaultLogger().log(Level.SEVERE, DOLUtils.INVALILD_DESCRIPTOR,
             new Object[] {errorReportingString, String.valueOf(spe.getLineNumber()),
                 String.valueOf(spe.getColumnNumber()), spe.getLocalizedMessage()});
         if (stopOnXMLErrors) {
@@ -261,8 +278,9 @@
     }
 
 
+    @Override
     public void fatalError(SAXParseException spe) throws SAXParseException {
-        DOLUtils.getDefaultLogger().log(Level.SEVERE, "enterprise.deployment.backend.invalidDescriptorFailure",
+        DOLUtils.getDefaultLogger().log(Level.SEVERE, DOLUtils.INVALILD_DESCRIPTOR,
             new Object[] {errorReportingString, String.valueOf(spe.getLineNumber()),
                 String.valueOf(spe.getColumnNumber()), spe.getLocalizedMessage()});
         if (stopOnXMLErrors) {
@@ -327,8 +345,7 @@
      */
     public static String resolveSchemaNamespace(String systemID) {
         List<String> namespaces = DOLUtils.getProprietarySchemaNamespaces();
-        for (int n = 0; n < namespaces.size(); ++n) {
-            String namespace = namespaces.get(n);
+        for (String namespace : namespaces) {
             if (systemID.startsWith(namespace)) {
                 return systemID.substring(namespace.length());
             }
@@ -346,8 +363,7 @@
      */
     public static String resolvePublicID(String publicID, String dtd) {
         List<String> dtdStarts = DOLUtils.getProprietaryDTDStart();
-        for (int n = 0; n < dtdStarts.size(); ++n) {
-            String dtdStart = dtdStarts.get(n);
+        for (String dtdStart : dtdStarts) {
             if (dtd.startsWith(dtdStart)) {
                 return dtd.substring(dtdStart.length());
             }
@@ -355,6 +371,7 @@
         return null;
     }
 
+    @Override
     public void notationDecl(java.lang.String name,
                          java.lang.String publicId,
                          java.lang.String systemId)
@@ -365,12 +382,13 @@
     }
 
 
+    @Override
     public void startPrefixMapping(String prefix,
                                String uri)
                         throws SAXException {
 
         if (prefixMapping==null) {
-            prefixMapping = new HashMap<String, String>();
+            prefixMapping = new HashMap<>();
         }
 
         // We need one namespace context per element, but any prefix mapping
@@ -385,6 +403,7 @@
     }
 
 
+    @Override
     public void startElement(String uri, String localName, String qName, Attributes attributes) {
         if (!pushedNamespaceContext) {
             // We need one namespae context per element, so push a context
@@ -405,8 +424,7 @@
             rootElement = localName;
             versionUpgradeList = getVersionUpgrades(rootElement);
             if (versionUpgradeList != null) {
-                for (int n = 0; n < versionUpgradeList.size(); ++n) {
-                    VersionUpgrade versionUpgrade = versionUpgradeList.get(n);
+                for (VersionUpgrade versionUpgrade : versionUpgradeList) {
                     versionUpgrade.init();
                 }
             }
@@ -417,8 +435,7 @@
         }
 
         if (versionUpgradeList != null) {
-            for (int n = 0; n < versionUpgradeList.size(); ++n) {
-                VersionUpgrade versionUpgrade = versionUpgradeList.get(n);
+            for (VersionUpgrade versionUpgrade : versionUpgradeList) {
                 if (VersionUpgrade.UpgradeType.REMOVE_ELEMENT == versionUpgrade.getUpgradeType()) {
                     Map<String, String> matchXPath = versionUpgrade.getMatchXPath();
                     int entriesMatched = 0;
@@ -495,6 +512,7 @@
         }
     }
 
+    @Override
     public void endElement(String uri, String localName, String qName) {
 
         String lastElement = null;
@@ -521,8 +539,7 @@
             String replacementName = null;
             String replacementValue = null;
             if (versionUpgradeList != null) {
-                for (int n = 0; n < versionUpgradeList.size(); ++n) {
-                    VersionUpgrade versionUpgrade = versionUpgradeList.get(n);
+                for (VersionUpgrade versionUpgrade : versionUpgradeList) {
                     if (VersionUpgrade.UpgradeType.REPLACE_ELEMENT == versionUpgrade.getUpgradeType()) {
                         Map<String, String> matchXPath = versionUpgrade.getMatchXPath();
                         int entriesMatched = 0;
@@ -612,6 +629,7 @@
         }
     }
 
+    @Override
     public void characters(char[] ch, int start, int stop) {
         if (elementData!=null) {
             elementData = elementData.append(ch,start, stop);
diff --git a/appserver/deployment/dol/src/main/java/com/sun/enterprise/deployment/util/DOLUtils.java b/appserver/deployment/dol/src/main/java/com/sun/enterprise/deployment/util/DOLUtils.java
index d047c21..8d153ed 100644
--- a/appserver/deployment/dol/src/main/java/com/sun/enterprise/deployment/util/DOLUtils.java
+++ b/appserver/deployment/dol/src/main/java/com/sun/enterprise/deployment/util/DOLUtils.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 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
@@ -92,8 +93,7 @@
     public final static String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
     public final static String SCHEMA_LOCATION_TAG = "xsi:schemaLocation";
 
-    private static LocalStringManagerImpl localStrings =
-            new LocalStringManagerImpl(DOLUtils.class);
+    private static LocalStringManagerImpl localStrings = new LocalStringManagerImpl(DOLUtils.class);
 
     @LogMessagesResourceBundle
     private static final String SHARED_LOGMESSAGE_RESOURCE = "org.glassfish.deployment.LogMessages";
@@ -103,24 +103,30 @@
     @LoggerInfo(subsystem = "DEPLOYMENT", description="Deployment logger for dol module", publish=true)
     private static final String DEPLOYMENT_LOGGER = "jakarta.enterprise.system.tools.deployment.dol";
 
-    public static final Logger deplLogger =
-        Logger.getLogger(DEPLOYMENT_LOGGER, SHARED_LOGMESSAGE_RESOURCE);
+    public static final Logger deplLogger = Logger.getLogger(DEPLOYMENT_LOGGER, SHARED_LOGMESSAGE_RESOURCE);
 
     @LogMessageInfo(message = "Ignore {0} in archive {1}, as WLS counterpart runtime xml {2} is present in the same archive.", level="WARNING")
-      private static final String COUNTERPART_CONFIGDD_EXISTS = "AS-DEPLOYMENT-00001";
+    private static final String COUNTERPART_CONFIGDD_EXISTS = "AS-DEPLOYMENT-00001";
 
     @LogMessageInfo(message = "Exception caught:  {0}.", level="WARNING")
-      private static final String EXCEPTION_CAUGHT = "AS-DEPLOYMENT-00002";
+    private static final String EXCEPTION_CAUGHT = "AS-DEPLOYMENT-00002";
 
     @LogMessageInfo(message = "{0} module [{1}] contains characteristics of other module type: {2}.", level="WARNING")
-      private static final String INCOMPATIBLE_TYPE = "AS-DEPLOYMENT-00003";
+    private static final String INCOMPATIBLE_TYPE = "AS-DEPLOYMENT-00003";
 
     @LogMessageInfo(message = "Unsupported deployment descriptors element {0} value {1}.", level="WARNING")
-      public static final String INVALID_DESC_MAPPING = "AS-DEPLOYMENT-00015";
+    public static final String INVALID_DESC_MAPPING = "AS-DEPLOYMENT-00015";
 
     @LogMessageInfo(message = "DOLUtils: converting EJB to web bundle id {0}.", level="FINER")
     private static final String CONVERT_EJB_TO_WEB_ID = "AS-DEPLOYMENT-00017";
 
+    @LogMessageInfo(message = "DOLUtils: Invalid Deployment Descriptors in {0} \nLine {1} Column {2} -- {3}.", level="SEVERE",
+        cause = "Failed to find the resource specified in the deployment descriptor. May be because of wrong specification in the descriptor",
+        action = "Ensure that the resource specified is present. Ensure that there is no typo in the resource specified in the descriptor"
+    )
+    public static final String INVALILD_DESCRIPTOR = "AS-DEPLOYMENT-00118";
+
+
     // The system property to control the precedence between GF DD
     // and WLS DD when they are both present. When this property is
     // set to true, GF DD will have higher precedence over WLS DD.
@@ -146,64 +152,58 @@
 
     public static boolean equals(Object a, Object b) {
         return ((a == null && b == null) ||
-                (a != null && a.equals(b)));
+            (a != null && a.equals(b)));
     }
 
     public static List<URI> getLibraryJarURIs(BundleDescriptor bundleDesc, ReadableArchive archive) throws Exception {
         if (bundleDesc == null) {
             return Collections.emptyList();
         }
-        ModuleDescriptor moduleDesc = ((BundleDescriptor)bundleDesc).getModuleDescriptor();
+        ModuleDescriptor moduleDesc = bundleDesc.getModuleDescriptor();
         Application app = ((BundleDescriptor)moduleDesc.getDescriptor()).getApplication();
         return getLibraryJarURIs(app, archive);
     }
 
     public static List<URI> getLibraryJarURIs(Application app, ReadableArchive archive) throws Exception {
-        List<URL> libraryURLs = new ArrayList<URL>();
-        List<URI> libraryURIs = new ArrayList<URI>();
+        List<URL> libraryURLs = new ArrayList<>();
+        List<URI> libraryURIs = new ArrayList<>();
 
         // add libraries referenced through manifest
         libraryURLs.addAll(DeploymentUtils.getManifestLibraries(archive));
-
         ReadableArchive parentArchive = archive.getParentArchive();
-
         if (parentArchive == null) {
             return Collections.emptyList();
         }
 
         File appRoot = new File(parentArchive.getURI());
-
         // add libraries jars inside application lib directory
-        libraryURLs.addAll(ASClassLoaderUtil.getAppLibDirLibrariesAsList(
-            appRoot, app.getLibraryDirectory(), null));
-
+        libraryURLs.addAll(ASClassLoaderUtil.getAppLibDirLibrariesAsList(appRoot, app.getLibraryDirectory(), null));
         for (URL url : libraryURLs) {
             libraryURIs.add(Util.toURI(url));
         }
         return libraryURIs;
     }
 
-   public static BundleDescriptor getCurrentBundleForContext(
-       DeploymentContext context) {
-       ExtendedDeploymentContext ctx = (ExtendedDeploymentContext)context;
-       Application application = context.getModuleMetaData(Application.class);
-       if (application == null) return null; // this can happen for non-JavaEE type deployment. e.g., issue 15869
-       if (ctx.getParentContext() == null) {
-           if (application.isVirtual()) {
-               // standalone module
-               return application.getStandaloneBundleDescriptor();
-           } else {
-               // top level
-               return application;
-           }
-       } else {
-           // a sub module of ear
-           return application.getModuleByUri(ctx.getModuleUri());
-       }
-   }
+    public static BundleDescriptor getCurrentBundleForContext(DeploymentContext context) {
+        ExtendedDeploymentContext ctx = (ExtendedDeploymentContext)context;
+        Application application = context.getModuleMetaData(Application.class);
+        if (application == null) {
+            // this can happen for non-JavaEE type deployment. e.g., issue 15869
+            return null;
+        }
+        if (ctx.getParentContext() == null) {
+            if (application.isVirtual()) {
+                // standalone module
+                return application.getStandaloneBundleDescriptor();
+            }
+            // top level
+            return application;
+        }
+        // a sub module of ear
+        return application.getModuleByUri(ctx.getModuleUri());
+    }
 
-    public static boolean isRAConnectionFactory(ServiceLocator habitat,
-        String type, Application thisApp) {
+    public static boolean isRAConnectionFactory(ServiceLocator habitat, String type, Application thisApp) {
         // first check if this is a connection factory defined in a resource
         // adapter in this application
         if (isRAConnectionFactory(type, thisApp)) {
@@ -218,8 +218,9 @@
             ApplicationRegistry appRegistry = habitat.getService(ApplicationRegistry.class);
             for (com.sun.enterprise.config.serverbeans.Application raApp : raApps) {
                 ApplicationInfo appInfo = appRegistry.get(raApp.getName());
-                if (appInfo == null)
+                if (appInfo == null) {
                     continue;
+                }
                 if (isRAConnectionFactory(type, appInfo.getMetaData(Application.class))) {
                     return true;
                 }
@@ -314,7 +315,7 @@
                 sunConfDD = ddFile;
             }
         }
-        List<ConfigurationDeploymentDescriptorFile> sortedConfDDFiles = new ArrayList<ConfigurationDeploymentDescriptorFile>();
+        List<ConfigurationDeploymentDescriptorFile> sortedConfDDFiles = new ArrayList<>();
 
         // if there is external runtime alternate deployment descriptor
         // specified, just use that
@@ -385,7 +386,7 @@
             // specified, the config DD files are already processed
             return sortConfigurationDDFiles(ddFiles, archiveType, archive);
         }
-        List<ConfigurationDeploymentDescriptorFile> processedConfDDFiles = new ArrayList<ConfigurationDeploymentDescriptorFile>();
+        List<ConfigurationDeploymentDescriptorFile> processedConfDDFiles = new ArrayList<>();
         for (ConfigurationDeploymentDescriptorFile ddFile : sortConfigurationDDFiles(ddFiles, archiveType, archive)) {
             if (archive.exists(ddFile.getDeploymentDescriptorPath())) {
                 processedConfDDFiles.add(ddFile);
@@ -471,19 +472,19 @@
             for (int i = 1; i < confDDFiles.size(); i++) {
                 if (warnIfMultipleDDs) {
                     deplLogger.log(Level.WARNING,
-                                   COUNTERPART_CONFIGDD_EXISTS,
-                                   new Object[] {
-                                     confDDFiles.get(i).getDeploymentDescriptorPath(),
-                                     archive.getURI().getSchemeSpecificPart(),
-                                     confDD.getDeploymentDescriptorPath()});
+                        COUNTERPART_CONFIGDD_EXISTS,
+                        new Object[] {
+                            confDDFiles.get(i).getDeploymentDescriptorPath(),
+                            archive.getURI().getSchemeSpecificPart(),
+                            confDD.getDeploymentDescriptorPath()});
                 }
             }
             confDD.setErrorReportingString(archive.getURI().getSchemeSpecificPart());
             if (confDD.isValidating()) {
-              confDD.setXMLValidation(main.getRuntimeXMLValidation());
-              confDD.setXMLValidationLevel(main.getRuntimeXMLValidationLevel());
+                confDD.setXMLValidation(main.getRuntimeXMLValidation());
+                confDD.setXMLValidationLevel(main.getRuntimeXMLValidationLevel());
             } else {
-              confDD.setXMLValidation(false);
+                confDD.setXMLValidation(false);
             }
             confDD.read(descriptor, is);
         } finally {
@@ -504,8 +505,8 @@
             subArchivist.setExtensionArchivists(archivistFactory.getExtensionsArchivists(sniffers, subArchivist.getModuleType()));
         } catch (Exception e) {
             deplLogger.log(Level.WARNING,
-                           EXCEPTION_CAUGHT,
-                           new Object[] { e.getMessage(), e });
+                EXCEPTION_CAUGHT,
+                new Object[] { e.getMessage(), e });
         }
     }
 
@@ -545,15 +546,15 @@
         String [] incompatibleTypes = mainSniffer.getIncompatibleSnifferTypes();
         List<String> allIncompatTypes = addAdditionalIncompatTypes(mainSniffer, incompatibleTypes);
 
-        List<Sniffer> sniffersToRemove = new ArrayList<Sniffer>();
+        List<Sniffer> sniffersToRemove = new ArrayList<>();
         for (Sniffer sniffer : sniffers) {
             for (String incompatType : allIncompatTypes) {
                 if (sniffer.getModuleType().equals(incompatType)) {
-                  deplLogger.log(Level.WARNING,
-                                 INCOMPATIBLE_TYPE,
-                                 new Object[] { type,
-                                                md.getArchiveUri(),
-                                                incompatType });
+                    deplLogger.log(Level.WARNING,
+                        INCOMPATIBLE_TYPE,
+                        new Object[] { type,
+                            md.getArchiveUri(),
+                            incompatType });
 
                     sniffersToRemove.add(sniffer);
                 }
@@ -590,7 +591,7 @@
     // this is to add additional incompatible sniffers at ear level where
     // we have information to determine what is the main sniffer
     private static List<String> addAdditionalIncompatTypes(Sniffer mainSniffer, String[] incompatTypes) {
-        List<String> allIncompatTypes = new ArrayList<String>();
+        List<String> allIncompatTypes = new ArrayList<>();
         for (String incompatType : incompatTypes) {
             allIncompatTypes.add(incompatType);
         }
@@ -603,7 +604,7 @@
     }
 
     public static List<ConfigurationDeploymentDescriptorFile> getConfigurationDeploymentDescriptorFiles(ServiceLocator habitat, String containerType) {
-        List<ConfigurationDeploymentDescriptorFile> confDDFiles = new ArrayList<ConfigurationDeploymentDescriptorFile>();
+        List<ConfigurationDeploymentDescriptorFile> confDDFiles = new ArrayList<>();
         for (ServiceHandle<?> serviceHandle : habitat.getAllServiceHandles(ConfigurationDeploymentDescriptorFileFor.class)) {
             ActiveDescriptor<?> descriptor = serviceHandle.getActiveDescriptor();
             String indexedType = descriptor.getMetadata().get(ConfigurationDeploymentDescriptorFileFor.DESCRIPTOR_FOR).get(0);
@@ -622,29 +623,33 @@
      * @param value it's associated value
      */
     public static boolean setElementValue(XMLElement element,
-                                          String value,
-                                          Object o) {
+        String value,
+        Object o) {
         if (SCHEMA_LOCATION_TAG.equals(element.getCompleteName())) {
             // we need to keep all the non j2ee/javaee schemaLocation tags
             StringTokenizer st = new StringTokenizer(value);
             StringBuffer sb = new StringBuffer();
             while (st.hasMoreElements()) {
                 String namespace = (String) st.nextElement();
-        String schema;
-        if (st.hasMoreElements()) {
-            schema = (String) st.nextElement();
-        } else {
-            schema = namespace;
-            namespace = TagNames.JAKARTAEE_NAMESPACE;
-        }
-                if (namespace.equals(TagNames.J2EE_NAMESPACE))
+                String schema;
+                if (st.hasMoreElements()) {
+                    schema = (String) st.nextElement();
+                } else {
+                    schema = namespace;
+                    namespace = TagNames.JAKARTAEE_NAMESPACE;
+                }
+                if (namespace.equals(TagNames.J2EE_NAMESPACE)) {
                     continue;
-                if (namespace.equals(TagNames.JAVAEE_NAMESPACE))
+                }
+                if (namespace.equals(TagNames.JAVAEE_NAMESPACE)) {
                     continue;
-                if (namespace.equals(TagNames.JAKARTAEE_NAMESPACE))
+                }
+                if (namespace.equals(TagNames.JAKARTAEE_NAMESPACE)) {
                     continue;
-                if (namespace.equals(W3C_XML_SCHEMA))
+                }
+                if (namespace.equals(W3C_XML_SCHEMA)) {
                     continue;
+                }
                 sb.append(namespace);
                 sb.append(" ");
                 sb.append(schema);
@@ -665,167 +670,167 @@
         return false;
     }
 
-  /*
-   * Returns a list of the proprietary schema namespaces
-   */
-  public static List<String> getProprietarySchemaNamespaces() {
-    ArrayList<String> ns = new ArrayList<String>();
-    ns.add(DescriptorConstants.WLS_SCHEMA_NAMESPACE_BEA);
-    ns.add(DescriptorConstants.WLS_SCHEMA_NAMESPACE_ORACLE);
-    return ns;
-  }
-
-  /*
-   * Returns a list of the proprietary dtd system IDs
-   */
-  public static List<String> getProprietaryDTDStart() {
-    ArrayList<String> ns = new ArrayList<String>();
-    ns.add(DescriptorConstants.WLS_DTD_SYSTEM_ID_BEA);
-    return ns;
-  }
-
-  public static Application getApplicationFromEnv(JndiNameEnvironment env) {
-    Application app = null;
-
-    if (env instanceof EjbDescriptor) {
-      // EJB component
-      EjbDescriptor ejbEnv = (EjbDescriptor) env;
-      app = ejbEnv.getApplication();
-    } else if (env instanceof EjbBundleDescriptor) {
-      EjbBundleDescriptor ejbBundle = (EjbBundleDescriptor) env;
-      app = ejbBundle.getApplication();
-    } else if (env instanceof WebBundleDescriptor) {
-      WebBundleDescriptor webEnv = (WebBundleDescriptor) env;
-      app = webEnv.getApplication();
-    } else if (env instanceof ApplicationClientDescriptor) {
-      ApplicationClientDescriptor appEnv = (ApplicationClientDescriptor) env;
-      app = appEnv.getApplication();
-    } else if (env instanceof ManagedBeanDescriptor) {
-      ManagedBeanDescriptor mb = (ManagedBeanDescriptor) env;
-      app = mb.getBundle().getApplication();
-    } else if (env instanceof Application) {
-      app = ((Application) env);
-    } else {
-      throw new IllegalArgumentException("IllegalJndiNameEnvironment : env");
+    /*
+     * Returns a list of the proprietary schema namespaces
+     */
+    public static List<String> getProprietarySchemaNamespaces() {
+        ArrayList<String> ns = new ArrayList<>();
+        ns.add(DescriptorConstants.WLS_SCHEMA_NAMESPACE_BEA);
+        ns.add(DescriptorConstants.WLS_SCHEMA_NAMESPACE_ORACLE);
+        return ns;
     }
 
-    return app;
-  }
-
-  public static String getApplicationName(JndiNameEnvironment env) {
-    String appName = "";
-
-    Application app = getApplicationFromEnv(env);
-    if (app != null) {
-      appName = app.getAppName();
-    } else {
-      throw new IllegalArgumentException("IllegalJndiNameEnvironment : env");
+    /*
+     * Returns a list of the proprietary dtd system IDs
+     */
+    public static List<String> getProprietaryDTDStart() {
+        ArrayList<String> ns = new ArrayList<>();
+        ns.add(DescriptorConstants.WLS_DTD_SYSTEM_ID_BEA);
+        return ns;
     }
 
-    return appName;
-  }
+    public static Application getApplicationFromEnv(JndiNameEnvironment env) {
+        Application app = null;
 
-  public static String getModuleName(JndiNameEnvironment env) {
-
-    String moduleName = null;
-
-    if (env instanceof EjbDescriptor) {
-      // EJB component
-      EjbDescriptor ejbEnv = (EjbDescriptor) env;
-      EjbBundleDescriptor ejbBundle = ejbEnv.getEjbBundleDescriptor();
-      moduleName = ejbBundle.getModuleDescriptor().getModuleName();
-    } else if (env instanceof EjbBundleDescriptor) {
-      EjbBundleDescriptor ejbBundle = (EjbBundleDescriptor) env;
-      moduleName = ejbBundle.getModuleDescriptor().getModuleName();
-    } else if (env instanceof WebBundleDescriptor) {
-      WebBundleDescriptor webEnv = (WebBundleDescriptor) env;
-      moduleName = webEnv.getModuleName();
-    } else if (env instanceof ApplicationClientDescriptor) {
-      ApplicationClientDescriptor appEnv = (ApplicationClientDescriptor) env;
-      moduleName = appEnv.getModuleName();
-    } else if (env instanceof ManagedBeanDescriptor) {
-      ManagedBeanDescriptor mb = (ManagedBeanDescriptor) env;
-      moduleName = mb.getBundle().getModuleName();
-    } else {
-      throw new IllegalArgumentException("IllegalJndiNameEnvironment : env");
-    }
-
-    return moduleName;
-
-  }
-
-  public static boolean getTreatComponentAsModule(JndiNameEnvironment env) {
-
-    boolean treatComponentAsModule = false;
-
-    if (env instanceof WebBundleDescriptor) {
-      treatComponentAsModule = true;
-    } else {
-
-      if (env instanceof EjbDescriptor) {
-
-        EjbDescriptor ejbDesc = (EjbDescriptor) env;
-        EjbBundleDescriptor ejbBundle = ejbDesc.getEjbBundleDescriptor();
-        if (ejbBundle.getModuleDescriptor().getDescriptor() instanceof WebBundleDescriptor) {
-          treatComponentAsModule = true;
-        }
-      }
-
-    }
-
-    return treatComponentAsModule;
-  }
-
-  /**
-   * Generate a unique id name for each J2EE component.
-   */
-  public static String getComponentEnvId(JndiNameEnvironment env) {
-    String id = null;
-
-    if (env instanceof EjbDescriptor) {
-      // EJB component
-      EjbDescriptor ejbEnv = (EjbDescriptor) env;
-
-      // Make jndi name flat so it won't result in the creation of
-      // a bunch of sub-contexts.
-      String flattedJndiName = ejbEnv.getJndiName().replace('/', '.');
-
-      EjbBundleDescriptor ejbBundle = ejbEnv.getEjbBundleDescriptor();
-      Descriptor d = ejbBundle.getModuleDescriptor().getDescriptor();
-      // if this EJB is in a war file, use the same component ID
-      // as the web bundle, because they share the same JNDI namespace
-      if (d instanceof WebBundleDescriptor) {
-        // copy of code below
-        WebBundleDescriptor webEnv = (WebBundleDescriptor) d;
-        id = webEnv.getApplication().getName() + ID_SEPARATOR
-            + webEnv.getContextRoot();
-        if (deplLogger.isLoggable(Level.FINER)) {
-          deplLogger.log(Level.FINER, CONVERT_EJB_TO_WEB_ID, id);
+        if (env instanceof EjbDescriptor) {
+            // EJB component
+            EjbDescriptor ejbEnv = (EjbDescriptor) env;
+            app = ejbEnv.getApplication();
+        } else if (env instanceof EjbBundleDescriptor) {
+            EjbBundleDescriptor ejbBundle = (EjbBundleDescriptor) env;
+            app = ejbBundle.getApplication();
+        } else if (env instanceof WebBundleDescriptor) {
+            WebBundleDescriptor webEnv = (WebBundleDescriptor) env;
+            app = webEnv.getApplication();
+        } else if (env instanceof ApplicationClientDescriptor) {
+            ApplicationClientDescriptor appEnv = (ApplicationClientDescriptor) env;
+            app = appEnv.getApplication();
+        } else if (env instanceof ManagedBeanDescriptor) {
+            ManagedBeanDescriptor mb = (ManagedBeanDescriptor) env;
+            app = mb.getBundle().getApplication();
+        } else if (env instanceof Application) {
+            app = ((Application) env);
+        } else {
+            throw new IllegalArgumentException("IllegalJndiNameEnvironment : env");
         }
 
-      } else {
-        id = ejbEnv.getApplication().getName() + ID_SEPARATOR
-            + ejbBundle.getModuleDescriptor().getArchiveUri() + ID_SEPARATOR
-            + ejbEnv.getName() + ID_SEPARATOR + flattedJndiName
-            + ejbEnv.getUniqueId();
-      }
-    } else if (env instanceof WebBundleDescriptor) {
-      WebBundleDescriptor webEnv = (WebBundleDescriptor) env;
-      id = webEnv.getApplication().getName() + ID_SEPARATOR
-          + webEnv.getContextRoot();
-    } else if (env instanceof ApplicationClientDescriptor) {
-      ApplicationClientDescriptor appEnv = (ApplicationClientDescriptor) env;
-      id = "client" + ID_SEPARATOR + appEnv.getName() + ID_SEPARATOR
-          + appEnv.getMainClassName();
-    } else if (env instanceof ManagedBeanDescriptor) {
-      id = ((ManagedBeanDescriptor) env).getGlobalJndiName();
-    } else if (env instanceof EjbBundleDescriptor) {
-      EjbBundleDescriptor ejbBundle = (EjbBundleDescriptor) env;
-      id = "__ejbBundle__" + ID_SEPARATOR
-          + ejbBundle.getApplication().getName() + ID_SEPARATOR
-          + ejbBundle.getModuleName();
+        return app;
     }
 
-    return id;
-  }
+    public static String getApplicationName(JndiNameEnvironment env) {
+        String appName = "";
+
+        Application app = getApplicationFromEnv(env);
+        if (app != null) {
+            appName = app.getAppName();
+        } else {
+            throw new IllegalArgumentException("IllegalJndiNameEnvironment : env");
+        }
+
+        return appName;
+    }
+
+    public static String getModuleName(JndiNameEnvironment env) {
+
+        String moduleName = null;
+
+        if (env instanceof EjbDescriptor) {
+            // EJB component
+            EjbDescriptor ejbEnv = (EjbDescriptor) env;
+            EjbBundleDescriptor ejbBundle = ejbEnv.getEjbBundleDescriptor();
+            moduleName = ejbBundle.getModuleDescriptor().getModuleName();
+        } else if (env instanceof EjbBundleDescriptor) {
+            EjbBundleDescriptor ejbBundle = (EjbBundleDescriptor) env;
+            moduleName = ejbBundle.getModuleDescriptor().getModuleName();
+        } else if (env instanceof WebBundleDescriptor) {
+            WebBundleDescriptor webEnv = (WebBundleDescriptor) env;
+            moduleName = webEnv.getModuleName();
+        } else if (env instanceof ApplicationClientDescriptor) {
+            ApplicationClientDescriptor appEnv = (ApplicationClientDescriptor) env;
+            moduleName = appEnv.getModuleName();
+        } else if (env instanceof ManagedBeanDescriptor) {
+            ManagedBeanDescriptor mb = (ManagedBeanDescriptor) env;
+            moduleName = mb.getBundle().getModuleName();
+        } else {
+            throw new IllegalArgumentException("IllegalJndiNameEnvironment : env");
+        }
+
+        return moduleName;
+
+    }
+
+    public static boolean getTreatComponentAsModule(JndiNameEnvironment env) {
+
+        boolean treatComponentAsModule = false;
+
+        if (env instanceof WebBundleDescriptor) {
+            treatComponentAsModule = true;
+        } else {
+
+            if (env instanceof EjbDescriptor) {
+
+                EjbDescriptor ejbDesc = (EjbDescriptor) env;
+                EjbBundleDescriptor ejbBundle = ejbDesc.getEjbBundleDescriptor();
+                if (ejbBundle.getModuleDescriptor().getDescriptor() instanceof WebBundleDescriptor) {
+                    treatComponentAsModule = true;
+                }
+            }
+
+        }
+
+        return treatComponentAsModule;
+    }
+
+    /**
+     * Generate a unique id name for each J2EE component.
+     */
+    public static String getComponentEnvId(JndiNameEnvironment env) {
+        String id = null;
+
+        if (env instanceof EjbDescriptor) {
+            // EJB component
+            EjbDescriptor ejbEnv = (EjbDescriptor) env;
+
+            // Make jndi name flat so it won't result in the creation of
+            // a bunch of sub-contexts.
+            String flattedJndiName = ejbEnv.getJndiName().replace('/', '.');
+
+            EjbBundleDescriptor ejbBundle = ejbEnv.getEjbBundleDescriptor();
+            Descriptor d = ejbBundle.getModuleDescriptor().getDescriptor();
+            // if this EJB is in a war file, use the same component ID
+            // as the web bundle, because they share the same JNDI namespace
+            if (d instanceof WebBundleDescriptor) {
+                // copy of code below
+                WebBundleDescriptor webEnv = (WebBundleDescriptor) d;
+                id = webEnv.getApplication().getName() + ID_SEPARATOR
+                    + webEnv.getContextRoot();
+                if (deplLogger.isLoggable(Level.FINER)) {
+                    deplLogger.log(Level.FINER, CONVERT_EJB_TO_WEB_ID, id);
+                }
+
+            } else {
+                id = ejbEnv.getApplication().getName() + ID_SEPARATOR
+                    + ejbBundle.getModuleDescriptor().getArchiveUri() + ID_SEPARATOR
+                    + ejbEnv.getName() + ID_SEPARATOR + flattedJndiName
+                    + ejbEnv.getUniqueId();
+            }
+        } else if (env instanceof WebBundleDescriptor) {
+            WebBundleDescriptor webEnv = (WebBundleDescriptor) env;
+            id = webEnv.getApplication().getName() + ID_SEPARATOR
+                + webEnv.getContextRoot();
+        } else if (env instanceof ApplicationClientDescriptor) {
+            ApplicationClientDescriptor appEnv = (ApplicationClientDescriptor) env;
+            id = "client" + ID_SEPARATOR + appEnv.getName() + ID_SEPARATOR
+                + appEnv.getMainClassName();
+        } else if (env instanceof ManagedBeanDescriptor) {
+            id = ((ManagedBeanDescriptor) env).getGlobalJndiName();
+        } else if (env instanceof EjbBundleDescriptor) {
+            EjbBundleDescriptor ejbBundle = (EjbBundleDescriptor) env;
+            id = "__ejbBundle__" + ID_SEPARATOR
+                + ejbBundle.getApplication().getName() + ID_SEPARATOR
+                + ejbBundle.getModuleName();
+        }
+
+        return id;
+    }
 }
diff --git a/appserver/ejb/ejb-connector/src/main/java/org/glassfish/ejb/config/EjbContainer.java b/appserver/ejb/ejb-connector/src/main/java/org/glassfish/ejb/config/EjbContainer.java
index 46d1157..e52fdcd 100644
--- a/appserver/ejb/ejb-connector/src/main/java/org/glassfish/ejb/config/EjbContainer.java
+++ b/appserver/ejb/ejb-connector/src/main/java/org/glassfish/ejb/config/EjbContainer.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,24 +17,23 @@
 
 package org.glassfish.ejb.config;
 
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.Element;
-import org.jvnet.hk2.config.ConfigBeanProxy;
+import jakarta.validation.constraints.Min;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
 
 import java.beans.PropertyVetoException;
 import java.util.List;
 
+import org.glassfish.api.admin.config.ConfigExtension;
 import org.glassfish.api.admin.config.PropertiesDesc;
+import org.glassfish.api.admin.config.PropertyDesc;
+import org.glassfish.quality.ToDo;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.Element;
 import org.jvnet.hk2.config.types.Property;
 import org.jvnet.hk2.config.types.PropertyBag;
-import org.glassfish.quality.ToDo;
-
-import jakarta.validation.constraints.Min;
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Pattern;
-import org.glassfish.api.admin.config.PropertyDesc;
-import org.glassfish.api.admin.config.ConfigExtension;
 
 /**
  * Configuration of EJB Container
@@ -46,12 +46,15 @@
 
 @Configured
 public interface EjbContainer extends ConfigBeanProxy, PropertyBag, ConfigExtension {
-    public static final int DEFAULT_THREAD_CORE_POOL_SIZE = 16;
-    public static final int DEFAULT_THREAD_MAX_POOL_SIZE = 32;
-    public static final long DEFAULT_THREAD_KEEP_ALIVE_SECONDS = 60;
-    public static final int DEFAULT_THREAD_QUEUE_CAPACITY = Integer.MAX_VALUE;
-    public static final boolean DEFAULT_ALLOW_CORE_THREAD_TIMEOUT = false;
-    public static final boolean DEFAULT_PRESTART_ALL_CORE_THREADS = false;
+
+    String PATTERN_VICTIM_SELECTION_POLICY = "(nru|fifo|lru)";
+
+    int DEFAULT_THREAD_CORE_POOL_SIZE = 16;
+    int DEFAULT_THREAD_MAX_POOL_SIZE = 32;
+    long DEFAULT_THREAD_KEEP_ALIVE_SECONDS = 60;
+    int DEFAULT_THREAD_QUEUE_CAPACITY = Integer.MAX_VALUE;
+    boolean DEFAULT_ALLOW_CORE_THREAD_TIMEOUT = false;
+    boolean DEFAULT_PRESTART_ALL_CORE_THREADS = false;
 
     /**
      * Gets the value of the steadyPoolSize property.
@@ -280,8 +283,8 @@
      * @return possible object is
      *         {@link String }
      */
-    @Attribute (defaultValue="nru")
-    @Pattern(regexp="(nru|fifo|lru)")
+    @Attribute(defaultValue = "nru")
+    @Pattern(regexp = PATTERN_VICTIM_SELECTION_POLICY, message = "Pattern: " + PATTERN_VICTIM_SELECTION_POLICY)
     String getVictimSelectionPolicy();
 
     /**
@@ -301,8 +304,8 @@
      * @return possible object is
      *         {@link String }
      */
-    @Attribute (defaultValue="B")
-    @Pattern(regexp="B|C")
+    @Attribute(defaultValue = "B")
+    @Pattern(regexp = "B|C", message = "B to enable entity bean caching, C to disable.")
     String getCommitOption();
 
     /**
@@ -358,6 +361,7 @@
     /**
         Properties as per {@link PropertyBag}
      */
+    @Override
     @ToDo(priority=ToDo.Priority.IMPORTANT, details="Provide PropertyDesc for legal props" )
     @PropertiesDesc(props = {
         @PropertyDesc(name = "disable-nonportable-jndi-names",
diff --git a/appserver/jdbc/jdbc-config/src/main/java/org/glassfish/jdbc/config/JdbcConnectionPool.java b/appserver/jdbc/jdbc-config/src/main/java/org/glassfish/jdbc/config/JdbcConnectionPool.java
index e65526f..ff1784a 100644
--- a/appserver/jdbc/jdbc-config/src/main/java/org/glassfish/jdbc/config/JdbcConnectionPool.java
+++ b/appserver/jdbc/jdbc-config/src/main/java/org/glassfish/jdbc/config/JdbcConnectionPool.java
@@ -1,6 +1,6 @@
 /*
+ * Copyright (c) 2021-2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2021 Contributors to the Eclipse Foundation
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,6 +19,15 @@
 
 import com.sun.enterprise.config.serverbeans.Resource;
 import com.sun.enterprise.config.serverbeans.ResourcePool;
+
+import jakarta.validation.constraints.Max;
+import jakarta.validation.constraints.Min;
+import jakarta.validation.constraints.Pattern;
+
+import java.beans.PropertyVetoException;
+import java.util.List;
+
+import org.glassfish.admin.cli.resources.UniqueResourceNameConstraint;
 import org.glassfish.api.admin.RestRedirect;
 import org.glassfish.api.admin.RestRedirects;
 import org.glassfish.api.admin.config.PropertiesDesc;
@@ -27,19 +36,16 @@
 import org.glassfish.connectors.config.validators.ConnectionPoolErrorMessages;
 import org.glassfish.jdbc.config.validators.JdbcConnectionPoolConstraint;
 import org.glassfish.jdbc.config.validators.JdbcConnectionPoolConstraints;
-import org.glassfish.admin.cli.resources.UniqueResourceNameConstraint;
 import org.glassfish.resourcebase.resources.ResourceDeploymentOrder;
 import org.glassfish.resourcebase.resources.ResourceTypeOrder;
-import org.jvnet.hk2.config.*;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.DuckTyped;
+import org.jvnet.hk2.config.Element;
 import org.jvnet.hk2.config.types.Property;
 import org.jvnet.hk2.config.types.PropertyBag;
 
-import jakarta.validation.constraints.Max;
-import jakarta.validation.constraints.Min;
-import jakarta.validation.constraints.Pattern;
-import java.beans.PropertyVetoException;
-import java.util.List;
-
 /**
  * Defines configuration used to create and manage a pool physical database
  * connections. Pool definition is named, and can be referred to by multiple
@@ -69,8 +75,11 @@
 })
 @ResourceTypeOrder(deploymentOrder=ResourceDeploymentOrder.JDBC_POOL)
 @UniqueResourceNameConstraint(message="{resourcename.isnot.unique}", payload=JdbcConnectionPool.class)
-public interface JdbcConnectionPool extends ConfigBeanProxy, Resource, ResourcePool,
-    PropertyBag {
+public interface JdbcConnectionPool extends ConfigBeanProxy, Resource, ResourcePool, PropertyBag {
+
+    String CONNECTION_VALIDATION_METHODS = "(auto-commit|meta-data|custom-validation|table)";
+    String ISOLATION_LEVELS = "(read-uncommitted|read-committed|repeatable-read|serializable)";
+    String RESOURCE_TYPES = "(java.sql.Driver|javax.sql.DataSource|javax.sql.XADataSource|javax.sql.ConnectionPoolDataSource)";
 
     /**
      *
@@ -131,7 +140,7 @@
      *         {@link String }
      */
     @Attribute
-    @Pattern(regexp="(java.sql.Driver|javax.sql.DataSource|javax.sql.XADataSource|javax.sql.ConnectionPoolDataSource)")
+    @Pattern(regexp = RESOURCE_TYPES, message = "Valid values: " + RESOURCE_TYPES)
     String getResType();
 
     /**
@@ -274,7 +283,7 @@
      *         {@link String }
      */
     @Attribute
-    @Pattern(regexp="(read-uncommitted|read-committed|repeatable-read|serializable)")
+    @Pattern(regexp = ISOLATION_LEVELS, message = "Valid values: " + ISOLATION_LEVELS)
     String getTransactionIsolationLevel();
 
     /**
@@ -299,7 +308,7 @@
      * @return possible object is
      *         {@link String }
      */
-    @Attribute (defaultValue="true", dataType=Boolean.class)
+    @Attribute(defaultValue = "true", dataType = Boolean.class)
     String getIsIsolationLevelGuaranteed();
 
     /**
@@ -348,7 +357,7 @@
      *         {@link String }
      */
     @Attribute (defaultValue="table")
-    @Pattern(regexp="(auto-commit|meta-data|custom-validation|table)")
+    @Pattern(regexp = CONNECTION_VALIDATION_METHODS, message = "Valid values: " + CONNECTION_VALIDATION_METHODS)
     String getConnectionValidationMethod();
 
     /**
@@ -942,6 +951,7 @@
      * deployment descriptors.
      *
      */
+@Override
 @PropertiesDesc(
     props={
         @PropertyDesc(name="PortNumber", defaultValue="1527", dataType=Port.class,
@@ -966,6 +976,7 @@
     @Element
     List<Property> getProperty();
 
+    @Override
     @DuckTyped
     String getIdentity();
 
diff --git a/appserver/jdbc/jdbc-ra/jdbc40/pom.xml b/appserver/jdbc/jdbc-ra/jdbc40/pom.xml
index f395a4f..a6a178c 100644
--- a/appserver/jdbc/jdbc-ra/jdbc40/pom.xml
+++ b/appserver/jdbc/jdbc-ra/jdbc40/pom.xml
@@ -54,12 +54,5 @@
                 </excludes>
             </resource>
         </resources>
-        <plugins>
-            <plugin><!--
-                  Use JDBC 4.0 API regardless of which JDK we are building with.
-                -->
-                <artifactId>maven-compiler-plugin</artifactId>
-            </plugin>
-        </plugins>
     </build>
 </project>
diff --git a/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/ChangeMasterBrokerCommand.java b/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/ChangeMasterBrokerCommand.java
index 15c05d8..ac0f3a6 100755
--- a/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/ChangeMasterBrokerCommand.java
+++ b/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/ChangeMasterBrokerCommand.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 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
@@ -29,8 +30,6 @@
 
 import java.beans.PropertyVetoException;
 import java.util.List;
-import java.util.logging.Level;
-
 import javax.management.MBeanServerConnection;
 import javax.management.ObjectName;
 import javax.management.openmbean.CompositeData;
@@ -75,12 +74,12 @@
     final private static LocalStringManagerImpl localStrings = new LocalStringManagerImpl(ChangeMasterBrokerCommand.class);
     // [usemasterbroker] [availability-enabled] [dbvendor] [dbuser] [dbpassword admin] [jdbcurl] [properties props] clusterName
 
-    private static enum BrokerStatusCode {
+    private enum BrokerStatusCode {
         BAD_REQUEST(400), NOT_ALLOWED(405), UNAVAILABLE(503), PRECONDITION_FAILED(412);
 
-        private int code;
+        private final int code;
 
-        private BrokerStatusCode(int c) {
+        BrokerStatusCode(int c) {
             code = c;
         }
 
@@ -115,6 +114,7 @@
      *
      * @param context information
      */
+    @Override
     public void execute(AdminCommandContext context) {
         final ActionReport report = context.getActionReport();
         final String newMB = newMasterBroker;
@@ -227,6 +227,7 @@
               }*/
 
             ConfigSupport.apply(new SingleConfigCode<JmsService>() {
+                @Override
                 public Object run(JmsService param) throws PropertyVetoException, TransactionFailure {
 
                     param.setMasterBroker(newMB);
@@ -249,8 +250,8 @@
         JmsHost jmsHost = null;
         String defaultJmsHostName = jmsService.getDefaultJmsHost();
         List jmsHostsList = jmsService.getJmsHost();
-        for (int i = 0; i < jmsHostsList.size(); i++) {
-            JmsHost tmpJmsHost = (JmsHost) jmsHostsList.get(i);
+        for (Object element : jmsHostsList) {
+            JmsHost tmpJmsHost = (JmsHost) element;
             if (tmpJmsHost != null && tmpJmsHost.getName().equals(defaultJmsHostName)) {
                 jmsHost = tmpJmsHost;
             }
@@ -259,68 +260,27 @@
     }
 
     private CompositeData updateMasterBroker(String serverName, String oldMasterBroker, String newMasterBroker) throws Exception {
-        MQJMXConnectorInfo mqInfo = getMQJMXConnectorInfo(serverName, config,serverContext, domain, connectorRuntime);
-
-        //MBeanServerConnection  mbsc = getMBeanServerConnection(tgtName);
-        CompositeData result = null;
-        try {
+        try (MQJMXConnectorInfo mqInfo = createMQJMXConnectorInfo(serverName, config,serverContext, domain, connectorRuntime)) {
             MBeanServerConnection mbsc = null;
             try {
                 mbsc = mqInfo.getMQMBeanServerConnection();
             } catch (Exception e) {
                 String emsg = localStrings.getLocalString(
                     "change.master.broker.cannotConnectOldMasterBroker",
-                    "Unable to connect to the current master broker {0}. Likely reasons: the cluster might not be running, the server instance {0} associated with the current master broker or the current master broker might not be running.  Please check server logs.",
-                    new String[] {mqInfo.getASInstanceName()}
+                    "Unable to connect to the current master broker {0}. Likely reasons:"
+                    + " the cluster might not be running, the server instance {0} associated with"
+                    + " the current master broker or the current master broker might not be running."
+                    + " Please check server logs.",
+                    mqInfo.getASInstanceName()
                 );
-                if (logger.isLoggable(Level.WARNING)) {
-                    logger.log(Level.WARNING, emsg);
-                }
-                logAndHandleException(e, emsg);
+                throw handleException(new Exception(emsg, e));
             }
             ObjectName on = new ObjectName(CLUSTER_CONFIG_MBEAN_NAME);
-            Object[] params = null;
             String[] signature = new String[] {"java.lang.String", "java.lang.String"};
-            params = new Object [] {oldMasterBroker, newMasterBroker};
-
-            result = mbsc != null ? (CompositeData) mbsc.invoke(on, "changeMasterBroker", params, signature) : null;
+            Object[] params = new Object [] {oldMasterBroker, newMasterBroker};
+            return mbsc == null ? null : (CompositeData) mbsc.invoke(on, "changeMasterBroker", params, signature);
         } catch (Exception e) {
-            logAndHandleException(e, e.getMessage());
-        } finally {
-            try {
-                if(mqInfo != null) {
-                    mqInfo.closeMQMBeanServerConnection();
-                }
-            } catch (Exception e) {
-                handleException(e);
-            }
+            throw logAndHandleException(e, e.getMessage());
         }
-        return result;
-    }
-
-    /**
-     * This is a copy from the super method except that
-     * it avoids a NPE in using e.getCause() and ensure
-     * the exception message is errorMsg not "" - these
-     * eventually should be incoporated to the super method
-     * post 5.0 release.
-     */
-    @Override
-    protected void logAndHandleException(Exception e, String errorMsg)
-        throws JMSAdminException {
-        //log JMX Exception trace as WARNING
-        java.io.StringWriter s = new java.io.StringWriter();
-        e.printStackTrace(new java.io.PrintWriter(s));
-        String emsg = localStrings.getLocalString(errorMsg, errorMsg);
-        JMSAdminException je = new JMSAdminException(emsg);
-        /* Cause will be InvocationTargetException, cause of that
-         * will be  MBeanException and cause of that will be the
-         * real exception we need
-         */
-        if ((e.getCause() != null) &&
-            (e.getCause().getCause() != null)) {
-            je.initCause(e.getCause().getCause().getCause());
-        }
-        handleException(je);
     }
 }
diff --git a/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/CreateJMSDestination.java b/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/CreateJMSDestination.java
index 9b652b9..caddd55 100644
--- a/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/CreateJMSDestination.java
+++ b/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/CreateJMSDestination.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 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
@@ -16,37 +17,44 @@
 
 package org.glassfish.jms.admin.cli;
 
-import javax.security.auth.Subject;
-import org.glassfish.api.I18n;
-import org.glassfish.api.Param;
-import org.glassfish.api.ActionReport;
-import org.glassfish.api.admin.CommandRunner;
-import org.glassfish.api.admin.ParameterMap;
-import org.glassfish.config.support.CommandTarget;
-import org.glassfish.config.support.TargetType;
-import org.glassfish.internal.api.ServerContext;
-import java.util.*;
-import java.util.logging.Logger;
-
+import com.sun.enterprise.config.serverbeans.Cluster;
+import com.sun.enterprise.config.serverbeans.Config;
+import com.sun.enterprise.config.serverbeans.Domain;
+import com.sun.enterprise.config.serverbeans.Server;
 import com.sun.enterprise.util.LocalStringManagerImpl;
 import com.sun.enterprise.util.SystemPropertyConstants;
-import com.sun.enterprise.config.serverbeans.*;
 
 import jakarta.inject.Inject;
 import jakarta.inject.Named;
+
+import java.util.Properties;
+
+import javax.management.AttributeList;
 import javax.management.MBeanServerConnection;
 import javax.management.ObjectName;
-import javax.management.AttributeList;
+import javax.security.auth.Subject;
 
-import org.jvnet.hk2.annotations.Service;
-
+import org.glassfish.api.ActionReport;
+import org.glassfish.api.I18n;
+import org.glassfish.api.Param;
+import org.glassfish.api.admin.AdminCommand;
+import org.glassfish.api.admin.AdminCommandContext;
+import org.glassfish.api.admin.CommandRunner;
+import org.glassfish.api.admin.ExecuteOn;
+import org.glassfish.api.admin.ParameterMap;
+import org.glassfish.api.admin.RestEndpoint;
+import org.glassfish.api.admin.RestEndpoints;
+import org.glassfish.api.admin.RestParam;
+import org.glassfish.api.admin.RuntimeType;
+import org.glassfish.api.admin.ServerEnvironment;
+import org.glassfish.config.support.CommandTarget;
+import org.glassfish.config.support.TargetType;
 import org.glassfish.hk2.api.PerLookup;
-
-import org.glassfish.api.admin.*;
+import org.glassfish.internal.api.ServerContext;
+import org.jvnet.hk2.annotations.Service;
 
 /**
  * Create JMS Destination
- *
  */
 @Service(name = "create-jmsdest")
 @PerLookup
@@ -104,6 +112,7 @@
     @Inject
     ServerContext serverContext;
 
+    @Override
     public void execute(AdminCommandContext context) {
 
         final ActionReport report = context.getActionReport();
@@ -139,13 +148,9 @@
     // create-jmsdest
     private void createJMSDestination(ActionReport report, final Subject subject) throws Exception {
 
-        MQJMXConnectorInfo mqInfo = getMQJMXConnectorInfo(target, config, serverContext, domain, connectorRuntime);
-
-        //MBeanServerConnection  mbsc = getMBeanServerConnection(tgtName);
-        try {
+        try (MQJMXConnectorInfo mqInfo = createMQJMXConnectorInfo(target, config, serverContext, domain, connectorRuntime)) {
             MBeanServerConnection mbsc = mqInfo.getMQMBeanServerConnection();
-            ObjectName on = new ObjectName(
-                    DESTINATION_MANAGER_CONFIG_MBEAN_NAME);
+            ObjectName on = new ObjectName(DESTINATION_MANAGER_CONFIG_MBEAN_NAME);
             String[] signature = null;
             AttributeList destAttrs = null;
             Object[] params = null;
@@ -182,8 +187,6 @@
                 destAttrs = convertProp2Attrs(props);
             }
 
-            // setAppserverDefaults(destAttrs, mqInfo);
-
             if (destType.equalsIgnoreCase(JMS_DEST_TYPE_TOPIC)) {
                 destType = DESTINATION_TYPE_TOPIC;
             } else if (destType.equalsIgnoreCase(JMS_DEST_TYPE_QUEUE)) {
@@ -205,15 +208,7 @@
             mbsc.invoke(on, "create", params, signature);
             report.setMessage(localStrings.getLocalString("create.jms.destination.success", "JMS Desctination {0} created.", destName));
         } catch (Exception e) {
-            logAndHandleException(e, "admin.mbeans.rmb.error_creating_jms_dest");
-        } finally {
-            try {
-                if (mqInfo != null) {
-                    mqInfo.closeMQMBeanServerConnection();
-                }
-            } catch (Exception e) {
-                handleException(e);
-            }
+            throw logAndHandleException(e, "admin.mbeans.rmb.error_creating_jms_dest");
         }
     }
 }
diff --git a/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/DeleteJMSDestination.java b/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/DeleteJMSDestination.java
index c27734f..f8c3e2b 100644
--- a/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/DeleteJMSDestination.java
+++ b/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/DeleteJMSDestination.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 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
@@ -16,38 +17,41 @@
 
 package org.glassfish.jms.admin.cli;
 
-import org.glassfish.api.I18n;
-import org.glassfish.api.Param;
-import org.glassfish.api.ActionReport;
-import org.glassfish.api.admin.AdminCommand;
-import org.glassfish.api.admin.AdminCommandContext;
-import org.glassfish.internal.api.ServerContext;
+import com.sun.enterprise.config.serverbeans.Cluster;
+import com.sun.enterprise.config.serverbeans.Config;
+import com.sun.enterprise.config.serverbeans.Domain;
+import com.sun.enterprise.config.serverbeans.Server;
+import com.sun.enterprise.util.LocalStringManagerImpl;
+import com.sun.enterprise.util.SystemPropertyConstants;
+
+import jakarta.inject.Inject;
+import jakarta.inject.Named;
 
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import com.sun.enterprise.util.LocalStringManagerImpl;
-import com.sun.enterprise.util.SystemPropertyConstants;
-
-import com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter;
-import com.sun.enterprise.config.serverbeans.*;
-
-import jakarta.inject.Inject;
-import jakarta.inject.Named;
 import javax.management.MBeanServerConnection;
 import javax.management.ObjectName;
 
-import org.jvnet.hk2.annotations.Service;
-
-import org.glassfish.hk2.api.PerLookup;
-
-import org.glassfish.api.admin.*;
+import org.glassfish.api.ActionReport;
+import org.glassfish.api.I18n;
+import org.glassfish.api.Param;
+import org.glassfish.api.admin.AdminCommand;
+import org.glassfish.api.admin.AdminCommandContext;
+import org.glassfish.api.admin.ExecuteOn;
+import org.glassfish.api.admin.RestEndpoint;
+import org.glassfish.api.admin.RestEndpoints;
+import org.glassfish.api.admin.RestParam;
+import org.glassfish.api.admin.RuntimeType;
+import org.glassfish.api.admin.ServerEnvironment;
 import org.glassfish.config.support.CommandTarget;
 import org.glassfish.config.support.TargetType;
+import org.glassfish.hk2.api.PerLookup;
+import org.glassfish.internal.api.ServerContext;
+import org.jvnet.hk2.annotations.Service;
 
 /**
  * delete JMS Destination
- *
  */
 @Service(name="delete-jmsdest")
 @PerLookup
@@ -73,101 +77,73 @@
 
 public class DeleteJMSDestination extends JMSDestination implements AdminCommand {
 
-        private final Logger logger = Logger.getLogger(LogUtils.JMS_ADMIN_LOGGER);
-        final private static LocalStringManagerImpl localStrings = new LocalStringManagerImpl(DeleteJMSDestination.class);
+    private final Logger logger = Logger.getLogger(LogUtils.JMS_ADMIN_LOGGER);
+    private static final LocalStringManagerImpl localStrings = new LocalStringManagerImpl(DeleteJMSDestination.class);
 
-        @Param(name="destType", shortName="T", optional=false)
-        String destType;
+    @Param(name="destType", shortName="T", optional=false)
+    String destType;
 
-        @Param(name="dest_name", primary=true)
-        String destName;
+    @Param(name="dest_name", primary=true)
+    String destName;
 
-        @Param(optional=true)
-        String target = SystemPropertyConstants.DEFAULT_SERVER_INSTANCE_NAME;
+    @Param(optional=true)
+    String target = SystemPropertyConstants.DEFAULT_SERVER_INSTANCE_NAME;
 
-        @Inject
-        com.sun.appserv.connectors.internal.api.ConnectorRuntime connectorRuntime;
+    @Inject
+    com.sun.appserv.connectors.internal.api.ConnectorRuntime connectorRuntime;
 
-        @Inject
-        Domain domain;
+    @Inject
+    Domain domain;
 
-        @Inject @Named(ServerEnvironment.DEFAULT_INSTANCE_NAME)
-        Config config;
+    @Inject @Named(ServerEnvironment.DEFAULT_INSTANCE_NAME)
+    Config config;
 
-        @Inject
-        ServerContext serverContext;
+    @Inject
+    ServerContext serverContext;
 
 
-     public void execute(AdminCommandContext context) {
-
+    @Override
+    public void execute(AdminCommandContext context) {
         final ActionReport report = context.getActionReport();
-        logger.entering(getClass().getName(), "deleteJMSDestination",
-        new Object[] {destName, destType});
+        logger.entering(getClass().getName(), "deleteJMSDestination", new Object[] {destName, destType});
 
-         try{
+        try {
             validateJMSDestName(destName);
             validateJMSDestType(destType);
-        }catch (IllegalArgumentException e){
+        } catch (IllegalArgumentException e) {
             report.setMessage(e.getMessage());
             report.setActionExitCode(ActionReport.ExitCode.FAILURE);
             return;
         }
 
         try {
-                deleteJMSDestination(destName, destType, target);
-                return;
+            deleteJMSDestination(destName, destType, target);
+            return;
         } catch (Exception e) {
             logger.throwing(getClass().getName(), "deleteJMSDestination", e);
-            //e.printStackTrace();//handleException(e);
             report.setMessage(localStrings.getLocalString("delete.jms.dest.noJmsDelete",
-                            "Delete JMS Destination failed. Please verify if the JMS Destination specified for deletion exists"));
+                "Delete JMS Destination failed. Please verify if the JMS Destination specified for deletion exists"));
             report.setActionExitCode(ActionReport.ExitCode.FAILURE);
         }
      }
 
-       // delete-jmsdest
-    private Object deleteJMSDestination(String destName, String destType,
-        String tgtName)
-        throws Exception {
 
-        if (logger.isLoggable(Level.FINE)) {
-            logger.log(Level.FINE, "deleteJMSDestination ...");
-        }
-        MQJMXConnectorInfo mqInfo = getMQJMXConnectorInfo(target, config, serverContext, domain, connectorRuntime);
-
-        //MBeanServerConnection  mbsc = getMBeanServerConnection(tgtName);
-
-        try {
+     private Object deleteJMSDestination(String destName, String destType, String tgtName) throws Exception {
+        logger.log(Level.FINE, "deleteJMSDestination ...");
+        try (MQJMXConnectorInfo mqInfo = createMQJMXConnectorInfo(target, config, serverContext, domain, connectorRuntime)) {
             MBeanServerConnection mbsc = mqInfo.getMQMBeanServerConnection();
-            ObjectName on = new ObjectName(
-                DESTINATION_MANAGER_CONFIG_MBEAN_NAME);
-            String [] signature = null;
-            Object [] params = null;
-
-            signature = new String [] {
-                "java.lang.String",
-                "java.lang.String"};
+            ObjectName on = new ObjectName(DESTINATION_MANAGER_CONFIG_MBEAN_NAME);
+            String[] signature = new String[] {"java.lang.String", "java.lang.String"};
 
             if (destType.equalsIgnoreCase("topic")) {
                 destType = DESTINATION_TYPE_TOPIC;
             } else if (destType.equalsIgnoreCase("queue")) {
                 destType = DESTINATION_TYPE_QUEUE;
             }
-            params = new Object [] {destType, destName};
+            Object[] params = new Object[] {destType, destName};
             return mbsc.invoke(on, "destroy", params, signature);
-
         } catch (Exception e) {
-                   //log JMX Exception trace as WARNING
-                   logAndHandleException(e, "admin.mbeans.rmb.error_deleting_jms_dest");
-                } finally {
-                    try {
-                        if(mqInfo != null) {
-                            mqInfo.closeMQMBeanServerConnection();
-                        }
-                    } catch (Exception e) {
-                      handleException(e);
-                    }
-                }
-           return null;
+            throw logAndHandleException(e, "admin.mbeans.rmb.error_deleting_jms_dest");
+        }
     }
 }
diff --git a/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/FlushJMSDestination.java b/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/FlushJMSDestination.java
index 6bcd953..a10754f 100644
--- a/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/FlushJMSDestination.java
+++ b/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/FlushJMSDestination.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 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
@@ -103,11 +104,11 @@
     ServerContext serverContext;
 
 
+    @Override
     public void execute(AdminCommandContext context) {
 
         final ActionReport report = context.getActionReport();
-        logger.entering(getClass().getName(), "flushJMSDestination",
-            new Object[] {destName, destType});
+        logger.entering(getClass().getName(), "flushJMSDestination", new Object[] {destName, destType});
 
         try{
             validateJMSDestName(destName);
@@ -120,10 +121,8 @@
 
         try {
             flushJMSDestination(destName, destType, target);
-            return;
         } catch (Exception e) {
             logger.throwing(getClass().getName(), "flushJMSDestination", e);
-            //e.printStackTrace();//handleException(e);
             report.setMessage(localStrings.getLocalString("flush.jms.dest.failed",
                 "Flush JMS Destination failed", e.getMessage()));
             report.setActionExitCode(ActionReport.ExitCode.FAILURE);
@@ -154,71 +153,58 @@
                  * This works because we resolve the port numbers
                  * even for standalone instances in MQAddressList.
                  */
-                boolean success = true;
-                Cluster cluster = null;
+                Exception failure = new Exception("Purging failed.");
+                final Cluster cluster;
                 if (ctarget == CommandTarget.CLUSTER){
                     cluster = Globals.get(Domain.class).getClusterNamed(target);
-                }else {
-                    List clustersList = Globals.get(Domain.class).getClusters().getCluster();
+                } else {
+                    List<Cluster> clustersList = Globals.get(Domain.class).getClusters().getCluster();
                     cluster = JmsRaUtil.getClusterForServer(clustersList, target);
                 }
-                List servers =cluster.getInstances(); //target.getServer();
-                for (int server = 0; server < servers.size(); server++) {
+                List<Server> servers = cluster.getInstances();
+                for (Server server : servers) {
                     try {
-                        purgeJMSDestination(destName, destType, ((Server)servers.get(server)).getName());
+                        purgeJMSDestination(destName, destType, server.getName());
                     } catch (Exception e) {
-                        success = false;
-                        //todo: enable localized string
-                        logger.log(Level.SEVERE,/*localStrings.getLocalString("admin.mbeans.rmb.error_purging_jms_dest") +*/ ((Server)servers.get(server)).getName());
+                        failure.addSuppressed(
+                            new RuntimeException("Purging failed for server of this name: " + server.getName(), e));
                     }
                 }
-                if (!success) {
-                    //todo: enable localized string
-                    throw new Exception();//localStrings.getLocalString("admin.mbeans.rmb.error_purging_jms_dest"));
+                if (failure.getSuppressed().length != 0) {
+                    throw failure;
                 }
-
             } else {
                 purgeJMSDestination(destName, destType, tgtName);
             }
 
         } catch (Exception e) {
-            logger.throwing(getClass().getName(), "flushJMSDestination", e);
-            handleException(e);
+            throw handleException(e);
         }
     }
 
-    public void purgeJMSDestination(String destName, String destType, String tgtName)
-        throws Exception {
 
+    public void purgeJMSDestination(String destName, String destType, String tgtName) throws Exception {
         logger.log(Level.FINE, "purgeJMSDestination ...");
-        MQJMXConnectorInfo[] mqInfos = getMQJMXConnectorInfos(target, config, serverContext, domain, connectorRuntime);
-
-        if (mqInfos != null && mqInfos.length > 0) {
-            for (MQJMXConnectorInfo mqInfo : mqInfos){
-                try {
-
-                    MBeanServerConnection mbsc = mqInfo.getMQMBeanServerConnection();
-
-                    if (destType.equalsIgnoreCase("topic")) {
-                        destType = DESTINATION_TYPE_TOPIC;
-                    } else if (destType.equalsIgnoreCase("queue")) {
-                        destType = DESTINATION_TYPE_QUEUE;
-                    }
-                    ObjectName on = createDestinationConfig(destType, destName);
-
-                    mbsc.invoke(on, "purge", null, null);
-                } catch (Exception e) {
-                    //log JMX Exception trace as WARNING
-                    logAndHandleException(e, "admin.mbeans.rmb.error_purging_jms_dest");
-                } finally {
-                    try {
-                        if(mqInfo != null) {
-                            mqInfo.closeMQMBeanServerConnection();
-                        }
-                    } catch (Exception e) {
-                        handleException(e);
-                    }
-                }
+        final MQJMXConnectorInfo mqInfo = createMQJMXConnectorInfo(target, config, serverContext, domain, connectorRuntime);
+        if (mqInfo == null) {
+            return;
+        }
+        try {
+            MBeanServerConnection mbsc = mqInfo.getMQMBeanServerConnection();
+            if (destType.equalsIgnoreCase("topic")) {
+                destType = DESTINATION_TYPE_TOPIC;
+            } else if (destType.equalsIgnoreCase("queue")) {
+                destType = DESTINATION_TYPE_QUEUE;
+            }
+            ObjectName on = createDestinationConfig(destType, destName);
+            mbsc.invoke(on, "purge", null, null);
+        } catch (Exception e) {
+            throw logAndHandleException(e, "admin.mbeans.rmb.error_purging_jms_dest");
+        } finally {
+            try {
+                mqInfo.close();
+            } catch (Exception e) {
+                throw handleException(e);
             }
         }
     }
diff --git a/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/GetJmsPhysicalDestinationCommand.java b/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/GetJmsPhysicalDestinationCommand.java
index 45310d8..85c1075 100644
--- a/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/GetJmsPhysicalDestinationCommand.java
+++ b/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/GetJmsPhysicalDestinationCommand.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -20,30 +21,38 @@
 import com.sun.enterprise.config.serverbeans.Config;
 import com.sun.enterprise.config.serverbeans.Domain;
 import com.sun.enterprise.config.serverbeans.Server;
-import com.sun.enterprise.util.LocalStringManagerImpl;
 import com.sun.enterprise.util.SystemPropertyConstants;
+
+import jakarta.inject.Inject;
+import jakarta.inject.Named;
+
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
 import java.util.logging.Level;
 
-import jakarta.inject.Inject;
-import jakarta.inject.Named;
 import javax.management.MBeanAttributeInfo;
 import javax.management.MBeanServerConnection;
 import javax.management.ObjectName;
+
 import org.glassfish.api.ActionReport;
 import org.glassfish.api.Param;
-import org.glassfish.api.admin.*;
+import org.glassfish.api.admin.AdminCommand;
+import org.glassfish.api.admin.AdminCommandContext;
+import org.glassfish.api.admin.CommandLock;
+import org.glassfish.api.admin.ExecuteOn;
+import org.glassfish.api.admin.RestEndpoint;
+import org.glassfish.api.admin.RestEndpoints;
+import org.glassfish.api.admin.RestParam;
+import org.glassfish.api.admin.RuntimeType;
+import org.glassfish.api.admin.ServerEnvironment;
 import org.glassfish.config.support.CommandTarget;
 import org.glassfish.config.support.TargetType;
-import org.glassfish.internal.api.ServerContext;
-
-import org.jvnet.hk2.annotations.Service;
 import org.glassfish.hk2.api.PerLookup;
+import org.glassfish.internal.api.ServerContext;
+import org.jvnet.hk2.annotations.Service;
 
 /**
- *
  * @author jasonlee
  */
 @Service(name = "__get-jmsdest")
@@ -68,7 +77,6 @@
         })
 })
 public class GetJmsPhysicalDestinationCommand extends JMSDestination implements AdminCommand {
-    final private static LocalStringManagerImpl localStrings = new LocalStringManagerImpl(GetJmsPhysicalDestinationCommand.class);
 
     @Param(name = "desttype", shortName = "t", optional = false)
     String destType;
@@ -95,14 +103,13 @@
     @Override
     public void execute(AdminCommandContext context) {
         final ActionReport report = context.getActionReport();
-        logger.entering(getClass().getName(), "__getJmsPhysicalDestination",
-                new Object[]{destName, destType});
+        logger.entering(getClass().getName(), "__getJmsPhysicalDestination", new Object[] {destName, destType});
 
         try {
             validateJMSDestName(destName);
             validateJMSDestType(destType);
 
-            Map entity = getJMSDestination();
+            Map<String, Object> entity = getJMSDestination();
             Properties ep = new Properties();
             ep.put("entity", entity);
             report.setExtraProperties(ep);
@@ -110,20 +117,14 @@
         } catch (Exception e) {
             report.setMessage(e.getMessage());
             report.setActionExitCode(ActionReport.ExitCode.FAILURE);
-            return;
         }
     }
 
-    protected Map<String, Object> getJMSDestination()
-            throws Exception {
 
-        logger.log(Level.FINE, "__getJmsPhysicalDestination ...");
-        MQJMXConnectorInfo mqInfo = getMQJMXConnectorInfo(target, config, serverContext, domain, connectorRuntime);
-        Map<String, Object> destAttrs = new HashMap<String, Object>();
-
-        try {
+    protected Map<String, Object> getJMSDestination() throws Exception {
+        logger.log(Level.FINE, "getJMSDestination ...");
+        try (MQJMXConnectorInfo mqInfo = createMQJMXConnectorInfo(target, config, serverContext, domain, connectorRuntime)) {
             MBeanServerConnection mbsc = mqInfo.getMQMBeanServerConnection();
-
             if (destType.equalsIgnoreCase("topic")) {
                 destType = DESTINATION_TYPE_TOPIC;
             } else if (destType.equalsIgnoreCase("queue")) {
@@ -131,22 +132,13 @@
             }
             ObjectName on = new ObjectName(MBEAN_DOMAIN_NAME + ":type=Destination,subtype=Config,desttype=" + destType +",name=\"" + destName + "\"");
             MBeanAttributeInfo[] attribs = mbsc.getMBeanInfo(on).getAttributes();
+            Map<String, Object> destAttrs = new HashMap<>();
             for (MBeanAttributeInfo attrib: attribs){
                 destAttrs.put(attrib.getName(), mbsc.getAttribute(on, attrib.getName()));
             }
             return destAttrs;
         } catch (Exception e) {
-            //log JMX Exception trace as WARNING
-            logAndHandleException(e, "admin.mbeans.rmb.error_getting_jms_dest");
-        } finally {
-            try {
-                if (mqInfo != null) {
-                    mqInfo.closeMQMBeanServerConnection();
-                }
-            } catch (Exception e) {
-                handleException(e);
-            }
+            throw logAndHandleException(e, "admin.mbeans.rmb.error_getting_jms_dest");
         }
-        return destAttrs;
     }
 }
diff --git a/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/JMSAdminException.java b/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/JMSAdminException.java
index 805351f..f9477c5 100644
--- a/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/JMSAdminException.java
+++ b/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/JMSAdminException.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 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
@@ -17,20 +18,18 @@
 package org.glassfish.jms.admin.cli;
 
 
+/**
+ * JMS Admin command failure.
+ */
 public class JMSAdminException extends Exception {
 
-    /**
-     * Exception reference
-     **/
-    private volatile Exception linkedException;
-    private String _message = null;
+    private static final long serialVersionUID = 1L;
 
     /**
      * Constructs an JMSAdminException object
      */
     public JMSAdminException() {
         super();
-        linkedException = null;
     }
 
 
@@ -41,53 +40,38 @@
      */
     public JMSAdminException(String message) {
         super(message);
-        _message = message;
-        linkedException = null;
+    }
+
+
+    /**
+     * Constructs an JMSAdminException object
+     *
+     * @param message Exception message
+     * @param cause original cause.
+     */
+    public JMSAdminException(String message, Exception cause) {
+        super(message, cause);
     }
 
 
     /**
      * Gets the exception linked to this one
      *
-     * @return the linked Exception, null if none
-     **/
+     * @return same as {@link #getCause()}
+     */
+    @Deprecated(forRemoval = true)
     public Exception getLinkedException() {
-        return (linkedException);
+        return (Exception) getCause();
     }
 
 
     /**
-     * Adds a linked Exception
+     * Calls {@link #initCause(Throwable)}
      *
      * @param ex the linked Exception
-     **/
+     */
+    @Deprecated(forRemoval = true)
     public void setLinkedException(Exception ex) {
-        linkedException = ex;
+        super.initCause(ex);
     }
-
-
-    /**
-     * Returns the message along with the message from any linked exception.
-     **/
-    @Override
-    public String getMessage() {
-        String retString = null;
-
-        // Return the message of this exception.
-        if (_message != null) {
-            retString = _message;
-        }
-
-        // Append any message from the linked exception.
-        Exception localLinkedException = linkedException;
-        if (localLinkedException != null && localLinkedException.getMessage() != null) {
-            if (retString != null) {
-                retString += retString + "\n" + localLinkedException.getMessage();
-            } else {
-                retString = localLinkedException.getMessage();
-            }
-        }
-        return retString;
-    }
-
 }
diff --git a/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/JMSDestination.java b/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/JMSDestination.java
index d9d7425..2fd0966 100644
--- a/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/JMSDestination.java
+++ b/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/JMSDestination.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -36,48 +37,51 @@
 import java.util.logging.Level;
 import java.util.*;
 import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedExceptionAction;
 import java.io.StringWriter;
 import java.io.PrintWriter;
 
 import com.sun.enterprise.config.serverbeans.Cluster;
 import org.glassfish.internal.api.ServerContext;
+
+import static com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter.ADMINPASSWORD;
+import static com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter.ADMINUSERNAME;
+
 import org.glassfish.internal.api.Globals;
 import org.glassfish.config.support.CommandTarget;
 
+/**
+ * Common parent for JMS Destination admin commands
+ */
 public abstract class JMSDestination {
 
     protected static final Logger logger = Logger.getLogger(LogUtils.JMS_ADMIN_LOGGER);
     private static final LocalStringManagerImpl localStrings = new LocalStringManagerImpl(CreateJMSDestination.class);
 
-    // JMS destination types
     public static final String JMS_DEST_TYPE_TOPIC = "topic";
     public static final String JMS_DEST_TYPE_QUEUE = "queue";
+
     public static final String DEFAULT_MAX_ACTIVE_CONSUMERS = "-1";
     public static final String MAX_ACTIVE_CONSUMERS_ATTRIBUTE = "MaxNumActiveConsumers";
     public static final String MAX_ACTIVE_CONSUMERS_PROPERTY = "maxNumActiveConsumers";
     public static final String JMXSERVICEURLLIST = "JMXServiceURLList";
     public static final String JMXCONNECTORENV = "JMXConnectorEnv";
-    // flag to enable the use of JMX for JMS destination commands
-    // if false uses the old behavior
-    // The value for DONT_USE_MQ_JMX can be set thru sysproperty
-    private static final boolean USE_JMX = true;// !(Boolean.getBoolean("DONT_USE_MQ_JMX"));
-    // Following properties are from com.sun.messaging.jms.management.server.MQObjectName
-    /* Domain name for MQ MBeans */
-    protected static final String MBEAN_DOMAIN_NAME = "com.sun.messaging.jms.server";
-    /* String representation of the ObjectName for the DestinationManager Config MBean. */
-    protected static final String DESTINATION_MANAGER_CONFIG_MBEAN_NAME = MBEAN_DOMAIN_NAME + ":type="
-        + "DestinationManager" + ",subtype=Config";
 
-    protected static final String CLUSTER_CONFIG_MBEAN_NAME
-    = MBEAN_DOMAIN_NAME
-    + ":type=" + "Cluster"
-    + ",subtype=Config";
-    // Queue destination type
+    // Following properties are from com.sun.messaging.jms.management.server.MQObjectName
+    /** Domain name for MQ MBeans */
+    protected static final String MBEAN_DOMAIN_NAME = "com.sun.messaging.jms.server";
+    /** String representation of the ObjectName for the DestinationManager Config MBean. */
+    protected static final String DESTINATION_MANAGER_CONFIG_MBEAN_NAME = MBEAN_DOMAIN_NAME
+        + ":type=DestinationManager,subtype=Config";
+
+    protected static final String CLUSTER_CONFIG_MBEAN_NAME = MBEAN_DOMAIN_NAME + ":type=Cluster,subtype=Config";
+    /** Queue destination type */
     protected static final String DESTINATION_TYPE_QUEUE= "q";
-    //Topic destination type
+    /** Topic destination type */
     protected static final String DESTINATION_TYPE_TOPIC = "t";
 
-    protected void validateJMSDestName(String destName) {
+    protected void validateJMSDestName(final String destName) {
         if (destName == null || destName.length() <= 0) {
             throw new IllegalArgumentException(
                 localStrings.getLocalString("admin.mbeans.rmb.invalid_jms_destname", destName));
@@ -85,143 +89,110 @@
     }
 
 
-    protected void validateJMSDestType(String destType) {
-        if (destType == null || destType.length() <= 0) {
+    protected void validateJMSDestType(final String destType) {
+        if (destType == null || destType.isEmpty()) {
             throw new IllegalArgumentException(
                 localStrings.getLocalString("admin.mbeans.rmb.invalid_jms_desttype", destType));
         }
-        if (!destType.equals(JMS_DEST_TYPE_QUEUE) && !destType.equals(JMS_DEST_TYPE_TOPIC)) {
+        if (!JMS_DEST_TYPE_QUEUE.equals(destType) && !JMS_DEST_TYPE_TOPIC.equals(destType)) {
             throw new IllegalArgumentException(
                 localStrings.getLocalString("admin.mbeans.rmb.invalid_jms_desttype", destType));
         }
     }
 
 
-    protected MQJMXConnectorInfo getMQJMXConnectorInfo(String target, Config config, ServerContext serverContext,
-        Domain domain, ConnectorRuntime connectorRuntime) throws Exception {
-        logger.log(Level.FINE, "getMQJMXConnectorInfo for " + target);
-        MQJMXConnectorInfo mcInfo = null;
-
-        try {
-            MQJMXConnectorInfo[] cInfo = getMQJMXConnectorInfos(target, config, serverContext, domain,
-                connectorRuntime);
-            if (cInfo.length < 1) {
-                throw new Exception(
-                    localStrings.getLocalString("admin.mbeans.rmb.error_obtaining_jms", "Error obtaining JMS Info"));
-            }
-            mcInfo = cInfo[0];
-
-        } catch (Exception e) {
-            handleException(e);
-        }
-        return mcInfo;
-    }
-
-
-    protected MQJMXConnectorInfo[] getMQJMXConnectorInfos(final String target, final Config config,
-        final ServerContext serverContext, final Domain domain, ConnectorRuntime connectorRuntime)
-        throws ConnectorRuntimeException {
+    protected MQJMXConnectorInfo createMQJMXConnectorInfo(final String targetName, final Config config,
+        final ServerContext serverContext, final Domain domain, final ConnectorRuntime connectorRuntime)
+            throws ConnectorRuntimeException {
+        logger.log(Level.FINE, "createMQJMXConnectorInfo for {0}", targetName);
         try {
             final JmsService jmsService = config.getExtensionByType(JmsService.class);
-
-            ActiveJmsResourceAdapter air = getMQAdapter(connectorRuntime);
-            final Class mqRAClassName = air.getResourceAdapter().getClass();
-            final CommandTarget ctarget = this.getTypeForTarget(target);
-            MQJMXConnectorInfo mqjmxForServer = (MQJMXConnectorInfo) java.security.AccessController
-                .doPrivileged(new java.security.PrivilegedExceptionAction() {
-
-                    @Override
-                    public java.lang.Object run() throws Exception {
-                        if (ctarget == CommandTarget.CLUSTER || ctarget == CommandTarget.CLUSTERED_INSTANCE) {
-                            if (logger.isLoggable(Level.FINE)) {
-                                logger.log(Level.FINE, "Getting JMX connector for" + " cluster target " + target);
-                            }
-                            return _getMQJMXConnectorInfoForCluster(target, jmsService, mqRAClassName, serverContext);
-                        } else {
-                            if (logger.isLoggable(Level.FINE)) {
-                                logger.log(Level.FINE, "Getting JMX connector for" + " standalone target " + target);
-                            }
-                            return _getMQJMXConnectorInfo(target, jmsService, mqRAClassName, serverContext, config, domain);
-                        }
+            final ActiveJmsResourceAdapter air = getMQAdapter(connectorRuntime);
+            final Class<? extends ResourceAdapter> mqRAClassName = air.getResourceAdapter().getClass();
+            final CommandTarget ctarget = this.getTypeForTarget(targetName);
+            final PrivilegedExceptionAction<MQJMXConnectorInfo> action = () -> {
+                if (ctarget == CommandTarget.CLUSTER || ctarget == CommandTarget.CLUSTERED_INSTANCE) {
+                    if (logger.isLoggable(Level.FINE)) {
+                        logger.log(Level.FINE, "Getting JMX connector for cluster target " + targetName);
                     }
-                });
-
-            return new MQJMXConnectorInfo[] {mqjmxForServer};
-        } catch (Exception e) {
-            // e.printStackTrace();
-            ConnectorRuntimeException cre = new ConnectorRuntimeException(e.getMessage());
-            cre.initCause(e);
-            throw cre;
+                    return _getMQJMXConnectorInfoForCluster(targetName, jmsService, mqRAClassName, serverContext);
+                }
+                if (logger.isLoggable(Level.FINE)) {
+                    logger.log(Level.FINE, "Getting JMX connector for standalone target " + targetName);
+                }
+                return createMQJMXConnectorInfo(targetName, jmsService, mqRAClassName, serverContext, config, domain);
+            };
+            return AccessController.doPrivileged(action);
+        } catch (final Exception e) {
+            throw new ConnectorRuntimeException(e);
         }
     }
 
 
-    protected MQJMXConnectorInfo _getMQJMXConnectorInfo(
-        String targetName, JmsService jmsService, Class mqRAClassName, ServerContext serverContext, Config config, Domain domain)
-            throws ConnectorRuntimeException {
+    private MQJMXConnectorInfo createMQJMXConnectorInfo(final String targetName, final JmsService jmsService,
+        final Class<? extends ResourceAdapter> mqRAClassName, final ServerContext serverContext, final Config config,
+        final Domain domain) throws ConnectorRuntimeException {
         try {
-            //If DAS, use the default address list, else obtain
+            final MQAddressList mqadList = new MQAddressList();
 
-            String connectionURL = null;
-            MQAddressList mqadList = new MQAddressList();
-            //boolean isDAS = mqadList.isDAS(targetName);
-
+            final String connectionURL;
             if (getTypeForTarget(targetName) == CommandTarget.DAS) {
                 connectionURL = getDefaultAddressList(jmsService).toString();
             } else {
-                //Standalone server instance
-                if (logger.isLoggable(Level.FINE)) {
-                    logger.log(Level.FINE,"not in DAS");
-                    logger.log(Level.FINE," _getMQJMXConnectorInfo - NOT in DAS");
-                }
-                JmsService serverJmsService= getJmsServiceOfStandaloneServerInstance(targetName, config, domain);
-                //MQAddressList mqadList = new MQAddressList(serverJmsService, targetName);
+                logger.log(Level.FINEST," _getMQJMXConnectorInfo - standalone JMS service, NOT in DAS");
+                final JmsService serverJmsService= getJmsServiceOfStandaloneServerInstance(targetName, config, domain);
                 mqadList.setJmsService(serverJmsService);
                 mqadList.setTargetName(targetName);
                 mqadList.setup(false);
                 connectionURL = mqadList.toString();
             }
-            if (logger.isLoggable(Level.FINE)) {
-                logger.log(Level.FINE, " _getMQJMXConnectorInfo - connection URL " + connectionURL);
-            }
-            String adminUserName = null;
-            String adminPassword = null;
-            JmsHost jmsHost = mqadList.getDefaultJmsHost(jmsService);
-            if (jmsHost != null) {//&& jmsHost.isEnabled()) {
+            logger.log(Level.FINE, " _getMQJMXConnectorInfo - connection URL {0}", connectionURL);
+            final String adminUserName;
+            final String adminPassword;
+            final JmsHost jmsHost = mqadList.getDefaultJmsHost(jmsService);
+            if (jmsHost == null) {
+                logger.log(Level.FINE, " _getMQJMXConnectorInfo, using default jms admin user and password ");
+                adminUserName = null;
+                adminPassword = null;
+            } else {
                 adminUserName = jmsHost.getAdminUserName();
                 adminPassword = JmsRaUtil.getUnAliasedPwd(jmsHost.getAdminPassword());
-            } else {
-                if (logger.isLoggable(Level.FINE)) {
-                    logger.log(Level.FINE, " _getMQJMXConnectorInfo, using default jms admin user and password ");
-                }
             }
-            ResourceAdapter raInstance = getConfiguredRA(mqRAClassName,
-                connectionURL, adminUserName, adminPassword);
-            String jmxServiceURL = null, jmxServiceURLList = null;
-            Map<String, ?> jmxConnectorEnv = null;
-            Method[] methds = raInstance.getClass().getMethods();
-            for (Method m : methds) {
-                if (m.getName().equalsIgnoreCase("get" + JMXSERVICEURLLIST)){
-                    jmxServiceURLList = (String)m.invoke(raInstance, new Object[]{});
-                } else if (m.getName().equalsIgnoreCase("get" + JMXCONNECTORENV)){
-                    jmxConnectorEnv = (Map<String,?>)m.invoke(raInstance, new Object[]{});
-                }
-            }
-            if (logger.isLoggable(Level.FINE)) {
-                logger.log(Level.FINE, " _getMQJMXConnectorInfo - jmxServiceURLList " +  jmxServiceURLList);
-                logger.log(Level.FINE, " _getMQJMXConnectorInfo - jmxConnectorEnv " + jmxConnectorEnv);
-            }
-            jmxServiceURL = getFirstJMXServiceURL(jmxServiceURLList);
 
-            MQJMXConnectorInfo mqInfo = new MQJMXConnectorInfo(targetName,
-                ActiveJmsResourceAdapter.getBrokerInstanceName(jmsService) ,
+            final ResourceAdapter raInstance = getConfiguredRA(mqRAClassName, connectionURL, adminUserName, adminPassword);
+            final String jmxServiceURLList = getJmxServiceUrlList(raInstance);
+            final Map<String, ?> jmxConnectorEnv = getJmxConnectorEnv(raInstance);
+            logger.log(Level.CONFIG, " _getMQJMXConnectorInfo - jmxServiceURLList {0}", jmxServiceURLList);
+            logger.log(Level.CONFIG, " _getMQJMXConnectorInfo - jmxConnectorEnv {0}", jmxConnectorEnv);
+            final String jmxServiceURL = getFirstJMXServiceURL(jmxServiceURLList);
+            return new MQJMXConnectorInfo(targetName, ActiveJmsResourceAdapter.getBrokerInstanceName(jmsService),
                 jmsService.getType(), jmxServiceURL, jmxConnectorEnv);
-            return mqInfo;
-        } catch (Exception e) {
-            e.printStackTrace();
-            ConnectorRuntimeException cre = new ConnectorRuntimeException(e.getMessage());
-            cre.initCause(e);
-            throw cre;
+        } catch (final Exception e) {
+            throw new ConnectorRuntimeException(e);
+        }
+    }
+
+
+    private String getJmxServiceUrlList(final ResourceAdapter raInstance) {
+        final String methodName = "get" + JMXSERVICEURLLIST;
+        try {
+            final Method method = raInstance.getClass().getMethod(methodName);
+            return (String) method.invoke(raInstance);
+        } catch (final ReflectiveOperationException e) {
+            logger.log(Level.INFO, "Invocation of " + methodName + " failed, returning null.", e);
+            return null;
+        }
+    }
+
+
+    private Map<String, ?> getJmxConnectorEnv(final ResourceAdapter raInstance) {
+        final String methodName = "get" + JMXCONNECTORENV;
+        try {
+            final Method method = raInstance.getClass().getMethod(methodName);
+            return (Map<String, ?>) method.invoke(raInstance);
+        } catch (final ReflectiveOperationException e) {
+            logger.log(Level.INFO, "Invocation of " + methodName + " failed, returning null.", e);
+            return null;
         }
     }
 
@@ -231,188 +202,95 @@
      *  executed in DAS, an admin API is used to resolve hostnames and ports of
      *  cluster instances for LOCAL type brokers while creating the connectionURL.
      */
-    protected  MQJMXConnectorInfo _getMQJMXConnectorInfoForCluster(
-        String target, JmsService jmsService, Class mqRAClassName, ServerContext serverContext)
+    protected MQJMXConnectorInfo _getMQJMXConnectorInfoForCluster(final String target, final JmsService jmsService,
+        final Class<? extends ResourceAdapter> mqRAClass, final ServerContext serverContext)
             throws ConnectorRuntimeException {
-        // Create a new RA instance.
-        ResourceAdapter raInstance = null;
-        // Set the ConnectionURL
-        MQAddressList list = null;
+        final ResourceAdapter raInstance;
         try {
+            final MQAddressList list;
             if (jmsService.getType().equalsIgnoreCase(ActiveJmsResourceAdapter.REMOTE)) {
                 list = getDefaultAddressList(jmsService);
             } else {
                 list = new MQAddressList();
-                CommandTarget ctarget = this.getTypeForTarget(target);
+                final CommandTarget ctarget = this.getTypeForTarget(target);
                 if (ctarget == CommandTarget.CLUSTER) {
-                    Server[] servers = list.getServersInCluster(target);
+                    final Server[] servers = list.getServersInCluster(target);
                     if (servers != null && servers.length > 0) {
                         list.setInstanceName(servers[0].getName());
                     }
-                } else if (ctarget == CommandTarget.CLUSTERED_INSTANCE ){
+                } else if (ctarget == CommandTarget.CLUSTERED_INSTANCE) {
                     list.setInstanceName(target);
                 }
-                java.util.Map<String,JmsHost> hostMap =  list.getResolvedLocalJmsHostsInMyCluster(true);
-
-                if ( hostMap.size() == 0 ) {
-                    String msg = localStrings.getLocalString("mqjmx.no_jms_hosts", "No JMS Hosts Configured");
+                final Map<String, JmsHost> hostMap = list.getResolvedLocalJmsHostsInMyCluster(true);
+                if (hostMap.isEmpty()) {
+                    final String msg = localStrings.getLocalString("mqjmx.no_jms_hosts", "No JMS Hosts Configured");
                     throw new ConnectorRuntimeException(msg);
                 }
-
-                for (JmsHost host : hostMap.values()) {
+                for (final JmsHost host : hostMap.values()) {
                     list.addMQUrl(host);
                 }
             }
 
-            String connectionUrl = list.toString();
-            String adminUserName = null;
-            String adminPassword = null;
-            JmsHost jmsHost = list.getDefaultJmsHost(jmsService);
-            if (jmsHost != null){// && jmsHost.isEnabled()) {
+            final String connectionUrl = list.toString();
+            final String adminUserName;
+            final String adminPassword;
+            final JmsHost jmsHost = list.getDefaultJmsHost(jmsService);
+            if (jmsHost == null) {
+                logger.log(Level.FINE, " _getMQJMXConnectorInfo, using default jms admin user and password ");
+                adminUserName = null;
+                adminPassword = null;
+            } else {
                 adminUserName = jmsHost.getAdminUserName();
                 adminPassword = JmsRaUtil.getUnAliasedPwd(jmsHost.getAdminPassword());
-            } else {
-                if (logger.isLoggable(Level.FINE)) {
-                    logger.log(Level.FINE, " _getMQJMXConnectorInfo, using default jms admin user and password ");
-                }
             }
-            raInstance = getConfiguredRA(mqRAClassName, connectionUrl, adminUserName, adminPassword);
-        } catch (Exception e) {
-            e.printStackTrace();
-            ConnectorRuntimeException cre = new ConnectorRuntimeException(e.getMessage());
-            cre.initCause(e);
-            throw cre;
+            raInstance = getConfiguredRA(mqRAClass, connectionUrl, adminUserName, adminPassword);
+        } catch (final Exception e) {
+            throw new ConnectorRuntimeException(e);
         }
 
         try {
-            String jmxServiceURL = null, jmxServiceURLList = null;
-            Map<String, ?> jmxConnectorEnv = null;
-            Method[] methds = raInstance.getClass().getMethods();
-            for (Method m : methds) {
-                if (m.getName().equalsIgnoreCase("get" + JMXSERVICEURLLIST)){
-                    jmxServiceURLList = (String)m.invoke(raInstance, new Object[]{});
-                    if (jmxServiceURLList != null && !jmxServiceURLList.trim().equals("")){
-                        jmxServiceURL = getFirstJMXServiceURL(jmxServiceURLList);
-                    }
-                } else if (m.getName().equalsIgnoreCase("get" + JMXCONNECTORENV)){
-                    jmxConnectorEnv = (Map<String,?>)m.invoke(raInstance, new Object[]{});
-                }
-            }
-            MQJMXConnectorInfo mqInfo = new MQJMXConnectorInfo(target,
-                ActiveJmsResourceAdapter.getBrokerInstanceName(jmsService),
+            final String jmxServiceURLList = getJmxServiceUrlList(raInstance);
+            final Map<String, ?> jmxConnectorEnv = getJmxConnectorEnv(raInstance);
+            final String jmxServiceURL = getFirstJMXServiceURL(jmxServiceURLList);
+            return new MQJMXConnectorInfo(target, ActiveJmsResourceAdapter.getBrokerInstanceName(jmsService),
                 jmsService.getType(), jmxServiceURL, jmxConnectorEnv);
-            return mqInfo;
-        } catch (Exception e) {
-            e.printStackTrace();
-            ConnectorRuntimeException cre = new ConnectorRuntimeException(e.getMessage());
-            cre.initCause(e);
-            throw cre;
+        } catch (final Exception e) {
+            throw new ConnectorRuntimeException(e);
         }
     }
 
-      /*  protected boolean isAConfig(String targetName) throws Exception {
-                Domain domain = Globals.get(Domain.class);
-                Configs configs = domain.getConfigs();
-                List configsList = configs.getConfig();
-                for (int i =0; i < configsList.size(); i++){
-                    Config config = (Config)configsList.get(i);
-                    if (targetName.equals(config.getName()))
-                        return true;
-                }
-                return false;
-                //ConfigContext con = com.sun.enterprise.admin.server.core.AdminService.getAdminService().getAdminContext().getAdminConfigContext();
-                //return ServerHelper.isAConfig(con, targetName);
-            } */
-
-     /*   protected JmsHost getDefaultJmsHost(JmsService jmsService){
-            String defaultJmsHost = jmsService.getDefaultJmsHost();
-            JmsHost jmsHost = null;
-           if (defaultJmsHost == null || defaultJmsHost.equals("")) {
-                 try {
-                         jmsHost = jmsService.getJmsHost().get(0);
-                 }catch (Exception e) {
-                     ;
-                 }
-            } else {
-                    for (JmsHost defaultHost: jmsService.getJmsHost())
-                        if(defaultJmsHost.equals(defaultHost.getName()))
-                            jmsHost = defaultHost;
-            }
-            return jmsHost;
-        } */
-
-        /* protected Map<String, JmsHost> getResolvedLocalJmsHostsInCluster(String clusterName, MQAddressList list) {
-             Map<String, JmsHost> map = new HashMap<String, JmsHost> ();
-
-             Domain domain = Globals.get(Domain.class);
-             Clusters clusters = domain.getClusters();
-             List clusterList = clusters.getCluster();
-             Cluster cluster = null;
-             for (int i =0; i < clusterList.size(); i++){
-                if (clusterName.equals(((Cluster)clusterList.get(i)).getName()))
-                    cluster =    (Cluster)clusterList.get(i);
-             }
-
-        //final String myCluster      = ClusterHelper.getClusterByName(domainCC, clusterName).getName();
-        final Server[] buddies      = this.getServersInCluster(cluster);//ServerHelper.getServersInCluster(domainCC, myCluster);
-        final Config cfg =  getConfigForServer(buddies[0]);
-
-             final String myCluster      = ClusterHelper.getClusterByName(domainCC, clusterName).getName();
-             final Server[] buddies      = ServerHelper.getServersInCluster(domainCC, myCluster);
-             for (final Server as : buddies) {
-             try {
-                 final JmsHost copy   = getResolvedJmsHost(as);
-                 map.put(as.getName(), copy);
-                } catch (Exception e) {
-                    // we dont add the host if we cannot get it
-                    ;
-                }
-             }
-             return map;
-        } */
-
 
     /**
      * Configures an instance of MQ-RA with the connection URL passed in.
      * This configured RA is then used to obtain the JMXServiceURL/JMXServiceURLList
      */
-    protected ResourceAdapter getConfiguredRA(Class mqRAclassname, String connectionURL, String adminuser,
-        String adminpasswd) throws Exception {
-        ResourceAdapter raInstance = (ResourceAdapter) mqRAclassname.newInstance();
-        Method setConnectionURL = mqRAclassname.getMethod(
+    protected ResourceAdapter getConfiguredRA(final Class<? extends ResourceAdapter> mqRAclassname,
+        final String connectionURL, final String adminuser, final String adminpasswd) throws Exception {
+        final ResourceAdapter raInstance = mqRAclassname.getDeclaredConstructor().newInstance();
+        final Method setConnectionURL = mqRAclassname.getMethod(
             "set" + ActiveJmsResourceAdapter.CONNECTION_URL, new Class[] {String.class});
         setConnectionURL.invoke(raInstance, new Object[] {connectionURL});
-        if (logger.isLoggable(Level.FINE)) {
-            logger.log(Level.FINE, " getConfiguredRA - set connectionURL as " + connectionURL);
-        }
+        logger.log(Level.FINE, "getConfiguredRA - set connectionURL as {0}", connectionURL);
         if (adminuser != null) {
-            Method setAdminUser = mqRAclassname.getMethod(
-                "set" + ActiveJmsResourceAdapter.ADMINUSERNAME,
-                new Class[] { String.class});
+            final Method setAdminUser = mqRAclassname.getMethod("set" + ADMINUSERNAME, new Class[] {String.class});
             setAdminUser.invoke(raInstance, new Object[] {adminuser});
-            if (logger.isLoggable(Level.FINE)) {
-                logger.log(Level.FINE, " getConfiguredRA - set admin user as " + adminuser);
-            }
+            logger.log(Level.FINE, "getConfiguredRA - set admin user as {0}", adminuser);
         }
         if (adminpasswd != null) {
-            Method setAdminPasswd = mqRAclassname.getMethod(
-                "set" + ActiveJmsResourceAdapter.ADMINPASSWORD, new Class[] {String.class});
+            final Method setAdminPasswd = mqRAclassname.getMethod("set" + ADMINPASSWORD, new Class[] {String.class});
             setAdminPasswd.invoke(raInstance, new Object[] {adminpasswd});
-            if (logger.isLoggable(Level.FINE)) {
-                logger.log(Level.FINE, " getConfiguredRA - set admin passwd as *****  ");
-            }
+            logger.log(Level.FINE, "getConfiguredRA - set admin passwd");
         }
         return raInstance;
     }
 
 
-    private JmsService getJmsServiceOfStandaloneServerInstance(String target, Config cfg, Domain domain) throws Exception {
+    private JmsService getJmsServiceOfStandaloneServerInstance(final String target, final Config cfg, final Domain domain) throws Exception {
         if (logger.isLoggable(Level.FINE)) {
-            logger.log(Level.FINE, "getJMSServiceOfSI LL " + target);
-            //ConfigContext con = com.sun.enterprise.admin.server.core.AdminService.getAdminService().getAdminContext().getAdminConfigContext();
+            logger.log(Level.FINE, "getJMSServiceOfSI target: {0}", target);
             logger.log(Level.FINE, "cfg " + cfg);
         }
-        JmsService jmsService = cfg.getExtensionByType(JmsService.class);
+        final JmsService jmsService = cfg.getExtensionByType(JmsService.class);
         if (logger.isLoggable(Level.FINE)) {
             logger.log(Level.FINE, "jmsservice " + jmsService);
         }
@@ -420,42 +298,33 @@
     }
 
 
-    protected String getFirstJMXServiceURL(String jmxServiceURLList) {
-        //If type is REMOTE, MQ RA returns a null jmxServiceURL and a non-null
-        //jmxServiceURLList for PE also.
-        if ((jmxServiceURLList == null) || ("".equals(jmxServiceURLList))) {
-            return jmxServiceURLList;
-        } else {
-            StringTokenizer tokenizer = new StringTokenizer(jmxServiceURLList, " ");
-            return  tokenizer.nextToken();
+    private String getFirstJMXServiceURL(final String jmxServiceURLList) {
+        if (jmxServiceURLList == null || jmxServiceURLList.isBlank()) {
+            return null;
         }
+        final StringTokenizer tokenizer = new StringTokenizer(jmxServiceURLList, " ");
+        return tokenizer.nextToken();
     }
 
 
-    protected CommandTarget getTypeForTarget(String target){
-        Domain domain = Globals.get(Domain.class);
-        Config config = domain.getConfigNamed(target);
+    protected CommandTarget getTypeForTarget(final String target){
+        final Domain domain = Globals.get(Domain.class);
+        final Config config = domain.getConfigNamed(target);
         if (config != null) {
             return CommandTarget.CONFIG;
         }
-        Server targetServer = domain.getServerNamed(target);
-        if (targetServer!=null) {
-            // Clusters clusters = domain.getClusters();
-            // List clustersList = clusters.getCluster();
-            //if (JmsRaUtil.isServerClustered(clustersList, target))
-            //  return CommandTarget.CLUSTERED_INSTANCE;
+        final Server targetServer = domain.getServerNamed(target);
+        if (targetServer != null) {
             if (targetServer.isDas()) {
                 return CommandTarget.DAS;
-            } else {
-                return CommandTarget.STANDALONE_INSTANCE;
             }
-        }//end if (targetServer!=null)
-        Cluster cluster =domain.getClusterNamed(target);
-        if (cluster!=null) {
+            return CommandTarget.STANDALONE_INSTANCE;
+        }
+        final Cluster cluster = domain.getClusterNamed(target);
+        if (cluster != null) {
             return CommandTarget.CLUSTER;
         }
         return CommandTarget.DAS;
-
     }
 
 
@@ -464,186 +333,143 @@
      * performed in DAS.
      */
     protected ActiveJmsResourceAdapter getMQAdapter(final ConnectorRuntime connectorRuntime) throws Exception {
-        ActiveJmsResourceAdapter air = (ActiveJmsResourceAdapter) java.security.AccessController
-            .doPrivileged(new java.security.PrivilegedExceptionAction() {
-
-                @Override
-                public java.lang.Object run() throws Exception {
-                    String module = ConnectorConstants.DEFAULT_JMS_ADAPTER;
-                    String loc = ConnectorsUtil.getSystemModuleLocation(module);
-                    connectorRuntime.createActiveResourceAdapter(loc, module, null);
-                    return ConnectorRegistry.getInstance().getActiveResourceAdapter(module);
-                }
-            });
-        return air;
+        PrivilegedExceptionAction<ActiveJmsResourceAdapter> action = () -> {
+            final String module = ConnectorConstants.DEFAULT_JMS_ADAPTER;
+            final String loc = ConnectorsUtil.getSystemModuleLocation(module);
+            connectorRuntime.createActiveResourceAdapter(loc, module, null);
+            return (ActiveJmsResourceAdapter) ConnectorRegistry.getInstance().getActiveResourceAdapter(module);
+        };
+        return AccessController.doPrivileged(action);
     }
 
-      /*   private boolean isDAS(String targetName) {
-             //return true;
-            if (isAConfig(targetName)) {
-            return false;
+
+    protected MQAddressList getDefaultAddressList(final JmsService jmsService) throws Exception {
+        final MQAddressList list = new MQAddressList(jmsService);
+        list.setup(false);
+        return list;
+    }
+
+
+    protected final JMSAdminException logAndHandleException(final Exception cause, final String messageKey)
+        throws JMSAdminException {
+        return handleException(new Exception(localStrings.getLocalString(messageKey, null), cause));
+    }
+
+
+    /**
+     * @param e original cause; it is not included in the result, because the caller's classloader
+     *            might not know all internal exception.
+     * @return JMSAdminException to throw
+     */
+    protected final JMSAdminException handleException(final Exception e) {
+        logger.log(Level.WARNING, "Handling exception to be thrown.", e);
+        if (e instanceof JMSAdminException)  {
+            return ((JMSAdminException)e);
+        }
+        final String msg = e.getMessage();
+        if (msg == null) {
+            try (PrintWriter writer = new PrintWriter(new StringWriter())) {
+                e.printStackTrace(writer);
+                return new JMSAdminException(writer.toString());
             }
+        }
+        return new JMSAdminException(msg);
+    }
 
-            return getServerByName(targetName).isDas();
 
-        }*/
-       /* private Server getServerByName(String serverName){
-            Domain domain = Globals.get(Domain.class);
-            Servers servers = domain.getServers();
-            List serverList = servers.getServer();
+    // XXX: To refactor into a Generic attribute type mapper, so that it is extensible later.
+    protected AttributeList convertProp2Attrs(final Properties destProps) {
+        final AttributeList destAttrs = new AttributeList();
 
-            for (int i=0; i < serverList.size(); i++){
-                Server server = (Server) serverList.get(i);
-                if(serverName.equals(server.getName()))
-                    return server;
+        String propName = null;
+        String propValue = null;
+
+        for (final Enumeration e = destProps.propertyNames(); e.hasMoreElements();) {
+            propName = (String) e.nextElement();
+            if (propName.equals("AutoCreateQueueMaxNumActiveConsumers")) {
+                destAttrs.add(new Attribute("AutoCreateQueueMaxNumActiveConsumers",
+                    Integer.valueOf(destProps.getProperty("AutoCreateQueueMaxNumActiveConsumers"))));
+            } else if (propName.equals("maxNumActiveConsumers")) {
+                destAttrs.add(new Attribute("MaxNumActiveConsumers",
+                    Integer.valueOf(destProps.getProperty("maxNumActiveConsumers"))));
+            } else if (propName.equals("MaxNumActiveConsumers")) {
+                destAttrs.add(new Attribute("MaxNumActiveConsumers",
+                    Integer.valueOf(destProps.getProperty("MaxNumActiveConsumers"))));
+            } else if (propName.equals("AutoCreateQueueMaxNumBackupConsumers")) {
+                destAttrs.add(new Attribute("AutoCreateQueueMaxNumBackupConsumers",
+                    Integer.valueOf(destProps.getProperty("AutoCreateQueueMaxNumBackupConsumers"))));
+            } else if (propName.equals("AutoCreateQueues")) {
+                boolean b = false;
+                propValue = destProps.getProperty("AutoCreateQueues");
+                if (propValue.equalsIgnoreCase("true")) {
+                    b = true;
+                }
+                destAttrs.add(new Attribute("AutoCreateQueues", Boolean.valueOf(b)));
+            } else if (propName.equals("AutoCreateTopics")) {
+                boolean b = false;
+                propValue = destProps.getProperty("AutoCreateTopics");
+                if (propValue.equalsIgnoreCase("true")) {
+                    b = true;
+                }
+                destAttrs.add(new Attribute("AutoCreateTopics", Boolean.valueOf(b)));
+            } else if (propName.equals("DMQTruncateBody")) {
+                boolean b = false;
+                propValue = destProps.getProperty("DMQTruncateBody");
+                if (propValue.equalsIgnoreCase("true")) {
+                    b = true;
+                }
+                destAttrs.add(new Attribute("DMQTruncateBody", Boolean.valueOf(b)));
+            } else if (propName.equals("LogDeadMsgs")) {
+                boolean b = false;
+                propValue = destProps.getProperty("LogDeadMsgs");
+                if (propValue.equalsIgnoreCase("true")) {
+                    b = true;
+                }
+                destAttrs.add(new Attribute("LogDeadMsgs", Boolean.valueOf(b)));
+            } else if (propName.equals("MaxBytesPerMsg")) {
+                destAttrs.add(new Attribute("MaxBytesPerMsg",
+                    Long.valueOf(destProps.getProperty("MaxBytesPerMsg"))));
+            } else if (propName.equals("MaxNumMsgs")) {
+                destAttrs.add(new Attribute("MaxNumMsgs",
+                    Long.valueOf(destProps.getProperty("MaxNumMsgs"))));
+            } else if (propName.equals("MaxTotalMsgBytes")) {
+                destAttrs.add(new Attribute("MaxTotalMsgBytes",
+                    Long.valueOf(destProps.getProperty("MaxTotalMsgBytes"))));
+            } else if (propName.equals("NumDestinations")) {
+                destAttrs.add(new Attribute("NumDestinations",
+                    Integer.valueOf(destProps.getProperty("NumDestinations"))));
+            } else if (propName.equals("ConsumerFlowLimit")) {
+                destAttrs.add(new Attribute("ConsumerFlowLimit",
+                    Long.valueOf(destProps.getProperty("ConsumerFlowLimit"))));
+            } else if (propName.equals("LocalDeliveryPreferred")) {
+                destAttrs.add(new Attribute("LocalDeliveryPreferred",
+                    getBooleanValue(destProps.getProperty("LocalDeliveryPreferred"))));
+            } else if (propName.equals("ValidateXMLSchemaEnabled")) {
+                destAttrs.add(new Attribute("ValidateXMLSchemaEnabled",
+                    getBooleanValue(destProps.getProperty("ValidateXMLSchemaEnabled"))));
+            } else if (propName.equals("UseDMQ")) {
+                destAttrs.add(new Attribute("UseDMQ",
+                    getBooleanValue(destProps.getProperty("UseDMQ"))));
+            } else if (propName.equals("LocalOnly")) {
+                destAttrs.add(new Attribute("LocalOnly",
+                    getBooleanValue(destProps.getProperty("LocalOnly"))));
+            } else if (propName.equals("ReloadXMLSchemaOnFailure")) {
+                destAttrs.add(new Attribute("ReloadXMLSchemaOnFailure",
+                    getBooleanValue(destProps.getProperty("ReloadXMLSchemaOnFailure"))));
+            } else if (propName.equals("MaxNumProducers")) {
+                destAttrs.add(new Attribute("MaxNumProducers",
+                    Integer.valueOf(destProps.getProperty("MaxNumProducers"))));
+            } else if (propName.equals("MaxNumBackupConsumers")) {
+                destAttrs.add(new Attribute("MaxNumBackupConsumers",
+                    Integer.valueOf(destProps.getProperty("MaxNumBackupConsumers"))));
+            } else if (propName.equals("LimitBehavior")) {
+                destAttrs.add(new Attribute("LimitBehavior", destProps.getProperty("LimitBehavior")));
             }
-            return null;
-        }*/
+        }
+        return destAttrs;
+    }
 
-
-     protected MQAddressList getDefaultAddressList(JmsService jmsService) throws Exception {
-         MQAddressList list = new MQAddressList(jmsService);
-         list.setup(false);
-         return list;
-     }
-
-
-     protected void logAndHandleException(Exception e, String errorMsg) throws JMSAdminException {
-         // log JMX Exception trace as WARNING
-         StringWriter s = new StringWriter();
-         e.getCause().printStackTrace(new PrintWriter(s));
-         logger.log(Level.WARNING, s.toString());
-         JMSAdminException je = new JMSAdminException(localStrings.getLocalString(errorMsg, ""));
-
-         // Cause will be InvocationTargetException, cause of that
-          // wil be MBeanException and cause of that will be the
-          // real exception we need
-         if ((e.getCause() != null) && (e.getCause().getCause() != null)) {
-             je.initCause(e.getCause().getCause().getCause());
-         }
-         handleException(je);
-     }
-
-
-     protected void handleException(Exception e) throws JMSAdminException {
-         if (e instanceof JMSAdminException)  {
-             throw ((JMSAdminException)e);
-         }
-
-         String msg = e.getMessage();
-
-         JMSAdminException jae;
-         if (msg == null)  {
-             jae = new JMSAdminException();
-         } else  {
-             jae = new JMSAdminException(msg);
-         }
-
-         /*
-          * Don't do this for now because the CLI does not include jms.jar
-          * (at least not yet) in the classpath. Sending over a JMSException
-          * will cause a class not found exception to be thrown.
-          */
-         //jae.setLinkedException(e);
-
-         throw jae;
-     }
-
-
-     // XXX: To refactor into a Generic attribute type mapper, so that it is extensible later.
-     protected AttributeList convertProp2Attrs(Properties destProps) {
-         AttributeList destAttrs = new AttributeList();
-
-         String propName = null;
-         String propValue = null;
-
-         for (Enumeration e = destProps.propertyNames(); e.hasMoreElements();) {
-             propName = (String) e.nextElement();
-             if (propName.equals("AutoCreateQueueMaxNumActiveConsumers")) {
-                 destAttrs.add(new Attribute("AutoCreateQueueMaxNumActiveConsumers",
-                     Integer.valueOf(destProps.getProperty("AutoCreateQueueMaxNumActiveConsumers"))));
-             } else if (propName.equals("maxNumActiveConsumers")) {
-                 destAttrs.add(new Attribute("MaxNumActiveConsumers",
-                     Integer.valueOf(destProps.getProperty("maxNumActiveConsumers"))));
-             } else if (propName.equals("MaxNumActiveConsumers")) {
-                 destAttrs.add(new Attribute("MaxNumActiveConsumers",
-                     Integer.valueOf(destProps.getProperty("MaxNumActiveConsumers"))));
-             } else if (propName.equals("AutoCreateQueueMaxNumBackupConsumers")) {
-                 destAttrs.add(new Attribute("AutoCreateQueueMaxNumBackupConsumers",
-                     Integer.valueOf(destProps.getProperty("AutoCreateQueueMaxNumBackupConsumers"))));
-             } else if (propName.equals("AutoCreateQueues")) {
-                 boolean b = false;
-                 propValue = destProps.getProperty("AutoCreateQueues");
-                 if (propValue.equalsIgnoreCase("true")) {
-                     b = true;
-                 }
-                 destAttrs.add(new Attribute("AutoCreateQueues", Boolean.valueOf(b)));
-             } else if (propName.equals("AutoCreateTopics")) {
-                 boolean b = false;
-                 propValue = destProps.getProperty("AutoCreateTopics");
-                 if (propValue.equalsIgnoreCase("true")) {
-                     b = true;
-                 }
-                 destAttrs.add(new Attribute("AutoCreateTopics", Boolean.valueOf(b)));
-             } else if (propName.equals("DMQTruncateBody")) {
-                 boolean b = false;
-                 propValue = destProps.getProperty("DMQTruncateBody");
-                 if (propValue.equalsIgnoreCase("true")) {
-                     b = true;
-                 }
-                 destAttrs.add(new Attribute("DMQTruncateBody", Boolean.valueOf(b)));
-             } else if (propName.equals("LogDeadMsgs")) {
-                 boolean b = false;
-                 propValue = destProps.getProperty("LogDeadMsgs");
-                 if (propValue.equalsIgnoreCase("true")) {
-                     b = true;
-                 }
-                 destAttrs.add(new Attribute("LogDeadMsgs", Boolean.valueOf(b)));
-             } else if (propName.equals("MaxBytesPerMsg")) {
-                 destAttrs.add(new Attribute("MaxBytesPerMsg",
-                     Long.valueOf(destProps.getProperty("MaxBytesPerMsg"))));
-             } else if (propName.equals("MaxNumMsgs")) {
-                 destAttrs.add(new Attribute("MaxNumMsgs",
-                     Long.valueOf(destProps.getProperty("MaxNumMsgs"))));
-             } else if (propName.equals("MaxTotalMsgBytes")) {
-                 destAttrs.add(new Attribute("MaxTotalMsgBytes",
-                     Long.valueOf(destProps.getProperty("MaxTotalMsgBytes"))));
-             } else if (propName.equals("NumDestinations")) {
-                 destAttrs.add(new Attribute("NumDestinations",
-                     Integer.valueOf(destProps.getProperty("NumDestinations"))));
-             } else if (propName.equals("ConsumerFlowLimit")) {
-                 destAttrs.add(new Attribute("ConsumerFlowLimit",
-                     Long.valueOf(destProps.getProperty("ConsumerFlowLimit"))));
-             } else if (propName.equals("LocalDeliveryPreferred")) {
-                 destAttrs.add(new Attribute("LocalDeliveryPreferred",
-                     getBooleanValue(destProps.getProperty("LocalDeliveryPreferred"))));
-             } else if (propName.equals("ValidateXMLSchemaEnabled")) {
-                 destAttrs.add(new Attribute("ValidateXMLSchemaEnabled",
-                     getBooleanValue(destProps.getProperty("ValidateXMLSchemaEnabled"))));
-             } else if (propName.equals("UseDMQ")) {
-                 destAttrs.add(new Attribute("UseDMQ",
-                     getBooleanValue(destProps.getProperty("UseDMQ"))));
-             } else if (propName.equals("LocalOnly")) {
-                 destAttrs.add(new Attribute("LocalOnly",
-                     getBooleanValue(destProps.getProperty("LocalOnly"))));
-             } else if (propName.equals("ReloadXMLSchemaOnFailure")) {
-                 destAttrs.add(new Attribute("ReloadXMLSchemaOnFailure",
-                     getBooleanValue(destProps.getProperty("ReloadXMLSchemaOnFailure"))));
-             } else if (propName.equals("MaxNumProducers")) {
-                 destAttrs.add(new Attribute("MaxNumProducers",
-                     Integer.valueOf(destProps.getProperty("MaxNumProducers"))));
-             } else if (propName.equals("MaxNumBackupConsumers")) {
-                 destAttrs.add(new Attribute("MaxNumBackupConsumers",
-                     Integer.valueOf(destProps.getProperty("MaxNumBackupConsumers"))));
-             } else if (propName.equals("LimitBehavior")) {
-                 destAttrs.add(new Attribute("LimitBehavior", destProps.getProperty("LimitBehavior")));
-             }
-         }
-         return destAttrs;
-     }
-
-     private Boolean getBooleanValue(String propValue) {
-         return propValue.equalsIgnoreCase("true") ? Boolean.TRUE : Boolean.FALSE;
-//            UseDMQ
+    private Boolean getBooleanValue(final String propValue) {
+        return propValue.equalsIgnoreCase("true") ? Boolean.TRUE : Boolean.FALSE;
     }
 }
diff --git a/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/ListJMSDestinations.java b/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/ListJMSDestinations.java
index ca5a1cc..4650b16 100644
--- a/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/ListJMSDestinations.java
+++ b/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/ListJMSDestinations.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 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
@@ -16,40 +17,47 @@
 
 package org.glassfish.jms.admin.cli;
 
-import org.glassfish.api.I18n;
-import org.glassfish.api.Param;
-import org.glassfish.api.ActionReport;
-import org.glassfish.api.admin.AdminCommand;
-import org.glassfish.api.admin.AdminCommandContext;
-import org.glassfish.api.admin.CommandLock;
-import org.glassfish.internal.api.ServerContext;
-
-import java.util.*;
-import java.util.logging.Level;
-import java.util.logging.Logger;
+import com.sun.enterprise.config.serverbeans.Cluster;
+import com.sun.enterprise.config.serverbeans.Config;
+import com.sun.enterprise.config.serverbeans.Domain;
+import com.sun.enterprise.config.serverbeans.Server;
 import com.sun.enterprise.util.LocalStringManagerImpl;
 import com.sun.enterprise.util.SystemPropertyConstants;
-import com.sun.enterprise.config.serverbeans.*;
-
-import org.glassfish.api.admin.ExecuteOn;
-import org.glassfish.config.support.CommandTarget;
-import org.glassfish.config.support.TargetType;
-import org.glassfish.api.admin.RuntimeType;
-import org.glassfish.api.admin.ServerEnvironment;
 
 import jakarta.inject.Inject;
 import jakarta.inject.Named;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
 import javax.management.MBeanServerConnection;
 import javax.management.ObjectName;
 
-import org.jvnet.hk2.annotations.Service;
-
+import org.glassfish.api.ActionReport;
+import org.glassfish.api.I18n;
+import org.glassfish.api.Param;
+import org.glassfish.api.admin.AdminCommand;
+import org.glassfish.api.admin.AdminCommandContext;
+import org.glassfish.api.admin.CommandLock;
+import org.glassfish.api.admin.ExecuteOn;
+import org.glassfish.api.admin.RestEndpoint;
+import org.glassfish.api.admin.RestEndpoints;
+import org.glassfish.api.admin.RestParam;
+import org.glassfish.api.admin.RuntimeType;
+import org.glassfish.api.admin.ServerEnvironment;
+import org.glassfish.config.support.CommandTarget;
+import org.glassfish.config.support.TargetType;
 import org.glassfish.hk2.api.PerLookup;
-import org.glassfish.api.admin.*;
+import org.glassfish.internal.api.ServerContext;
+import org.jvnet.hk2.annotations.Service;
 
 /**
  * Create JMS Destination
- *
  */
 @Service(name="list-jmsdest")
 @PerLookup
@@ -100,6 +108,7 @@
     ServerContext serverContext;
 
 
+    @Override
     public void execute(AdminCommandContext context) {
 
         final ActionReport report = context.getActionReport();
@@ -112,7 +121,7 @@
         }
 
         report.setExtraProperties(new Properties());
-        List<Map> jmsDestList = new ArrayList<Map>();
+        List<Map> jmsDestList = new ArrayList<>();
 
         try {
             List<JMSDestinationInfo> list = listJMSDestinations(target, destType);
@@ -120,7 +129,7 @@
             for (JMSDestinationInfo destInfo : list) {
                 final ActionReport.MessagePart part = report.getTopMessagePart().addChild();
                 part.setMessage(destInfo.getDestinationName());
-                Map<String, String> destMap = new HashMap<String, String>();
+                Map<String, String> destMap = new HashMap<>();
                 destMap.put("name", destInfo.getDestinationName());
                 destMap.put("type", destInfo.getDestinationType());
                 jmsDestList.add(destMap);
@@ -130,88 +139,65 @@
 
         } catch (Exception e) {
             logger.throwing(getClass().getName(), "ListJMSDestination", e);
-            e.printStackTrace();//handleException(e);
             report.setMessage(localStrings.getLocalString("list.jms.dest.fail",
-                    "Unable to list JMS Destinations. Please ensure that the Message Queue Brokers are running"));// + " " + e.getLocalizedMessage());
+                    "Unable to list JMS Destinations. Please ensure that the Message Queue Brokers are running"));
             report.setActionExitCode(ActionReport.ExitCode.FAILURE);
             report.setFailureCause(e);
-            return;
         }
     }
 
-// list-jmsdest
-    public List listJMSDestinations(String tgtName, String destType)
-        throws Exception {
-
-        if (logger.isLoggable(Level.FINE)) {
-            logger.log(Level.FINE, "listJMSDestination ...");
-        }
-        MQJMXConnectorInfo mqInfo = getMQJMXConnectorInfo(target, config, serverContext, domain, connectorRuntime);
-
-        //MBeanServerConnection  mbsc = getMBeanServerConnection(tgtName);
-        try {
+    public List<JMSDestinationInfo> listJMSDestinations(String tgtName, String destType) throws Exception {
+        logger.log(Level.FINE, "listJMSDestinations ...");
+        try (MQJMXConnectorInfo mqInfo = createMQJMXConnectorInfo(target, config, serverContext, domain, connectorRuntime)) {
             MBeanServerConnection mbsc = mqInfo.getMQMBeanServerConnection();
             ObjectName on = new ObjectName(DESTINATION_MANAGER_CONFIG_MBEAN_NAME);
+            ObjectName[] dests = (ObjectName[]) mbsc.invoke(on, "getDestinations", null, null);
+            if (dests == null || dests.length <= 0) {
+                return null;
+            }
+            final List<JMSDestinationInfo> jmsdi = new ArrayList<>();
+            for (ObjectName dest : dests) {
+                on = dest;
+                String jdiType = toStringLabel(on.getKeyProperty("desttype"));
+                String jdiName = on.getKeyProperty("name");
 
-            ObjectName [] dests = (ObjectName [])mbsc.invoke(on, "getDestinations", null, null);
-            if ((dests != null) && (dests.length > 0)) {
-                List<JMSDestinationInfo> jmsdi = new ArrayList<JMSDestinationInfo>();
-                for (int i = 0; i < dests.length; i++) {
-                    on = dests[i];
-
-                    String jdiType = toStringLabel(on.getKeyProperty("desttype"));
-                    String jdiName = on.getKeyProperty("name");
-
-                    // check if the destination name has double quotes at the beginning
-                    // and end, if yes strip them
-                    if ((jdiName != null) && (jdiName.length() > 1)) {
-                        if (jdiName.indexOf('"') == 0) {
-                            jdiName = jdiName.substring(1);
-                        }
-                        if (jdiName.lastIndexOf('"') == (jdiName.length() - 1)) {
-                            jdiName = jdiName.substring(0, jdiName.lastIndexOf('"'));
-                        }
+                // check if the destination name has double quotes at the beginning
+                // and end, if yes strip them
+                if ((jdiName != null) && (jdiName.length() > 1)) {
+                    if (jdiName.indexOf('"') == 0) {
+                        jdiName = jdiName.substring(1);
                     }
+                    if (jdiName.lastIndexOf('"') == (jdiName.length() - 1)) {
+                        jdiName = jdiName.substring(0, jdiName.lastIndexOf('"'));
+                    }
+                }
 
-                    JMSDestinationInfo jdi = new JMSDestinationInfo(jdiName, jdiType);
+                JMSDestinationInfo jdi = new JMSDestinationInfo(jdiName, jdiType);
 
-                    if (destType == null) {
+                if (destType == null) {
+                    jmsdi.add(jdi);
+                } else if (destType.equals(JMS_DEST_TYPE_TOPIC)
+                        || destType.equals(JMS_DEST_TYPE_QUEUE)) {
+                    //Physical Destination Type specific listing
+                    if (jdiType.equalsIgnoreCase(destType)) {
                         jmsdi.add(jdi);
-                    } else if (destType.equals(JMS_DEST_TYPE_TOPIC)
-                            || destType.equals(JMS_DEST_TYPE_QUEUE)) {
-                        //Physical Destination Type specific listing
-                        if (jdiType.equalsIgnoreCase(destType)) {
-                            jmsdi.add(jdi);
-                        }
                     }
                 }
-                return jmsdi;
-                //(JMSDestinationInfo[]) jmsdi.toArray(new JMSDestinationInfo[]{});
             }
+            return jmsdi;
         } catch (Exception e) {
-            // log JMX Exception trace as WARNING
-            logAndHandleException(e, "admin.mbeans.rmb.error_listing_jms_dest");
-        } finally {
-            try {
-                if (mqInfo != null) {
-                    mqInfo.closeMQMBeanServerConnection();
-                }
-            } catch (Exception e) {
-                handleException(e);
-            }
+            throw logAndHandleException(e, "admin.mbeans.rmb.error_listing_jms_dest");
         }
-
-        return null;
     }
 
 
     private String toStringLabel(String type) {
         if (type.equals(DESTINATION_TYPE_QUEUE)) {
-            return ("queue");
+            return "queue";
         } else if (type.equals(DESTINATION_TYPE_TOPIC)) {
-            return ("topic");
+            return "topic";
         } else {
-            return ("unknown");
+            return "unknown";
         }
     }
 
diff --git a/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/MQJMXConnectorInfo.java b/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/MQJMXConnectorInfo.java
index 877cf2d..1c618c3 100644
--- a/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/MQJMXConnectorInfo.java
+++ b/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/MQJMXConnectorInfo.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 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
@@ -36,29 +37,29 @@
  * @author Sivakumar Thyagarajan
  * @since SJSAS 9.0
  */
-public class MQJMXConnectorInfo {
-    private String jmxServiceURL = null;
-    private Map<String,?> jmxConnectorEnv = null;
-    private String asInstanceName = null;
-    private String brokerInstanceName = null;
-    private String brokerType = null;
+public class MQJMXConnectorInfo implements AutoCloseable {
     private static final Logger _logger = Logger.getLogger(LogUtils.JMS_ADMIN_LOGGER);
-    final private static LocalStringManagerImpl localStrings = new LocalStringManagerImpl(MQJMXConnectorInfo.class);
-    private JMXConnector connector = null;
+    private static final LocalStringManagerImpl localStrings = new LocalStringManagerImpl(MQJMXConnectorInfo.class);
 
-    public MQJMXConnectorInfo(String asInstanceName, String brokerInstanceName,
-                              String brokerType, String jmxServiceURL,
-                                       Map<String, ?> jmxConnectorEnv) {
+    private final String jmxServiceURL;
+    private final Map<String,?> jmxConnectorEnv;
+    private final String asInstanceName;
+    private final String brokerInstanceName;
+    private final String brokerType;
+    private JMXConnector connector;
+
+    public MQJMXConnectorInfo(String asInstanceName, String brokerInstanceName, String brokerType, String jmxServiceURL,
+        Map<String, ?> jmxConnectorEnv) {
         this.brokerInstanceName = brokerInstanceName;
         this.asInstanceName = asInstanceName;
         this.jmxServiceURL = jmxServiceURL;
         this.brokerType = brokerType;
         this.jmxConnectorEnv = jmxConnectorEnv;
         if (_logger.isLoggable(Level.FINE)) {
-            _logger.log(Level.FINE, "MQJMXConnectorInfo : brokerInstanceName " +
-                            brokerInstanceName + " ASInstanceName " + asInstanceName +
-                            " jmxServiceURL "  + jmxServiceURL +  " BrokerType " + brokerType
-                            + " jmxConnectorEnv " + jmxConnectorEnv);
+            _logger.log(Level.FINE,
+                "MQJMXConnectorInfo : brokerInstanceName " + brokerInstanceName + " ASInstanceName " + asInstanceName
+                    + " jmxServiceURL " + jmxServiceURL + " BrokerType " + brokerType + " jmxConnectorEnv "
+                    + jmxConnectorEnv);
         }
     }
 
@@ -86,9 +87,7 @@
     }
 
     /**
-     * Returns an <code>MBeanServerConnection</code> representing the MQ broker instance's MBean
-     * server.
-     * @return
+     * @return an <code>MBeanServerConnection</code> representing the MQ broker instance's MBean server.
      * @throws ConnectorRuntimeException
      */
     //XXX:Enhance to support SSL (once MQ team delivers support in the next drop)
@@ -96,37 +95,36 @@
     //be shared with the consumer of this API
     public MBeanServerConnection getMQMBeanServerConnection() throws ConnectorRuntimeException {
         try {
-            if (getJMXServiceURL() == null || getJMXServiceURL().equals("")) {
-                String msg = localStrings.getLocalString("error.get.jmsserviceurl",
-                                "Failed to get MQ JMXServiceURL of {0}.", getASInstanceName());
-                throw new ConnectorRuntimeException(msg);
+            if (connector == null) {
+                if (getJMXServiceURL() == null || getJMXServiceURL().isEmpty()) {
+                    String msg = localStrings.getLocalString("error.get.jmsserviceurl",
+                        "Failed to get MQ JMXServiceURL of {0}.", getASInstanceName());
+                    throw new ConnectorRuntimeException(msg);
+                }
+                _logger.log(Level.FINE, "creating MBeanServerConnection to MQ JMXServer with {0}", getJMXServiceURL());
+                JMXServiceURL serviceURL = new JMXServiceURL(getJMXServiceURL());
+                connector = JMXConnectorFactory.connect(serviceURL, this.jmxConnectorEnv);
             }
-            if (_logger.isLoggable(Level.FINE)) {
-                _logger.log(Level.FINE,
-                "creating MBeanServerConnection to MQ JMXServer with "+getJMXServiceURL());
-            }
-            JMXServiceURL jmxServiceURL = new JMXServiceURL(getJMXServiceURL());
-            connector = JMXConnectorFactory.connect(jmxServiceURL, this.jmxConnectorEnv);
             //XXX: Do we need to pass in a Subject?
             MBeanServerConnection mbsc = connector.getMBeanServerConnection();
             return mbsc;
         } catch (Exception e) {
-            e.printStackTrace();
-            ConnectorRuntimeException cre = new ConnectorRuntimeException(e.getMessage());
-            cre.initCause(e);
-            throw cre;
+            throw new ConnectorRuntimeException(e.getMessage(), e);
         }
     }
 
-    public void closeMQMBeanServerConnection() throws ConnectorRuntimeException {
+    /**
+     * Closes the connector.
+     */
+    @Override
+    public void close() throws ConnectorRuntimeException {
         try {
-           if (connector != null) {
-                 connector.close();
-           }
+            if (connector != null) {
+                connector.close();
+                connector = null;
+            }
         } catch (IOException e) {
-            ConnectorRuntimeException cre = new ConnectorRuntimeException(e.getMessage());
-            cre.initCause(e);
-            throw cre;
+            throw new ConnectorRuntimeException(e.getMessage(), e);
         }
     }
  }
diff --git a/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/UpdateJmsPhysicalDestinationCommand.java b/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/UpdateJmsPhysicalDestinationCommand.java
index a459195..42d7f46 100644
--- a/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/UpdateJmsPhysicalDestinationCommand.java
+++ b/appserver/jms/admin/src/main/java/org/glassfish/jms/admin/cli/UpdateJmsPhysicalDestinationCommand.java
@@ -111,17 +111,10 @@
     }
 
     protected void updateJMSDestination() throws Exception {
-        logger.log(Level.FINE, "__updateJmsPhysicalDestination ...");
-        MQJMXConnectorInfo mqInfo = getMQJMXConnectorInfo(target, config, serverContext, domain, connectorRuntime);
-
-        try {
-            MBeanServerConnection mbsc = mqInfo.getMQMBeanServerConnection();
-            AttributeList destAttrs = null;
-
-            if (props != null) {
-                destAttrs = convertProp2Attrs(props);
-            }
-
+        logger.log(Level.FINE, "updateJMSDestination ...");
+        try (MQJMXConnectorInfo mqInfo = createMQJMXConnectorInfo(target, config, serverContext, domain, connectorRuntime)) {
+            final MBeanServerConnection mbsc = mqInfo.getMQMBeanServerConnection();
+            final AttributeList destAttrs = props == null ? null : convertProp2Attrs(props);
             if (destType.equalsIgnoreCase("topic")) {
                 destType = DESTINATION_TYPE_TOPIC;
             } else if (destType.equalsIgnoreCase("queue")) {
@@ -130,16 +123,7 @@
             ObjectName on = new ObjectName(MBEAN_DOMAIN_NAME + ":type=Destination,subtype=Config,desttype=" + destType +",name=\"" + destName + "\"");
             mbsc.setAttributes(on, destAttrs);
         } catch (Exception e) {
-            //log JMX Exception trace as WARNING
-            logAndHandleException(e, "admin.mbeans.rmb.error_updating_jms_dest");
-        } finally {
-            try {
-                if (mqInfo != null) {
-                    mqInfo.closeMQMBeanServerConnection();
-                }
-            } catch (Exception e) {
-                handleException(e);
-            }
+            throw logAndHandleException(e, "admin.mbeans.rmb.error_updating_jms_dest");
         }
     }
 }
diff --git a/appserver/jms/gf-jms-connector/src/main/java/com/sun/enterprise/connectors/jms/config/JmsAvailability.java b/appserver/jms/gf-jms-connector/src/main/java/com/sun/enterprise/connectors/jms/config/JmsAvailability.java
index e76ccfd..4c5577b 100644
--- a/appserver/jms/gf-jms-connector/src/main/java/com/sun/enterprise/connectors/jms/config/JmsAvailability.java
+++ b/appserver/jms/gf-jms-connector/src/main/java/com/sun/enterprise/connectors/jms/config/JmsAvailability.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -21,7 +22,6 @@
 import org.jvnet.hk2.config.Attribute;
 import org.jvnet.hk2.config.Element;
 import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.ConfigBeanProxy;
 import org.jvnet.hk2.config.types.Property;
 
 import java.beans.PropertyVetoException;
@@ -44,6 +44,9 @@
 @Configured
 public interface JmsAvailability extends ConfigExtension, PropertyBag, AvailabilityServiceExtension {
 
+    String PATTERN_BROKER = "(masterbroker|shareddb)";
+    String PATTERN_MESSAGE_STORE_TYPE = "(file|jdbc)";
+
     /**
      * Gets the value of the availabilityEnabled property.
      *
@@ -87,7 +90,7 @@
       */
 
     @Attribute (defaultValue="masterbroker")
-    @Pattern(regexp="(masterbroker|shareddb)")
+    @Pattern(regexp = PATTERN_BROKER, message = "Valid values: " + PATTERN_BROKER)
     String getConfigStoreType();
 
 
@@ -112,8 +115,8 @@
       *         {@link String }
       */
 
-    @Attribute (defaultValue="file")
-    @Pattern(regexp="(file|jdbc)")
+    @Attribute(defaultValue = "file")
+    @Pattern(regexp = PATTERN_MESSAGE_STORE_TYPE, message = "Valid values: " + PATTERN_MESSAGE_STORE_TYPE)
     String getMessageStoreType();
 
 
@@ -144,29 +147,28 @@
      * Sets the value of the DB Vendor property.
      *
      * @param value allowed object is
-     *              {@link String }
+     *            {@link String }
      */
     void setDbVendor(String value) throws PropertyVetoException;
 
     /**
-         * Gets the value of the DB User Name property.
-         *
-         * This is the DB user Name for the DB used by the MQ broker cluster
-         * for use in saving persistent JMS messages and other broker
-         * cluster configuration information.
-         *
-         * @return possible object is
-         *         {@link String }
-      */
+     * Gets the value of the DB User Name property.
+     * This is the DB user Name for the DB used by the MQ broker cluster
+     * for use in saving persistent JMS messages and other broker
+     * cluster configuration information.
+     *
+     * @return possible object is
+     *         {@link String }
+     */
     @Attribute
     String getDbUsername();
 
-      /**
-         * Sets the value of the DB UserName property.
-         *
-         * @param value allowed object is
-         *              {@link String }
-       */
+    /**
+     * Sets the value of the DB UserName property.
+     *
+     * @param value allowed object is
+     *            {@link String }
+     */
     void setDbUsername(String value) throws PropertyVetoException;
 
     /**
@@ -227,10 +229,12 @@
      *              {@link String }
      */
     void setMqStorePoolName(String value) throws PropertyVetoException;
+
     /**
-        Properties as per {@link PropertyBag}
+     * Properties as per {@link PropertyBag}
      */
-    @ToDo(priority=ToDo.Priority.IMPORTANT, details="Provide PropertyDesc for legal props" )
+    @Override
+    @ToDo(priority = ToDo.Priority.IMPORTANT, details = "Provide PropertyDesc for legal props")
     @PropertiesDesc(props={})
     @Element
     List<Property> getProperty();
diff --git a/appserver/jms/gf-jms-connector/src/main/java/com/sun/enterprise/connectors/jms/config/JmsHost.java b/appserver/jms/gf-jms-connector/src/main/java/com/sun/enterprise/connectors/jms/config/JmsHost.java
index 060eb39..0195a37 100644
--- a/appserver/jms/gf-jms-connector/src/main/java/com/sun/enterprise/connectors/jms/config/JmsHost.java
+++ b/appserver/jms/gf-jms-connector/src/main/java/com/sun/enterprise/connectors/jms/config/JmsHost.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -20,7 +21,6 @@
 import org.jvnet.hk2.config.Attribute;
 import org.jvnet.hk2.config.Element;
 import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.ConfigBeanProxy;
 import org.jvnet.hk2.config.types.Property;
 import org.jvnet.hk2.config.types.PropertyBag;
 
@@ -34,8 +34,6 @@
 import org.glassfish.quality.ToDo;
 
 import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Min;
-import jakarta.validation.constraints.Max;
 import jakarta.validation.constraints.Pattern;
 import jakarta.validation.Payload;
 
@@ -54,7 +52,7 @@
 })
 public interface JmsHost extends ConfigExtension, PropertyBag, Payload {
 
-    final static String PORT_PATTERN = "\\$\\{[\\p{L}\\p{N}_][\\p{L}\\p{N}\\-_./;#]*\\}"
+    String PORT_PATTERN = "\\$\\{[\\p{L}\\p{N}_][\\p{L}\\p{N}\\-_./;#]*\\}"
             + "|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]"
             + "|[1-5][0-9][0-9][0-9][0-9]|6[0-4][0-9][0-9][0-9]"
             + "|65[0-4][0-9][0-9]|655[0-2][0-9]|6553[0-5]";
@@ -104,10 +102,8 @@
      * @return possible object is
      *         {@link String }
      */
-    @Attribute (defaultValue="7676")
-    @Pattern(regexp=PORT_PATTERN,
-            message="{port-pattern}",
-            payload=JmsHost.class)
+    @Attribute(defaultValue = "7676")
+    @Pattern(regexp = PORT_PATTERN, message = "{port-pattern}", payload = JmsHost.class)
     String getPort();
 
     /**
@@ -178,6 +174,7 @@
     /**
         Properties as per {@link org.jvnet.hk2.config.types.PropertyBag}
      */
+    @Override
     @ToDo(priority=ToDo.Priority.IMPORTANT, details="Provide PropertyDesc for legal props" )
     @PropertiesDesc(props={})
     @Element
diff --git a/appserver/jms/gf-jms-connector/src/main/java/com/sun/enterprise/connectors/jms/config/JmsService.java b/appserver/jms/gf-jms-connector/src/main/java/com/sun/enterprise/connectors/jms/config/JmsService.java
index 0db3f4f..938db97 100644
--- a/appserver/jms/gf-jms-connector/src/main/java/com/sun/enterprise/connectors/jms/config/JmsService.java
+++ b/appserver/jms/gf-jms-connector/src/main/java/com/sun/enterprise/connectors/jms/config/JmsService.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -18,6 +19,15 @@
 
 import com.sun.enterprise.config.modularity.annotation.CustomConfiguration;
 import com.sun.enterprise.config.modularity.annotation.HasCustomizationTokens;
+
+import jakarta.validation.constraints.Max;
+import jakarta.validation.constraints.Min;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
+
+import java.beans.PropertyVetoException;
+import java.util.List;
+
 import org.glassfish.api.admin.config.ConfigExtension;
 import org.glassfish.api.admin.config.Container;
 import org.glassfish.api.admin.config.PropertiesDesc;
@@ -28,13 +38,6 @@
 import org.jvnet.hk2.config.types.Property;
 import org.jvnet.hk2.config.types.PropertyBag;
 
-import jakarta.validation.constraints.Max;
-import jakarta.validation.constraints.Min;
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Pattern;
-import java.beans.PropertyVetoException;
-import java.util.List;
-
 /**
  * The jms-service element specifies information about the bundled/built-in
  * JMS service that is managed by Application Server
@@ -50,6 +53,11 @@
 @CustomConfiguration(baseConfigurationFileName = "jms-module-conf.xml")
 public interface JmsService extends ConfigExtension, PropertyBag, Container {
 
+    String ADDRESS_LIST_SELECTIONS = "(random|priority)";
+    String SERVICE_TYPES = "(LOCAL|EMBEDDED|REMOTE)";
+    String MQ_SCHEMES = "(mq||http)";
+    String MQ_SERVICES = "(ssljms||jms)";
+
     /**
      * Gets the value of the initTimeoutInSeconds property.
      *
@@ -83,7 +91,7 @@
      */
     @Attribute
     @NotNull
-    @Pattern(regexp="(LOCAL|EMBEDDED|REMOTE)")
+    @Pattern(regexp = SERVICE_TYPES, message = "Valid values: " + SERVICE_TYPES)
     String getType();
 
     /**
@@ -134,14 +142,14 @@
      */
     void setDefaultJmsHost(String value) throws PropertyVetoException;
 
-     @Attribute
+    @Attribute
     String getMasterBroker();
 
     /**
      * Sets the value of the MasterBroker property.
      *
      * @param value allowed object is
-     *              {@link String }
+     *            {@link String }
      */
     void setMasterBroker(String value) throws PropertyVetoException;
 
@@ -215,8 +223,8 @@
      * @return possible object is
      *         {@link String }
      */
-    @Attribute (defaultValue="random")
-    @Pattern(regexp="(random|priority)")
+    @Attribute(defaultValue = "random")
+    @Pattern(regexp = ADDRESS_LIST_SELECTIONS, message = "Valid values: " + ADDRESS_LIST_SELECTIONS)
     String getAddresslistBehavior();
 
     /**
@@ -259,7 +267,7 @@
      *         {@link String }
      */
     @Attribute
-    @Pattern(regexp="(mq||http)")
+    @Pattern(regexp = MQ_SCHEMES, message = "Valid values: " + MQ_SCHEMES)
     String getMqScheme();
 
     /**
@@ -281,7 +289,7 @@
      *         {@link String }
      */
     @Attribute
-    @Pattern(regexp="(ssljms||jms)")
+    @Pattern(regexp = MQ_SERVICES, message = "Valid values: " + MQ_SERVICES)
     String getMqService();
 
     /**
@@ -315,33 +323,44 @@
     @Element
     List<JmsHost> getJmsHost();
 
-     /**
-        Properties.
+    /**
+     * Properties.
      */
-@PropertiesDesc(
-    props={
-        @PropertyDesc(name="instance-name", defaultValue="imqbroker",
-            description="The full Sun GlassFish Message Queue broker instance name"),
+    @Override
+    @PropertiesDesc(
+        props = {
+            @PropertyDesc(
+                name = "instance-name",
+                defaultValue = "imqbroker",
+                description = "The full Sun GlassFish Message Queue broker instance name"),
 
-        @PropertyDesc(name="instance-name-suffix", defaultValue="xxxxxxxxxxxxxxxxxx",
-            description="A suffix to add to the full Message Queue broker instance name. The suffix is separated " +
-                "from the instance name by an underscore character (_). For example, if the instance name is 'imqbroker', " +
-                "appending the suffix 'xyz' changes the instance name to 'imqbroker_xyz'"),
+            @PropertyDesc(
+                name = "instance-name-suffix",
+                defaultValue = "xxxxxxxxxxxxxxxxxx",
+                description = "A suffix to add to the full Message Queue broker instance name. The suffix is separated "
+                    + "from the instance name by an underscore character (_). For example, if the instance name is 'imqbroker', "
+                    + "appending the suffix 'xyz' changes the instance name to 'imqbroker_xyz'"),
 
-        @PropertyDesc(name="append-version", defaultValue="",
-            description="If true, appends the major and minor version numbers, preceded by underscore characters (_), " +
-                "to the full Message Queue broker instance name. For example, if the instance name is 'imqbroker', " +
-                "appending the version numbers changes the instance name to imqbroker_8_0"),
+            @PropertyDesc(
+                name = "append-version",
+                defaultValue = "",
+                description = "If true, appends the major and minor version numbers, preceded by underscore characters (_), "
+                    + "to the full Message Queue broker instance name. For example, if the instance name is 'imqbroker', "
+                    + "appending the version numbers changes the instance name to imqbroker_8_0"),
 
-        @PropertyDesc(name="user-name", defaultValue="xxxxxxxxxxxxxxxxxx",
-            description="Specifies the user name for creating the JMS connection. Needed only if the default " +
-                "username/password of guest/guest is not available in the broker"),
+            @PropertyDesc(
+                name = "user-name",
+                defaultValue = "xxxxxxxxxxxxxxxxxx",
+                description = "Specifies the user name for creating the JMS connection. Needed only if the default "
+                    + "username/password of guest/guest is not available in the broker"),
 
-        @PropertyDesc(name="password", defaultValue="xxxxxxxxxxxxxxxxxx",
-            description="Specifies the password for creating the JMS connection. Needed only if the default " +
-                "username/password of guest/guest is not available in the broker")
-    }
-    )
+            @PropertyDesc(
+                name = "password",
+                defaultValue = "xxxxxxxxxxxxxxxxxx",
+                description = "Specifies the password for creating the JMS connection. Needed only if the default "
+                    + "username/password of guest/guest is not available in the broker")
+            }
+        )
     @Element
     List<Property> getProperty();
 }
diff --git a/appserver/orb/orb-enabler/src/main/java/org/glassfish/orb/admin/config/IiopListener.java b/appserver/orb/orb-enabler/src/main/java/org/glassfish/orb/admin/config/IiopListener.java
index 357b2aa..17c5efb 100644
--- a/appserver/orb/orb-enabler/src/main/java/org/glassfish/orb/admin/config/IiopListener.java
+++ b/appserver/orb/orb-enabler/src/main/java/org/glassfish/orb/admin/config/IiopListener.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,6 +17,10 @@
 
 package org.glassfish.orb.admin.config;
 
+import jakarta.validation.Payload;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
+
 import java.beans.PropertyVetoException;
 import java.util.List;
 
@@ -31,16 +36,8 @@
 import org.jvnet.hk2.config.types.Property;
 import org.jvnet.hk2.config.types.PropertyBag;
 
-import jakarta.validation.Payload;
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Pattern;
-
 import static org.glassfish.config.support.Constants.NAME_REGEX;
 
-/**
- *
- */
-
 /* @XmlType(name = "", propOrder = {
     "ssl",
     "property"
@@ -67,9 +64,9 @@
      * @return possible object is
      *         {@link String }
      */
-    @Attribute(key=true)
+    @Attribute(key = true)
     @NotNull
-    @Pattern(regexp=NAME_REGEX)
+    @Pattern(regexp = NAME_REGEX, message = "Pattern: " + NAME_REGEX)
     String getId();
 
     /**
@@ -109,9 +106,7 @@
      *         {@link String }
      */
     @Attribute (defaultValue="1072")
-    @Pattern(regexp=PORT_PATTERN,
-            message="{port-pattern}",
-            payload=IiopListener.class)
+    @Pattern(regexp = PORT_PATTERN, message = "{port-pattern}", payload = IiopListener.class)
     String getPort();
 
     /**
diff --git a/appserver/pom.xml b/appserver/pom.xml
index e1082e2..4cee55b 100644
--- a/appserver/pom.xml
+++ b/appserver/pom.xml
@@ -708,13 +708,6 @@
         </pluginManagement>
         <plugins>
             <plugin>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <source>11</source>
-                    <target>11</target>
-                </configuration>
-            </plugin>
-            <plugin>
                 <groupId>org.glassfish.build</groupId>
                 <artifactId>spec-version-maven-plugin</artifactId>
                 <version>2.1</version>
diff --git a/appserver/security/core-ee/src/main/java/com/sun/enterprise/security/jmac/config/GFServerConfigProvider.java b/appserver/security/core-ee/src/main/java/com/sun/enterprise/security/jmac/config/GFServerConfigProvider.java
index ea2ce8f..ca99577 100644
--- a/appserver/security/core-ee/src/main/java/com/sun/enterprise/security/jmac/config/GFServerConfigProvider.java
+++ b/appserver/security/core-ee/src/main/java/com/sun/enterprise/security/jmac/config/GFServerConfigProvider.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -108,7 +109,7 @@
     protected AuthConfigFactory factory = null;
     private WebServicesDelegate wsdelegate = null;
 
-    public GFServerConfigProvider(Map properties, AuthConfigFactory factory) {
+    public GFServerConfigProvider(Map<String, String> properties, AuthConfigFactory factory) {
         this.factory = factory;
         initializeParser();
 
@@ -376,10 +377,10 @@
         private static final Class[] PARAMS = {};
         private static final Object[] ARGS = {};
 
-        private String moduleClassName;
-        private MessagePolicy requestPolicy;
-        private MessagePolicy responsePolicy;
-        private Map options;
+        private final String moduleClassName;
+        private final MessagePolicy requestPolicy;
+        private final MessagePolicy responsePolicy;
+        private final Map options;
 
         /**
          * Construct a ConfigFile entry.
@@ -488,11 +489,11 @@
      * parsed ID entry
      */
     public static class IDEntry {
-        private String type; // provider type (client, server, client-server)
-        private String moduleClassName;
-        private MessagePolicy requestPolicy;
-        private MessagePolicy responsePolicy;
-        private Map options;
+        private final String type; // provider type (client, server, client-server)
+        private final String moduleClassName;
+        private final MessagePolicy requestPolicy;
+        private final MessagePolicy responsePolicy;
+        private final Map options;
 
         public String getModuleClassName() {
             return moduleClassName;
@@ -527,8 +528,8 @@
      * A data object contains module object and the corresponding map.
      */
     protected static class ModuleInfo {
-        private Object module;
-        private Map map;
+        private final Object module;
+        private final Map map;
 
         ModuleInfo(Object module, Map map) {
             this.module = module;
@@ -940,11 +941,11 @@
 
     static protected class GFServerAuthContext implements ServerAuthContext {
 
-        private GFServerAuthConfig config;
-        private ServerAuthModule module;
-        private com.sun.enterprise.security.jauth.ServerAuthModule oldModule;
+        private final GFServerAuthConfig config;
+        private final ServerAuthModule module;
+        private final com.sun.enterprise.security.jauth.ServerAuthModule oldModule;
 
-        private Map map;
+        private final Map map;
         boolean managesSession = false;
 
         GFServerAuthContext(GFServerAuthConfig config, ServerAuthModule module, Map map) {
@@ -1068,9 +1069,9 @@
 
     static protected class GFClientAuthContext implements ClientAuthContext {
 
-        private GFClientAuthConfig config;
-        private ClientAuthModule module;
-        private com.sun.enterprise.security.jauth.ClientAuthModule oldModule;
+        private final GFClientAuthConfig config;
+        private final ClientAuthModule module;
+        private final com.sun.enterprise.security.jauth.ClientAuthModule oldModule;
         // private Map map;
 
         GFClientAuthContext(GFClientAuthConfig config, ClientAuthModule module, Map map) {
diff --git a/appserver/security/jaspic-provider-framework/src/main/java/com/sun/jaspic/config/jaas/JAASAuthConfigProvider.java b/appserver/security/jaspic-provider-framework/src/main/java/com/sun/jaspic/config/jaas/JAASAuthConfigProvider.java
index 29b74ce..59967f5 100644
--- a/appserver/security/jaspic-provider-framework/src/main/java/com/sun/jaspic/config/jaas/JAASAuthConfigProvider.java
+++ b/appserver/security/jaspic-provider-framework/src/main/java/com/sun/jaspic/config/jaas/JAASAuthConfigProvider.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -36,13 +37,13 @@
     private static final String DEFAULT_JAAS_APP_NAME = "other";
     private static final String ALL_APPS = "*";
 
-    private String configFileName;
+    private final String configFileName;
     private ExtendedConfigFile jaasConfig;
 
-    private Map<String, ?> properties;
-    private AuthConfigFactory factory;
+    private final Map<String, String> properties;
+    private final AuthConfigFactory factory;
 
-    public JAASAuthConfigProvider(Map properties, AuthConfigFactory factory) {
+    public JAASAuthConfigProvider(Map<String, String> properties, AuthConfigFactory factory) {
         this.properties = properties;
         this.factory = factory;
 
@@ -62,11 +63,13 @@
        selfRegister();
     }
 
+    @Override
     public Map<String, ?> getProperties() {
         return properties;
     }
 
 
+    @Override
     public AuthConfigFactory getFactory() {
         return factory;
     }
@@ -85,24 +88,29 @@
 
             final String description = "JAAS AuthConfig: " + appContext;
 
+            @Override
             public String getMessageLayer() {
                 return layer;
             }
 
+            @Override
             public String getAppContext() {
                 return appContext;
             }
 
+            @Override
             public String getDescription() {
                 return description;
             }
 
+            @Override
             public boolean isPersistent() {
                 return false;
             }
         };
     }
 
+    @Override
     public AuthConfigFactory.RegistrationContext[] getSelfRegistrationContexts() {
         final String[] appContexts = jaasConfig.getAppNames(getModuleTypes());
         RegistrationContext[] rvalue = new RegistrationContext[appContexts.length];
@@ -112,6 +120,7 @@
         return rvalue;
     }
 
+    @Override
     public AuthContextHelper getAuthContextHelper(String appContext, boolean returnNullContexts)
             throws AuthException {
         return new JAASAuthContextHelper(getLoggerName(), returnNullContexts,
diff --git a/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/osgi.bundle b/appserver/tests/admin/admin-extension/osgi.bundle
similarity index 100%
rename from nucleus/tests/admin/src/addon/modules/test-progress-status-commands/osgi.bundle
rename to appserver/tests/admin/admin-extension/osgi.bundle
diff --git a/appserver/tests/admin/admin-extension/pom.xml b/appserver/tests/admin/admin-extension/pom.xml
new file mode 100644
index 0000000..a6ad15d
--- /dev/null
+++ b/appserver/tests/admin/admin-extension/pom.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+
+    This program and the accompanying materials are made available under the
+    terms of the Eclipse Public License v. 2.0, which is available at
+    http://www.eclipse.org/legal/epl-2.0.
+
+    This Source Code may also be made available under the following Secondary
+    Licenses when the conditions for such availability set forth in the
+    Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+    version 2 with the GNU Classpath Exception, which is available at
+    https://www.gnu.org/software/classpath/license.html.
+
+    SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.glassfish.main.tests</groupId>
+        <artifactId>admin-tests-parent</artifactId>
+        <version>7.0.0-SNAPSHOT</version>
+    </parent>
+    <artifactId>test-progress-admin-extension</artifactId>
+    <packaging>glassfish-jar</packaging>
+
+    <name>GlassFish Admin Tests - Progress Admin Extension</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.glassfish.main.common</groupId>
+            <artifactId>glassfish-api</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.glassfish.main.common</groupId>
+            <artifactId>common-util</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.glassfish.hk2</groupId>
+            <artifactId>hk2-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>jakarta.inject</groupId>
+            <artifactId>jakarta.inject-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+</project>
+
diff --git a/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressComplexCommand.java b/appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressComplexCommand.java
similarity index 95%
rename from nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressComplexCommand.java
rename to appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressComplexCommand.java
index 8f61b6f..7e095ae 100644
--- a/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressComplexCommand.java
+++ b/appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressComplexCommand.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,24 +17,22 @@
 
 package com.sun.enterprise.tests.progress;
 
-import com.sun.enterprise.config.serverbeans.Domain;
 import com.sun.logging.LogDomains;
-import java.util.logging.Level;
+
 import java.util.logging.Logger;
+
 import org.glassfish.api.I18n;
-import org.glassfish.api.Param;
 import org.glassfish.api.admin.AdminCommand;
 import org.glassfish.api.admin.AdminCommandContext;
 import org.glassfish.api.admin.CommandLock;
 import org.glassfish.api.admin.ManagedJob;
 import org.glassfish.api.admin.Progress;
 import org.glassfish.api.admin.ProgressStatus;
-import org.glassfish.api.admin.RestEndpoint;
-import org.glassfish.api.admin.RestEndpoints;
 import org.glassfish.hk2.api.PerLookup;
 import org.jvnet.hk2.annotations.Service;
 
-/** Basic progress status example.
+/**
+ * Basic progress status example.
  * Contains 10 steps
  *
  * @author mmares
@@ -137,6 +136,7 @@
             this.message = message;
         }
 
+        @Override
         public void run() {
             doProgress(ps, count, interval, message);
         }
diff --git a/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressCustomCommand.java b/appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressCustomCommand.java
similarity index 94%
rename from nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressCustomCommand.java
rename to appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressCustomCommand.java
index 974c6f1..7d30c49 100644
--- a/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressCustomCommand.java
+++ b/appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressCustomCommand.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -19,6 +20,7 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.regex.Pattern;
+
 import org.glassfish.api.ActionReport;
 import org.glassfish.api.I18n;
 import org.glassfish.api.Param;
@@ -31,7 +33,6 @@
 import org.jvnet.hk2.annotations.Service;
 
 /**
- *
  * @author mmares
  */
 @Service(name = "progress-custom")
@@ -51,14 +52,14 @@
     private static class Interval {
 
         private boolean valid = true;
-        private String origInteval;
+        private String origInterval;
         private int multiplicator = 1;
         private int minSec = -1;
         private int maxSec = 0;
         private boolean spin = false;
 
         private Interval(String interval) {
-            origInteval = interval;
+            origInterval = interval;
             try {
                 if (!keyPattern.matcher(interval).matches()) {
                     valid = false;
@@ -99,13 +100,8 @@
         public int getMultiplicator() {
             if (valid) {
                 return multiplicator;
-            } else {
-                return 1;
             }
-        }
-
-        public String getOrigInteval() {
-            return origInteval;
+            return 1;
         }
 
         public boolean isValid() {
@@ -128,7 +124,7 @@
 
         @Override
         public String toString() {
-            return origInteval;
+            return origInterval;
         }
 
     }
@@ -149,7 +145,7 @@
     @Override
     public void execute(AdminCommandContext context) {
         ProgressStatus ps = context.getProgressStatus();
-        parsedIntervals = new ArrayList<Interval>(intervals != null ? intervals.length : 0);
+        parsedIntervals = new ArrayList<>(intervals != null ? intervals.length : 0);
         ActionReport report = context.getActionReport();
         for (String interval : intervals) {
             parsedIntervals.add(new Interval(interval));
diff --git a/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressDoubleTotalsCommand.java b/appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressDoubleTotalsCommand.java
similarity index 95%
rename from nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressDoubleTotalsCommand.java
rename to appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressDoubleTotalsCommand.java
index 08d5ba7..698a113 100644
--- a/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressDoubleTotalsCommand.java
+++ b/appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressDoubleTotalsCommand.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -26,7 +27,8 @@
 import org.glassfish.hk2.api.PerLookup;
 import org.jvnet.hk2.annotations.Service;
 
-/** Basic progress status example.
+/**
+ * Basic progress status example.
  * Contains 10 steps
  *
  * @author mmares
diff --git a/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressExecOtherCommand.java b/appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressExecOtherCommand.java
similarity index 83%
rename from nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressExecOtherCommand.java
rename to appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressExecOtherCommand.java
index 042eaf9..1ef602e 100644
--- a/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressExecOtherCommand.java
+++ b/appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressExecOtherCommand.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -55,15 +56,11 @@
         }
 
         // Execute other command
-        commandRunner.getCommandInvocation(
-            "progress-simple",
-            context.getActionReport()
-                   .addSubActionsReport(),
+        // Number 20 is little bit tricky. Please see javadoc of ProgressStatus
+        commandRunner.getCommandInvocation("progress-simple",
+            context.getActionReport().addSubActionsReport(),
             context.getSubject())
-            .progressStatusChild(
-                 // Number 20 is little bit tricky. Please see javadoc of ProgressStatus
-                progressStatus.createChild("subcommand", 20))
-            .execute();
+        .progressStatusChild(progressStatus.createChild("subcommand", 20)).execute();
 
         // Do some after logic
         progressStatus.progress("Finishing outer command");
@@ -73,8 +70,6 @@
         }
 
         progressStatus.complete("Finished outer command");
-
-        System.out.println("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
     }
 
     private void doSomeLogic() {
diff --git a/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressFailInHalfCommand.java b/appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressFailInHalfCommand.java
similarity index 95%
rename from nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressFailInHalfCommand.java
rename to appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressFailInHalfCommand.java
index 969c298..eae9750 100644
--- a/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressFailInHalfCommand.java
+++ b/appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressFailInHalfCommand.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -27,7 +28,8 @@
 import org.glassfish.hk2.api.PerLookup;
 import org.jvnet.hk2.annotations.Service;
 
-/** Basic progress status example.
+/**
+ * Basic progress status example.
  * Contains 10 steps
  *
  * @author mmares
diff --git a/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressFullAnnotCommand.java b/appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressFullAnnotCommand.java
similarity index 95%
rename from nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressFullAnnotCommand.java
rename to appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressFullAnnotCommand.java
index 84c4e07..f19189f 100644
--- a/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressFullAnnotCommand.java
+++ b/appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressFullAnnotCommand.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -42,5 +43,4 @@
         cmd.noTotalSteps = true;
         cmd.execute(context);
     }
-
 }
diff --git a/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressPayloadCommand.java b/appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressPayloadCommand.java
similarity index 93%
rename from nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressPayloadCommand.java
rename to appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressPayloadCommand.java
index 4892191..09f2e60 100644
--- a/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressPayloadCommand.java
+++ b/appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressPayloadCommand.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -18,10 +19,12 @@
 
 import com.sun.enterprise.util.StringUtils;
 import com.sun.logging.LogDomains;
+
 import java.io.File;
 import java.io.IOException;
 import java.net.URI;
 import java.util.logging.Logger;
+
 import org.glassfish.api.ActionReport;
 import org.glassfish.api.I18n;
 import org.glassfish.api.Param;
@@ -35,7 +38,8 @@
 import org.glassfish.hk2.api.PerLookup;
 import org.jvnet.hk2.annotations.Service;
 
-/** Doing progress and send some payload.
+/**
+ * Doing progress and send some payload.
  *
  * @author mmares
  */
@@ -47,8 +51,7 @@
 @ManagedJob
 public class ProgressPayloadCommand implements AdminCommand {
 
-    private final static Logger logger =
-            LogDomains.getLogger(ProgressPayloadCommand.class, LogDomains.ADMIN_LOGGER);
+    private final static Logger logger = LogDomains.getLogger(ProgressPayloadCommand.class, LogDomains.ADMIN_LOGGER);
 
     @Param(name = "down", multiple = false, primary = true, optional = true)
     String down;
diff --git a/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressSimpleCommand.java b/appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressSimpleCommand.java
similarity index 97%
rename from nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressSimpleCommand.java
rename to appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressSimpleCommand.java
index 41b0df8..c6e81cb 100644
--- a/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressSimpleCommand.java
+++ b/appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressSimpleCommand.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
diff --git a/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressStepBackCommand.java b/appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressStepBackCommand.java
similarity index 95%
rename from nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressStepBackCommand.java
rename to appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressStepBackCommand.java
index 614d59d..27fd174 100644
--- a/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressStepBackCommand.java
+++ b/appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressStepBackCommand.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -26,7 +27,8 @@
 import org.glassfish.hk2.api.PerLookup;
 import org.jvnet.hk2.annotations.Service;
 
-/** Basic progress status example.
+/**
+ * Basic progress status example.
  * Contains 10 steps
  *
  * @author mmares
diff --git a/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressWithSupplementCommand.java b/appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressWithSupplementCommand.java
similarity index 88%
rename from nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressWithSupplementCommand.java
rename to appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressWithSupplementCommand.java
index 37273cc..c49b1e7 100644
--- a/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/ProgressWithSupplementCommand.java
+++ b/appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/ProgressWithSupplementCommand.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,7 +17,6 @@
 
 package com.sun.enterprise.tests.progress;
 
-import com.sun.enterprise.universal.i18n.LocalStringsImpl;
 import org.glassfish.api.I18n;
 import org.glassfish.api.admin.AdminCommand;
 import org.glassfish.api.admin.AdminCommandContext;
@@ -26,7 +26,8 @@
 import org.glassfish.hk2.api.PerLookup;
 import org.jvnet.hk2.annotations.Service;
 
-/** Same as {@code ProgressSimpleCommand} but this one has supplements.
+/**
+ * Same as {@code ProgressSimpleCommand} but this one has supplements.
  * It also does not specify totalStepCount in annotation but using API.
  * Percentage can be printed after {@code SupplementBefore} will be done.
  *
@@ -38,12 +39,9 @@
 @PerLookup
 @CommandLock(CommandLock.LockType.NONE)
 @I18n("progress")
-@Progress()
+@Progress
 public class ProgressWithSupplementCommand implements AdminCommand {
 
-    private static final LocalStringsImpl strings =
-            new LocalStringsImpl(ProgressWithSupplementCommand.class);
-
     @Override
     public void execute(AdminCommandContext context) {
         ProgressStatus ps = context.getProgressStatus();
diff --git a/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/SupplementAfter.java b/appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/SupplementAfter.java
similarity index 96%
rename from nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/SupplementAfter.java
rename to appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/SupplementAfter.java
index f24e876..f094f54 100644
--- a/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/SupplementAfter.java
+++ b/appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/SupplementAfter.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
diff --git a/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/SupplementBefore.java b/appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/SupplementBefore.java
similarity index 96%
rename from nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/SupplementBefore.java
rename to appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/SupplementBefore.java
index 2faed1d..f0f6866 100644
--- a/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/src/main/java/com/sun/enterprise/tests/progress/SupplementBefore.java
+++ b/appserver/tests/admin/admin-extension/src/main/java/com/sun/enterprise/tests/progress/SupplementBefore.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
diff --git a/appserver/tests/admin/pom.xml b/appserver/tests/admin/pom.xml
new file mode 100755
index 0000000..caa3d87
--- /dev/null
+++ b/appserver/tests/admin/pom.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
+
+    This program and the accompanying materials are made available under the
+    terms of the Eclipse Public License v. 2.0, which is available at
+    http://www.eclipse.org/legal/epl-2.0.
+
+    This Source Code may also be made available under the following Secondary
+    Licenses when the conditions for such availability set forth in the
+    Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+    version 2 with the GNU Classpath Exception, which is available at
+    https://www.gnu.org/software/classpath/license.html.
+
+    SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.glassfish.main.tests</groupId>
+        <artifactId>tests</artifactId>
+        <version>7.0.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>admin-tests-parent</artifactId>
+    <packaging>pom</packaging>
+
+    <name>GlassFish Admin Tests - Parent</name>
+
+    <modules>
+        <module>admin-extension</module>
+        <module>tests</module>
+    </modules>
+</project>
diff --git a/appserver/tests/admin/tests/pom.xml b/appserver/tests/admin/tests/pom.xml
new file mode 100644
index 0000000..b08ca0e
--- /dev/null
+++ b/appserver/tests/admin/tests/pom.xml
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
+
+    This program and the accompanying materials are made available under the
+    terms of the Eclipse Public License v. 2.0, which is available at
+    http://www.eclipse.org/legal/epl-2.0.
+
+    This Source Code may also be made available under the following Secondary
+    Licenses when the conditions for such availability set forth in the
+    Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+    version 2 with the GNU Classpath Exception, which is available at
+    https://www.gnu.org/software/classpath/license.html.
+
+    SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.glassfish.main.tests</groupId>
+        <artifactId>admin-tests-parent</artifactId>
+        <version>7.0.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>admin-tests</artifactId>
+
+    <name>GlassFish Admin Tests</name>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.glassfish.jersey.core</groupId>
+            <artifactId>jersey-client</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <!-- Used by the jersey-client -->
+        <dependency>
+            <groupId>org.glassfish.jersey.inject</groupId>
+            <artifactId>jersey-hk2</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.glassfish.main.admin</groupId>
+            <artifactId>rest-client</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.glassfish.main.common</groupId>
+            <artifactId>common-util</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.glassfish.main.security</groupId>
+            <artifactId>security</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.glassfish.main.security</groupId>
+            <artifactId>security-ee</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>jakarta.servlet</groupId>
+            <artifactId>jakarta.servlet-api</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.glassfish.main.distributions</groupId>
+            <artifactId>glassfish</artifactId>
+            <type>zip</type>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.glassfish.main.tests</groupId>
+            <artifactId>test-progress-admin-extension</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.junit.jupiter</groupId>
+            <artifactId>junit-jupiter-engine</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.hamcrest</groupId>
+            <artifactId>hamcrest</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.shrinkwrap.resolver</groupId>
+            <artifactId>shrinkwrap-resolver-impl-maven-archive</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>unpack-glassfish</id>
+                        <goals>
+                            <goal>unpack-dependencies</goal>
+                        </goals>
+                        <configuration>
+                            <includeArtifactIds>glassfish</includeArtifactIds>
+                            <excludeTransitive>true</excludeTransitive>
+                            <outputDirectory>${project.build.directory}</outputDirectory>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>copy-addon</id>
+                        <goals>
+                            <goal>copy-dependencies</goal>
+                        </goals>
+                        <configuration>
+                            <includeArtifactIds>test-progress-admin-extension</includeArtifactIds>
+                            <excludeTransitive>true</excludeTransitive>
+                            <outputDirectory>${project.build.directory}/glassfish7/glassfish/modules</outputDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/ClusterITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/ClusterITest.java
new file mode 100644
index 0000000..aaaa56c
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/ClusterITest.java
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.StringWriter;
+import java.net.URL;
+import java.net.URLConnection;
+
+import org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
+import org.glassfish.main.admin.test.tool.asadmin.Asadmin;
+import org.glassfish.main.admin.test.tool.asadmin.GlassFishTestEnvironment;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestMethodOrder;
+
+import static java.nio.charset.StandardCharsets.ISO_8859_1;
+import static org.glassfish.main.admin.test.tool.AsadminResultMatcher.asadminOK;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.stringContainsInOrder;
+import static org.junit.jupiter.api.Assertions.fail;
+
+/**
+ * @author Tom Mueller
+ */
+@TestMethodOrder(OrderAnnotation.class)
+public class ClusterITest {
+
+    private static final String PORT1 = "55123";
+    private static final String PORT2 = "55124";
+    private static final String CLUSTER_NAME = "eec1";
+    private static final String INSTANCE_NAME_1 = "eein1-with-a-very-very-very-long-name";
+    private static final String INSTANCE_NAME_2 = "eein2";
+    private static final String URL1 = "http://localhost:" + PORT1;
+    private static final String URL2 = "http://localhost:" + PORT2;
+    private static final Asadmin ASADMIN = GlassFishTestEnvironment.getAsadmin();
+
+    @Test
+    @Order(1)
+    public void createClusterTest() {
+        assertThat(ASADMIN.exec("create-cluster", CLUSTER_NAME), asadminOK());
+    }
+
+    @Test
+    @Order(2)
+    public void createInstancesTest() {
+        assertThat(
+            ASADMIN.exec("create-local-instance", "--cluster", CLUSTER_NAME, "--systemproperties",
+                   "HTTP_LISTENER_PORT=" + PORT1
+                + ":HTTP_SSL_LISTENER_PORT=18181"
+                + ":IIOP_SSL_LISTENER_PORT=13800"
+                + ":IIOP_LISTENER_PORT=13700"
+                + ":JMX_SYSTEM_CONNECTOR_PORT=17676"
+                + ":IIOP_SSL_MUTUALAUTH_PORT=13801"
+                + ":JMS_PROVIDER_PORT=18686"
+                + ":ASADMIN_LISTENER_PORT=14848",
+                INSTANCE_NAME_1), asadminOK());
+
+        assertThat(
+            ASADMIN.exec("create-local-instance", "--cluster", CLUSTER_NAME, "--systemproperties",
+                   "HTTP_LISTENER_PORT=" + PORT2
+                + ":HTTP_SSL_LISTENER_PORT=28181"
+                + ":IIOP_SSL_LISTENER_PORT=23800"
+                + ":IIOP_LISTENER_PORT=23700"
+                + ":JMX_SYSTEM_CONNECTOR_PORT=27676"
+                + ":IIOP_SSL_MUTUALAUTH_PORT=23801"
+                + ":JMS_PROVIDER_PORT=28686"
+                + ":ASADMIN_LISTENER_PORT=24848",
+                INSTANCE_NAME_2), asadminOK());
+    }
+
+
+    @Test
+    @Order(3)
+    public void startInstancesTest() {
+        assertThat(ASADMIN.exec(30_000, "start-local-instance", INSTANCE_NAME_1), asadminOK());
+        assertThat(ASADMIN.exec(30_000, "start-local-instance", INSTANCE_NAME_2), asadminOK());
+    }
+
+    @Test
+    @Order(4)
+    public void checkClusterTest() {
+        assertThat(ASADMIN.exec("list-instances"), asadminOK());
+        assertThat(getURL(URL1), stringContainsInOrder("GlassFish Server"));
+        assertThat(getURL(URL2), stringContainsInOrder("GlassFish Server"));
+    }
+
+    @Test
+    @Order(5)
+    public void stopInstancesTest() {
+        assertThat(ASADMIN.exec("stop-local-instance", "--kill", INSTANCE_NAME_1), asadminOK());
+        assertThat(ASADMIN.exec("stop-local-instance", "--kill", INSTANCE_NAME_2), asadminOK());
+    }
+
+    @Test
+    @Order(6)
+    public void deleteInstancesTest() {
+        assertThat(ASADMIN.exec("delete-local-instance", INSTANCE_NAME_1), asadminOK());
+        assertThat(ASADMIN.exec("delete-local-instance", INSTANCE_NAME_2), asadminOK());
+    }
+
+    @Test
+    @Order(7)
+    public void deleteClusterTest() {
+        assertThat(ASADMIN.exec("delete-cluster", CLUSTER_NAME), asadminOK());
+    }
+
+
+    /**
+     * This methods opens a connection to the given URL and
+     * returns the string that is returned from that URL.  This
+     * is useful for simple servlet retrieval
+     *
+     * @param urlstr The URL to connect to
+     * @return The string returned from that URL, or empty
+     * string if there was a problem contacting the URL
+     */
+    public static String getURL(String urlstr) {
+        URLConnection urlc = openConnection(urlstr);
+        try (
+            BufferedReader ir = new BufferedReader(new InputStreamReader(urlc.getInputStream(), ISO_8859_1));
+            StringWriter ow = new StringWriter();
+        ) {
+            String line;
+            while ((line = ir.readLine()) != null) {
+                ow.write(line);
+                ow.write("\n");
+            }
+            return ow.getBuffer().toString();
+        } catch (IOException ex) {
+            return fail(ex);
+        }
+    }
+
+    private static URLConnection openConnection(String url) {
+        try {
+            return new URL(url).openConnection();
+        } catch (IOException e) {
+            throw new IllegalArgumentException(e);
+        }
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/MiscCommandsITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/MiscCommandsITest.java
new file mode 100644
index 0000000..330638e
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/MiscCommandsITest.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test;
+
+import org.glassfish.main.admin.test.tool.asadmin.Asadmin;
+import org.glassfish.main.admin.test.tool.asadmin.GlassFishTestEnvironment;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
+
+import static org.glassfish.main.admin.test.tool.AsadminResultMatcher.asadminOK;
+
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestMethodOrder;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+
+
+/**
+ * @author Tom Mueller
+ */
+@TestMethodOrder(OrderAnnotation.class)
+public class MiscCommandsITest {
+
+    private static final Asadmin ASADMIN = GlassFishTestEnvironment.getAsadmin();
+
+    @AfterAll
+    public static void startDomainAgain() {
+        assertThat(ASADMIN.exec("start-domain"), asadminOK());
+    }
+
+    @Test
+    @Order(1)
+    public void uptime() {
+        assertThat(ASADMIN.exec("uptime"), asadminOK());
+    }
+
+    @Test
+    @Order(1)
+    public void version1() {
+        assertThat(ASADMIN.exec("version"), asadminOK());
+    }
+
+    @Test
+    @Order(100)
+    public void version2() {
+        assertThat(ASADMIN.exec("stop-domain"), asadminOK());
+        assertThat(ASADMIN.exec("version", "--local"), asadminOK());
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/OSGiCommandsITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/OSGiCommandsITest.java
new file mode 100644
index 0000000..c38cb92
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/OSGiCommandsITest.java
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.glassfish.main.admin.test.tool.AsadminResultMatcher;
+import org.glassfish.main.admin.test.tool.asadmin.Asadmin;
+import org.glassfish.main.admin.test.tool.asadmin.AsadminResult;
+import org.glassfish.main.admin.test.tool.asadmin.GlassFishTestEnvironment;
+import org.hamcrest.collection.IsEmptyCollection;
+import org.junit.jupiter.api.Test;
+
+import static org.glassfish.main.admin.test.tool.AsadminResultMatcher.asadminOK;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.not;
+import static org.hamcrest.Matchers.stringContainsInOrder;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+
+/**
+ * @author sanjeeb.sahoo@oracle.com
+ */
+public class OSGiCommandsITest {
+
+    private static final Asadmin ASADMIN = GlassFishTestEnvironment.getAsadmin();
+
+    @Test
+    public void basicOsgiCmd() {
+        assertThat(ASADMIN.exec("osgi", "lb"), asadminOK());
+    }
+
+
+    /**
+     * Tests functionality of session handling of osgi command.
+     * It creates sessions, lists them, executes commands against each session and finally stops them.
+     * @throws Exception
+     */
+    @Test
+    public void osgiCmdSession() throws Exception {
+        // Create some sessions
+        Set<String> sessions = new HashSet<>();
+        for (int i = 0; i < 3; ++i) {
+            sessions.add(newCmdSession());
+        }
+
+        // Let's list them to make sure list operation works.
+        final Set<String> actual = listCmdSessions();
+        assertEquals(sessions, actual, "listed sessions do not match with created sessions");
+
+        // Let's set the same variable in each command session with a different value and make sure
+        // the variables are scoped to sessions.
+        for (String sessionId : sessions) {
+            List<String> result = runCmd("osgi", "--session", "execute", "--session-id", sessionId, "var=" + sessionId);
+            assertThat(result, IsEmptyCollection.empty());
+        }
+        for (String sessionId : sessions) {
+            List<String> result = runCmd("osgi", "--session", "execute", "--session-id", sessionId, "echo $var");
+            assertThat(result, not(IsEmptyCollection.empty()));
+            assertEquals(sessionId, result.get(0));
+        }
+
+        // Let's stop all sessions.
+        for (String sessionId : sessions) {
+            List<String> result = runCmd("osgi", "--session", "stop", "--session-id", sessionId);
+            assertThat(result, IsEmptyCollection.empty());
+        }
+        sessions = listCmdSessions();
+        assertTrue(sessions.isEmpty(), "Not all sessions closed properly: " + sessions);
+    }
+
+    /**
+     * Test osgi-shell command which is a local command. It takes a file as input. The file contains
+     * a list of shell commands to be executed.
+     * @throws IOException
+     */
+    @Test
+    public void osgiShell() throws IOException {
+        File cmdFile = File.createTempFile("osgi-commands", ".txt");
+        cmdFile.deleteOnExit();
+        try (PrintStream ps = new PrintStream(new FileOutputStream(cmdFile))) {
+            ps.println("help");
+            ps.println("lb");
+        }
+        AsadminResult result = ASADMIN.exec("osgi-shell", "--file", cmdFile.getAbsolutePath());
+        assertThat(result.getStdOut(),
+            stringContainsInOrder("cm:createFactoryConfiguration", "System Bundle", "Apache Felix Gogo Runtime"));
+        assertThat(result, AsadminResultMatcher.asadminOK());
+    }
+
+
+    private String newCmdSession() throws Exception {
+        List<String> value = runCmd("osgi", "--session", "new");
+        if (value.size() != 1) {
+            throw new Exception("Unexpected output: \n " + value);
+        }
+        return value.get(0);
+    }
+
+    private Set<String> listCmdSessions() throws Exception {
+        List<String> sessions = runCmd("osgi", "--session", "list");
+        return new HashSet<>(sessions);
+    }
+
+
+    private List<String> runCmd(String... cmd) throws Exception {
+        AsadminResult value = ASADMIN.exec(cmd);
+        assertThat(value, asadminOK());
+        List<String> output = new ArrayList<>();
+        for (String line : value.getStdOut().split("\\n")) {
+            line = line.trim();
+            if (line.isEmpty() || line.startsWith(ASADMIN.getCommandName()) || line.startsWith("Command")) {
+                continue;
+            }
+            output.add(line);
+        }
+        return output;
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/RestITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/RestITest.java
new file mode 100644
index 0000000..43945ef
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/RestITest.java
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.net.HttpURLConnection;
+
+import org.junit.jupiter.api.Test;
+
+import static org.glassfish.main.admin.test.tool.asadmin.GlassFishTestEnvironment.openConnection;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.greaterThanOrEqualTo;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class RestITest {
+
+    @Test
+    public void testManagementEndpoint() throws Exception {
+        HttpURLConnection connection = openConnection("/management/domain.xml");
+        try {
+            assertEquals(200, connection.getResponseCode());
+        } finally {
+            connection.disconnect();
+        }
+    }
+
+    @Test
+    public void testMonitoringEndpoint() throws Exception {
+        HttpURLConnection connection = openConnection("/monitoring/domain.xml");
+        try {
+            assertEquals(200, connection.getResponseCode());
+        } finally {
+            connection.disconnect();
+        }
+    }
+
+    @Test
+    public void testAdminCommandEndpoint() throws Exception {
+        HttpURLConnection connection = openConnection("/management/domain/version.xml");
+        try {
+            assertEquals(200, connection.getResponseCode());
+        } finally {
+            connection.disconnect();
+        }
+    }
+
+    @Test
+    public void testChildConfigBeanEndpoint() throws Exception {
+        HttpURLConnection connection = openConnection("/management/domain/applications.xml");
+        try {
+            assertEquals(200, connection.getResponseCode());
+        } finally {
+            connection.disconnect();
+        }
+    }
+
+    @Test
+    public void testPostGetDelete() throws Exception {
+        // FIXME: causes HTTP 500 without any log
+        assertThat(deleteNode(), greaterThanOrEqualTo(400));
+        assertEquals(200, createNode());
+        assertEquals(200, getNode());
+        assertEquals(200, deleteNode());
+    }
+
+    private int createNode() throws IOException {
+        String parameters = "name=myConfigNode";
+        HttpURLConnection connection = openConnection("/management/domain/nodes/create-node-config");
+        try {
+            connection.setRequestMethod("POST");
+            connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
+            connection.setRequestProperty("Content-Length", Integer.toString(parameters.getBytes().length));
+            connection.setUseCaches(false);
+            connection.setDoInput(true);
+            connection.setDoOutput(true);
+            connection.setRequestProperty("Content-Language", "en-US");
+            try (DataOutputStream wr = new DataOutputStream(connection.getOutputStream())) {
+                wr.writeBytes(parameters);
+            }
+            return connection.getResponseCode();
+        } finally {
+            connection.disconnect();
+        }
+    }
+
+    private int getNode() throws IOException {
+        HttpURLConnection connection = openConnection("/management/domain/nodes/node/myConfigNode");
+        try {
+            return connection.getResponseCode();
+        } finally {
+            connection.disconnect();
+        }
+    }
+
+    private int deleteNode() throws IOException {
+        HttpURLConnection connection = openConnection("/management/domain/nodes/delete-node-config?id=myConfigNode");
+        try {
+            connection.setRequestMethod("DELETE");
+            connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
+            connection.setDoOutput(true);
+            return connection.getResponseCode();
+        } finally {
+            connection.disconnect();
+        }
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/progress/DetachAttachITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/progress/DetachAttachITest.java
new file mode 100644
index 0000000..58de9a9
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/progress/DetachAttachITest.java
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.progress;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.glassfish.main.admin.test.tool.asadmin.Asadmin;
+import org.glassfish.main.admin.test.tool.asadmin.AsadminResult;
+import org.glassfish.main.admin.test.tool.asadmin.DetachedTerseAsadminResult;
+import org.glassfish.main.admin.test.tool.asadmin.GlassFishTestEnvironment;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+
+import static org.glassfish.main.admin.test.tool.AsadminResultMatcher.asadminOK;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.greaterThan;
+import static org.hamcrest.Matchers.not;
+import static org.hamcrest.Matchers.stringContainsInOrder;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+/**
+ * @author martinmares
+ */
+@ExtendWith(JobTestExtension.class)
+public class DetachAttachITest {
+    private static final Logger LOG = Logger.getLogger(DetachAttachITest.class.getName());
+    private static final Asadmin ASADMIN = GlassFishTestEnvironment.getAsadmin();
+
+
+    @Test
+    public void uptimePeriodically() throws Exception {
+        Set<String> ids = new HashSet<>();
+        for (int i = 0; i < 3; i++) {
+            LOG.log(Level.FINE, "detachAndAttachUptimePeriodically(): round " + i);
+            final String id;
+            {
+                DetachedTerseAsadminResult result = ASADMIN.execDetached("uptime");
+                assertThat(result, asadminOK());
+                id = result.getJobId();
+                assertTrue(ids.add(id));
+            }
+            Thread.sleep(1000L);
+            {
+                AsadminResult result = ASADMIN.exec("--terse", "attach", id);
+                assertThat(result, asadminOK());
+                assertTrue(result.getStdOut().contains("uptime"));
+            }
+        }
+    }
+
+
+    @Test
+    public void commandWithProgressStatus() throws Exception {
+        final DetachedTerseAsadminResult detached = ASADMIN.execDetached("progress-custom", "6x1");
+        assertThat(detached, asadminOK());
+        Thread.sleep(2000L);
+        final AsadminResult attachResult = ASADMIN.exec("attach", detached.getJobId());
+        assertThat(attachResult, asadminOK());
+        assertThat(attachResult.getStdOut(), stringContainsInOrder("progress-custom"));
+        List<ProgressMessage> prgs = ProgressMessage.grepProgressMessages(attachResult.getStdOut());
+        assertFalse(prgs.isEmpty());
+        assertThat(prgs.get(0).getValue(), greaterThan(0));
+        assertEquals(100, prgs.get(prgs.size() - 1).getValue());
+        // Now attach finished - must NOT exist - seen progress job is removed
+        assertThat(ASADMIN.exec("attach", detached.getJobId()), not(asadminOK()));
+    }
+
+
+    @Test
+    public void detachOnesAttachMulti() throws Exception {
+        ExecutorService pool = Executors.newCachedThreadPool(r -> {
+            Thread result = new Thread(r);
+            result.setDaemon(true);
+            return result;
+        });
+        final DetachedTerseAsadminResult result = ASADMIN.execDetached("progress-custom", "8x1");
+        assertThat(result, asadminOK());
+        assertNotNull(result.getJobId(), "id");
+        Thread.sleep(1500L);
+        final int attachCount = 3;
+        Collection<Callable<AsadminResult>> attaches = new ArrayList<>(attachCount);
+        for (int i = 0; i < attachCount; i++) {
+            attaches.add(() -> ASADMIN.exec("attach", result.getJobId()));
+        }
+        List<Future<AsadminResult>> results = pool.invokeAll(attaches);
+        for (Future<AsadminResult> fRes : results) {
+            AsadminResult res = fRes.get();
+            assertThat(res, asadminOK());
+            assertTrue(res.getStdOut().contains("progress-custom"));
+            List<ProgressMessage> prgs = ProgressMessage.grepProgressMessages(res.getStdOut());
+            assertFalse(prgs.isEmpty());
+            assertThat(prgs.get(0).getValue(), greaterThan(0));
+            assertEquals(100, prgs.get(prgs.size() - 1).getValue());
+        }
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/progress/JobManagerITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/progress/JobManagerITest.java
new file mode 100644
index 0000000..8e6bfc4
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/progress/JobManagerITest.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.progress;
+
+import org.glassfish.main.admin.test.tool.asadmin.Asadmin;
+import org.glassfish.main.admin.test.tool.asadmin.AsadminResult;
+import org.glassfish.main.admin.test.tool.asadmin.DetachedTerseAsadminResult;
+import org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestMethodOrder;
+import org.junit.jupiter.api.extension.ExtendWith;
+
+import static org.glassfish.main.admin.test.tool.AsadminResultMatcher.asadminOK;
+import static org.glassfish.main.admin.test.tool.asadmin.GlassFishTestEnvironment.getAsadmin;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.matchesPattern;
+import static org.hamcrest.Matchers.stringContainsInOrder;
+
+/**
+ * This tests the functionality of JobManager, list-jobs
+ *
+ * @author Bhakti Mehta
+ * @author David Matejcek
+ */
+@ExtendWith(JobTestExtension.class)
+@TestMethodOrder(OrderAnnotation.class)
+public class JobManagerITest {
+
+    private static final String COMMAND_PROGRESS_SIMPLE = "progress-simple";
+    private static final Asadmin ASADMIN = getAsadmin();
+
+
+    @Test
+    @Order(1)
+    public void noJobsTest() {
+        AsadminResult result = ASADMIN.exec("list-jobs");
+        assertThat(result, asadminOK());
+        assertThat(result.getOutput(), stringContainsInOrder("Nothing to list"));
+    }
+
+
+    @Test
+    @Order(2)
+    public void jobSurvivesRestart() throws Exception {
+        assertThat(ASADMIN.exec(COMMAND_PROGRESS_SIMPLE), asadminOK());
+        assertThat(ASADMIN.exec("stop-domain"), asadminOK());
+        assertThat(ASADMIN.exec("start-domain"), asadminOK());
+        assertThat(ASADMIN.exec("list-jobs").getStdOut(), stringContainsInOrder(COMMAND_PROGRESS_SIMPLE, "COMPLETED"));
+    }
+
+
+    @Test
+    @Order(3)
+    public void detachAndAttach() throws Exception {
+        DetachedTerseAsadminResult detached = ASADMIN.execDetached(COMMAND_PROGRESS_SIMPLE);
+        assertThat(detached.getJobId(), matchesPattern("[1-9][0-9]*"));
+        assertThat(ASADMIN.exec("list-jobs", detached.getJobId()).getStdOut(), stringContainsInOrder(COMMAND_PROGRESS_SIMPLE));
+        assertThat(ASADMIN.exec("attach", detached.getJobId()), asadminOK());
+
+        // list-jobs and it should be purged since the user
+        // starting is the same as the user who attached to it
+        assertThat(ASADMIN.exec("list-jobs", detached.getJobId()).getOutput(), stringContainsInOrder("Nothing to list"));
+    }
+
+
+    @Test
+    @Order(4)
+    public void runSynchronously() throws Exception {
+        assertThat(ASADMIN.exec(COMMAND_PROGRESS_SIMPLE), asadminOK());
+        assertThat(ASADMIN.exec("list-jobs").getStdOut(), stringContainsInOrder(COMMAND_PROGRESS_SIMPLE));
+
+        assertThat(ASADMIN.exec("configure-managed-jobs", "--job-retention-period=1s", "--cleanup-initial-delay=1s",
+            "--cleanup-poll-interval=1s"), asadminOK());
+        Thread.sleep(1100L);
+        assertThat("Completed jobs should be removed", ASADMIN.exec("list-jobs").getOutput(),
+            stringContainsInOrder("Nothing to list"));
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/progress/JobTestExtension.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/progress/JobTestExtension.java
new file mode 100644
index 0000000..b052df2
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/progress/JobTestExtension.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2022 Eclipse Foundation and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.progress;
+
+import org.glassfish.main.admin.test.tool.asadmin.Asadmin;
+import org.glassfish.main.admin.test.tool.asadmin.AsadminResult;
+import org.glassfish.main.admin.test.tool.asadmin.GlassFishTestEnvironment;
+import org.junit.jupiter.api.extension.AfterAllCallback;
+import org.junit.jupiter.api.extension.BeforeAllCallback;
+import org.junit.jupiter.api.extension.ExtensionContext;
+import org.junit.jupiter.api.extension.ExtensionContext.Namespace;
+import org.junit.jupiter.api.extension.ExtensionContext.Store;
+
+import static java.util.function.Function.identity;
+import static org.glassfish.main.admin.test.tool.AsadminResultMatcher.asadminOK;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.stringContainsInOrder;
+import static org.junit.jupiter.api.Assertions.fail;
+
+
+/**
+ * @author David Matejcek
+ */
+public class JobTestExtension implements BeforeAllCallback, AfterAllCallback {
+
+    private static final String ORIG_POLL_INTERVAL = "origPollInterval";
+    private static final String ORIG_INITIAL_DELAY = "origInitialDelay";
+    private static final String ORIG_RETENTION_PERIOD = "origRetentionPeriod";
+
+    private static final Asadmin ASADMIN = GlassFishTestEnvironment.getAsadmin();
+
+    @Override
+    public void beforeAll(ExtensionContext context) throws Exception {
+        Namespace namespaceClass = Namespace.create(context.getRequiredTestClass());
+        Store store = context.getStore(namespaceClass);
+        store.put(ORIG_RETENTION_PERIOD, ASADMIN.getValue("managed-job-config.job-retention-period", identity()).getValue());
+        store.put(ORIG_INITIAL_DELAY, ASADMIN.getValue("managed-job-config.initial-delay", identity()).getValue());
+        store.put(ORIG_POLL_INTERVAL, ASADMIN.getValue("managed-job-config.poll-interval", identity()).getValue());
+    }
+
+    @Override
+    public void afterAll(ExtensionContext context) throws Exception {
+        waitForCompletition();
+
+        // minimal possible values.
+        assertThat(ASADMIN.exec("configure-managed-jobs",
+            "--job-retention-period=1s",
+            "--cleanup-initial-delay=1s",
+            "--cleanup-poll-interval=1s"), asadminOK());
+
+        Thread.sleep(1100L);
+        // cleanup should be finished.
+        AsadminResult result = ASADMIN.exec("list-jobs");
+        assertThat(result.getOutput(), stringContainsInOrder("Nothing to list"));
+
+        Namespace namespaceClass = Namespace.create(context.getRequiredTestClass());
+        Store store = context.getStore(namespaceClass);
+        // reset original configuration
+        assertThat(ASADMIN.exec("configure-managed-jobs",
+            "--job-retention-period=" + store.get(ORIG_RETENTION_PERIOD),
+            "--cleanup-initial-delay=" + store.get(ORIG_INITIAL_DELAY),
+            "--cleanup-poll-interval=" + store.get(ORIG_POLL_INTERVAL)), asadminOK());
+    }
+
+
+    private void waitForCompletition() throws Exception {
+        final long start = System.currentTimeMillis();
+        while (true) {
+            AsadminResult result = ASADMIN.exec("list-jobs");
+            assertThat(result, asadminOK());
+            if (!result.getStdOut().contains("RUNNING")) {
+                return;
+            }
+            if (System.currentTimeMillis() > start + 10000L) {
+                fail("Timed out waiting for completition of all jobs.");
+            }
+            Thread.sleep(500);
+        }
+    }
+
+
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/progress/ProgressMessage.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/progress/ProgressMessage.java
new file mode 100644
index 0000000..9198ae3
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/progress/ProgressMessage.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.progress;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.StringTokenizer;
+import java.util.function.Predicate;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+import org.hamcrest.CustomTypeSafeMatcher;
+
+/**
+ * Parse progress status message.
+ *
+ * @author martinmares
+ */
+public class ProgressMessage {
+
+    private static final Pattern PATTERN = Pattern.compile("[ ]*(\\d+)(%)?:(.+:)?(.*)");
+    private static final Predicate<String> PREDICATE = PATTERN.asMatchPredicate();
+
+    private final int value;
+    private final boolean percentage;
+    private final String scope;
+    private final String message;
+
+    private ProgressMessage(String txt) throws IllegalArgumentException {
+        Matcher matcher = PATTERN.matcher(txt);
+        if (!matcher.matches()) {
+            throw new IllegalArgumentException("Arg txt is not progress message");
+        }
+        this.value = Integer.parseInt(matcher.group(1));
+        this.percentage = matcher.group(2) != null;
+        this.scope = nvlTrim(matcher.group(3));
+        this.message = nvlTrim(matcher.group(4));
+    }
+
+    private static String nvlTrim(String txt) {
+        if (txt != null) {
+            txt = txt.trim();
+        }
+        return txt;
+    }
+
+    public int getValue() {
+        return value;
+    }
+
+    public boolean isPercentage() {
+        return percentage;
+    }
+
+    public String getScope() {
+        return scope;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    @Override
+    public String toString() {
+        return Arrays.toString(new Object[] {value, percentage, scope, message});
+    }
+
+    public static List<ProgressMessage> grepProgressMessages(String txt) {
+        StringTokenizer stok = new StringTokenizer(txt, System.lineSeparator());
+        return Collections.list(stok).stream().map(Object::toString).filter(PREDICATE).map(ProgressMessage::new)
+            .collect(Collectors.toList());
+    }
+
+    /** Unique only that not equal with previous.
+     */
+    public static String[] uniqueMessages(List<ProgressMessage> pms) {
+        List<String> messages = new ArrayList<>();
+        for (ProgressMessage pm : pms) {
+            if (pm.getMessage() != null &&
+                    (messages.isEmpty() || !pm.getMessage().equals(messages.get(messages.size() - 1)))) {
+                messages.add(pm.getMessage());
+            }
+        }
+        String[] result = new String[messages.size()];
+        return messages.toArray(result);
+    }
+
+    public static CustomTypeSafeMatcher<List<ProgressMessage>> isIncreasing() {
+        return new CustomTypeSafeMatcher<>("is increasing") {
+
+            @Override
+            protected boolean matchesSafely(List<ProgressMessage> pms) {
+                if (pms == null) {
+                    return false;
+                }
+                int lastVal = Integer.MIN_VALUE;
+                for (ProgressMessage pm : pms) {
+                    if (pm.getValue() < lastVal) {
+                        return false;
+                    }
+                    lastVal = pm.getValue();
+                }
+                return true;
+            }
+        };
+    }
+
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/progress/ProgressStatusBasicITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/progress/ProgressStatusBasicITest.java
new file mode 100644
index 0000000..0902128
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/progress/ProgressStatusBasicITest.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.progress;
+
+import java.util.List;
+
+import org.glassfish.main.admin.test.tool.asadmin.Asadmin;
+import org.glassfish.main.admin.test.tool.asadmin.AsadminResult;
+import org.glassfish.main.admin.test.tool.asadmin.GlassFishTestEnvironment;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+
+import static org.glassfish.main.admin.test.progress.ProgressMessage.isIncreasing;
+import static org.glassfish.main.admin.test.tool.AsadminResultMatcher.asadminOK;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.hasSize;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+/**
+ * @author martinmares
+ */
+@ExtendWith(JobTestExtension.class)
+public class ProgressStatusBasicITest {
+
+    private static final Asadmin ASADMIN = GlassFishTestEnvironment.getAsadmin();
+
+
+    @Test
+    public void simple() {
+        AsadminResult result = ASADMIN.exec("progress-simple");
+        assertThat(result, asadminOK());
+        List<ProgressMessage> prgs = ProgressMessage.grepProgressMessages(result.getStdOut());
+        assertThat(prgs, isIncreasing());
+        assertEquals(12, prgs.size());
+        for (int i = 0; i < 11; i++) {
+            assertEquals(10 * i, prgs.get(i + 1).getValue());
+            assertTrue(prgs.get(i + 1).isPercentage());
+        }
+    }
+
+    @Test
+    public void simpleNoTotal() {
+        AsadminResult result = ASADMIN.exec("progress-simple", "--nototalsteps");
+        assertThat(result, asadminOK());
+        List<ProgressMessage> prgs = ProgressMessage.grepProgressMessages(result.getStdOut());
+        assertThat(prgs, isIncreasing());
+        boolean nonPercentageExists = false;
+        for (ProgressMessage prg : prgs) {
+            if (prg.getValue() != 0 && prg.getValue() != 100) {
+                assertFalse(prg.isPercentage());
+                nonPercentageExists = true;
+            }
+        }
+        assertTrue(nonPercentageExists);
+    }
+
+    @Test
+    public void simpleSpecInAnnotation() {
+        AsadminResult result = ASADMIN.exec("progress-full-annotated");
+        assertThat(result, asadminOK());
+        List<ProgressMessage> prgs = ProgressMessage.grepProgressMessages(result.getStdOut());
+        assertThat(prgs, hasSize(12));
+        assertThat(prgs, isIncreasing());
+        for (int i = 0; i < 11; i++) {
+            assertEquals(10 * i, prgs.get(i + 1).getValue());
+            assertTrue(prgs.get(i + 1).isPercentage());
+        }
+        assertEquals("annotated:", prgs.get(5).getScope());
+    }
+
+    @Test
+    public void simpleTerse() {
+        AsadminResult result = ASADMIN.exec("--terse", "progress-simple");
+        assertThat(result, asadminOK());
+        List<ProgressMessage> prgs = ProgressMessage.grepProgressMessages(result.getStdOut());
+        assertThat(prgs, hasSize(0));
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/progress/ProgressStatusComplexITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/progress/ProgressStatusComplexITest.java
new file mode 100644
index 0000000..ed060e7
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/progress/ProgressStatusComplexITest.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.progress;
+
+import java.util.List;
+
+import org.glassfish.main.admin.test.tool.asadmin.Asadmin;
+import org.glassfish.main.admin.test.tool.asadmin.AsadminResult;
+import org.glassfish.main.admin.test.tool.asadmin.GlassFishTestEnvironment;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+
+import static org.glassfish.main.admin.test.progress.ProgressMessage.grepProgressMessages;
+import static org.glassfish.main.admin.test.progress.ProgressMessage.isIncreasing;
+import static org.glassfish.main.admin.test.progress.ProgressMessage.uniqueMessages;
+import static org.glassfish.main.admin.test.tool.AsadminResultMatcher.asadminOK;
+import static org.hamcrest.CoreMatchers.anyOf;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.greaterThanOrEqualTo;
+import static org.hamcrest.Matchers.hasSize;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+/**
+ * @author martinmares
+ */
+@ExtendWith(JobTestExtension.class)
+public class ProgressStatusComplexITest {
+
+    private static final Asadmin ASADMIN = GlassFishTestEnvironment.getAsadmin();
+
+
+    @Test
+    public void executeCommandFromCommand() {
+        AsadminResult result = ASADMIN.exec(30_000, "progress-exec-other");
+        assertThat(result, asadminOK());
+        assertArrayEquals(new String[] {
+            "Starting", "Preparing", "Parsing", "Working on main part",
+            "Cleaning", "Finished", "Finishing outer command", "Finished outer command" },
+            uniqueMessages(grepProgressMessages(result.getStdOut())));
+    }
+
+    @Test
+    public void executeCommandWithSupplements() {
+        AsadminResult result = ASADMIN.exec("progress-supplement");
+        assertThat(result, asadminOK());
+
+        List<ProgressMessage> prgs = grepProgressMessages(result.getStdOut());
+        assertArrayEquals(new String[] {
+            "Starting", "2 seconds supplemental command", "Parsing",
+            "Working on main part", "Finished", "3 seconds supplemental" },
+            uniqueMessages(prgs));
+
+        assertThat(prgs, hasSize(21));
+        assertThat(prgs, isIncreasing());
+        assertFalse(prgs.get(4).isPercentage());
+        assertTrue(prgs.get(10).isPercentage());
+    }
+
+    @Test
+    public void executeVeryComplexCommand() {
+        AsadminResult result = ASADMIN.exec("progress-complex");
+        assertThat(result, asadminOK());
+
+        List<ProgressMessage> prgs = ProgressMessage.grepProgressMessages(result.getStdOut());
+        assertThat(prgs, hasSize(greaterThanOrEqualTo(100)));
+        assertThat(prgs, isIncreasing());
+        assertEquals(5, scopeCount(prgs, "complex:"));
+        assertEquals(0, scopeCount(prgs, "complex.ch1:"));
+        assertThat(scopeCount(prgs, "complex.ch2-paral:"), anyOf(equalTo(5), equalTo(6)));
+        assertEquals(4, scopeCount(prgs, "complex.ch3:"));
+        assertEquals(5, scopeCount(prgs, "complex.ch1.ch11:"));
+        assertEquals(6, scopeCount(prgs, "complex.ch1.ch12:"));
+        assertEquals(25, scopeCount(prgs, "complex.ch2-paral.ch21:"));
+        assertEquals(25, scopeCount(prgs, "complex.ch2-paral.ch22:"));
+        assertEquals(25, scopeCount(prgs, "complex.ch2-paral.ch23:"));
+        assertEquals(25, scopeCount(prgs, "complex.ch2-paral.ch24:"));
+        assertEquals(5, scopeCount(prgs, "complex.ch3.ch31:"));
+        assertEquals(5, scopeCount(prgs, "complex.ch3.ch32:"));
+    }
+
+    private int scopeCount(List<ProgressMessage> prgs, String scope) {
+        int result = 0;
+        for (ProgressMessage prg : prgs) {
+            if (scope.equals(prg.getScope())) {
+                result++;
+            }
+        }
+        return result;
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/progress/ProgressStatusFailITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/progress/ProgressStatusFailITest.java
new file mode 100644
index 0000000..b6ad40c
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/progress/ProgressStatusFailITest.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.progress;
+
+import java.util.List;
+
+import org.glassfish.main.admin.test.tool.asadmin.Asadmin;
+import org.glassfish.main.admin.test.tool.asadmin.AsadminResult;
+import org.glassfish.main.admin.test.tool.asadmin.GlassFishTestEnvironment;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+
+import static org.glassfish.main.admin.test.tool.AsadminResultMatcher.asadminOK;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.not;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+
+/**
+ * @author martinmares
+ */
+@ExtendWith(JobTestExtension.class)
+public class ProgressStatusFailITest {
+
+    private static final Asadmin ASADMIN = GlassFishTestEnvironment.getAsadmin();
+
+    @Test
+    public void failDuringExecution() {
+        AsadminResult result = ASADMIN.exec("progress-fail-in-half");
+        assertThat(result, not(asadminOK()));
+        List<ProgressMessage> messages = ProgressMessage.grepProgressMessages(result.getStdOut());
+        assertFalse(messages.isEmpty());
+        assertEquals(50, messages.get(messages.size() - 1).getValue());
+    }
+
+    @Test
+    public void timeout() {
+        AsadminResult result = ASADMIN.exec(6_000, "progress-custom", "3x1", "1x8", "2x1");
+        assertThat(result, not(asadminOK()));
+        List<ProgressMessage> prgs = ProgressMessage.grepProgressMessages(result.getStdOut());
+        assertFalse(prgs.isEmpty());
+        assertEquals(50, prgs.get(prgs.size() - 1).getValue());
+    }
+
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/progress/ProgressStatusSpecialITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/progress/ProgressStatusSpecialITest.java
new file mode 100644
index 0000000..576e949
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/progress/ProgressStatusSpecialITest.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.progress;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.glassfish.main.admin.test.tool.asadmin.Asadmin;
+import org.glassfish.main.admin.test.tool.asadmin.AsadminResult;
+import org.glassfish.main.admin.test.tool.asadmin.GlassFishTestEnvironment;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+
+import static org.glassfish.main.admin.test.progress.ProgressMessage.isIncreasing;
+import static org.glassfish.main.admin.test.tool.AsadminResultMatcher.asadminOK;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.lessThan;
+import static org.hamcrest.Matchers.lessThanOrEqualTo;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+/**
+ * @author martinmares
+ */
+@ExtendWith(JobTestExtension.class)
+public class ProgressStatusSpecialITest {
+
+    private static final Asadmin ASADMIN = GlassFishTestEnvironment.getAsadmin();
+
+
+    @Test
+    public void stepBackCommand() {
+        AsadminResult result = ASADMIN.exec("progress-step-back");
+        assertThat(result, asadminOK());
+        List<ProgressMessage> prgs = ProgressMessage.grepProgressMessages(result.getStdOut());
+        assertThat(prgs, not(isIncreasing()));
+        Iterator<ProgressMessage> itr = prgs.iterator();
+        while (itr.hasNext()) {
+            ProgressMessage prg = itr.next();
+            if (prg.getValue() >= 80) {
+                break;
+            }
+        }
+        assertTrue(itr.hasNext(), "Exist more records");
+        while (itr.hasNext()) {
+            ProgressMessage prg = itr.next();
+            assertThat(prg.getValue(), lessThanOrEqualTo(80));
+            if (prg.getValue() < 80) {
+                break;
+            }
+        }
+        assertTrue(itr.hasNext(), "Exist more records");
+        ProgressMessage prg = itr.next();
+        assertThat(prg.getValue(), lessThan(80));
+    }
+
+    @Test
+    public void doubleTotalCommand() {
+        AsadminResult result = ASADMIN.exec("progress-double-totals");
+        assertThat(result, asadminOK());
+        List<ProgressMessage> prgs = ProgressMessage.grepProgressMessages(result.getStdOut());
+        assertThat(prgs, not(isIncreasing()));
+    }
+
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/ApplicationITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/ApplicationITest.java
new file mode 100644
index 0000000..d2f3934
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/ApplicationITest.java
@@ -0,0 +1,188 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.rest;
+
+import jakarta.ws.rs.core.Response;
+
+import java.net.URISyntaxException;
+import java.util.Map;
+
+import org.glassfish.main.admin.test.tool.DomainAdminRestClient;
+import org.glassfish.main.admin.test.webapp.HelloServlet;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.stringContainsInOrder;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * @author jasonlee
+ */
+public class ApplicationITest extends RestTestBase {
+
+
+    private DomainAdminRestClient client;
+    private String appName;
+
+    @BeforeEach
+    public void initInstanceClient() {
+        appName = "testApp" + generateRandomString();
+        client = new DomainAdminRestClient(getBaseInstanceUrl() + "/" + appName);
+    }
+
+    @AfterEach
+    public void closeInstanceClient() {
+        if (client != null) {
+            client.close();
+        }
+    }
+
+    @Test
+    public void testApplicationDeployment() throws URISyntaxException {
+        try {
+            Map<String, String> deployedApp = deployApp(getWar("test"), appName, appName);
+            assertEquals(appName, deployedApp.get("name"));
+            assertEquals("/" + appName, deployedApp.get("contextRoot"));
+        } finally {
+            undeployApp(appName);
+        }
+    }
+
+
+    @Test
+    public void testApplicationDisableEnable() throws URISyntaxException {
+        Map<String, String> deployedApp = deployApp(getWar("test"), appName, appName);
+        assertEquals(appName, deployedApp.get("name"));
+        assertEquals("/" + appName, deployedApp.get("contextRoot"));
+        try {
+            Response response = client.get("");
+            assertEquals("Hello!", response.readEntity(String.class));
+
+            response = managementClient.post(URL_APPLICATION_DEPLOY + "/" + appName + "/disable");
+            assertThat(response.getStatus(), equalTo(200));
+
+            response = client.get("");
+            assertEquals(404, response.getStatus());
+
+            response = managementClient.post(URL_APPLICATION_DEPLOY + "/" + appName + "/enable");
+            assertThat(response.getStatus(), equalTo(200));
+
+            response = client.get("");
+            assertEquals("Hello!", response.readEntity(String.class).trim());
+        } finally {
+            undeployApp(appName);
+        }
+    }
+
+    @Test
+    public void listSubComponents() throws URISyntaxException {
+        try {
+            deployApp(getEar("simple"), appName, appName);
+            Response response = managementClient
+                .get(URL_APPLICATION_DEPLOY + "/" + appName + "/list-sub-components?id=" + appName);
+            assertThat(response.getStatus(), equalTo(200));
+            String subComponents = response.readEntity(String.class);
+            assertThat(subComponents, stringContainsInOrder("simple"));
+
+            response = managementClient
+                .get(URL_APPLICATION_DEPLOY + "/" + appName + "/list-sub-components?id=simple.war&appname=" + appName);
+            assertThat(response.getStatus(), equalTo(200));
+            subComponents = response.readEntity(String.class);
+            assertThat(subComponents, stringContainsInOrder(HelloServlet.class.getName()));
+        } finally {
+            undeployApp(appName);
+        }
+    }
+
+    @Test
+    public void testCreatingAndDeletingApplicationRefs() throws URISyntaxException {
+        final String instanceName = "instance_" + generateRandomString();
+        final String appRefUrl = "/domain/servers/server/" + instanceName + "/application-ref";
+
+        Map<String, String> newInstance = Map.of("id", instanceName, "node", "localhost-domain1");
+        Map<String, String> applicationRef = Map.of("id", appName, "target", instanceName);
+        try {
+            Response response = managementClient.post(URL_CREATE_INSTANCE, newInstance);
+            assertThat(response.getStatus(), equalTo(200));
+
+            deployApp(getWar("test"), appName, appName);
+
+            response = managementClient.post(appRefUrl, applicationRef);
+            assertThat(response.getStatus(), equalTo(200));
+
+            response = managementClient.get(appRefUrl + "/" + appName);
+            assertThat(response.getStatus(), equalTo(200));
+
+            response = managementClient.delete(appRefUrl + "/" + appName, Map.of("target", instanceName));
+            assertThat(response.getStatus(), equalTo(200));
+        } finally {
+            Response response = managementClient.delete("/domain/servers/server/" + instanceName + "/delete-instance");
+            assertThat(response.getStatus(), equalTo(200));
+            response = managementClient.get("/domain/servers/server/" + instanceName);
+            assertEquals(404, response.getStatus());
+            undeployApp(appName);
+        }
+    }
+
+    @Test
+    public void testGetContextRoot() throws URISyntaxException {
+        try {
+            Map<String, String> deployedApp = deployApp(getEar("simple"), appName, appName);
+            assertEquals(appName, deployedApp.get("name"));
+            Map<String, String> contextRootPayload = Map.of("appname", appName, "modulename", "simple");
+            Response response = managementClient
+                .get("/domain/applications/application/" + appName + "/get-context-root", contextRootPayload);
+            assertThat(response.getStatus(), equalTo(200));
+            assertThat(response.readEntity(String.class),
+                stringContainsInOrder("command", "_get-context-root AdminCommand", "exit_code", "SUCCESS", "--appname",
+                    appName, "--modulename", "simple", "method", "GET"));
+        } finally {
+            undeployApp(appName);
+        }
+    }
+
+
+    @Test
+    public void testUndeploySubActionWarnings() throws URISyntaxException {
+        final String serverName = "in" + generateRandomNumber();
+        try {
+            Response response = managementClient.post("/domain/create-instance",
+                Map.of("id", serverName, "node", "localhost-domain1"));
+            assertThat(response.getStatus(), equalTo(200));
+
+            response = managementClient.post("/domain/servers/server/" + serverName + "/start-instance");
+            assertThat(response.getStatus(), equalTo(200));
+
+            deployApp(getWar("test"), appName, appName);
+            addAppRef(appName, serverName);
+
+            response = managementClient.post("/domain/servers/server/" + serverName + "/stop-instance");
+            assertThat(response.getStatus(), equalTo(200));
+
+            response = managementClient.delete("/domain/applications/application/" + appName,
+                Map.of("target", "domain"));
+            assertThat(response.readEntity(String.class),
+                stringContainsInOrder("deleted successfully", "exit_code", "SUCCESS"));
+        } finally {
+            managementClient.delete("/domain/applications/application/" + appName, Map.of("target", "domain"));
+        }
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/AuthRealmITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/AuthRealmITest.java
new file mode 100644
index 0000000..c1d7225
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/AuthRealmITest.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.rest;
+
+import com.sun.enterprise.security.auth.realm.certificate.CertificateRealm;
+import com.sun.enterprise.security.auth.realm.file.FileRealm;
+import com.sun.enterprise.security.auth.realm.jdbc.JDBCRealm;
+import com.sun.enterprise.security.auth.realm.ldap.LDAPRealm;
+import com.sun.enterprise.security.auth.realm.pam.PamRealm;
+import com.sun.enterprise.security.auth.realm.solaris.SolarisRealm;
+
+import jakarta.ws.rs.core.Response;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Stream;
+
+import org.glassfish.admin.rest.client.utils.MarshallingUtils;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.hasItem;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.contains;
+import static org.hamcrest.Matchers.containsInAnyOrder;
+import static org.hamcrest.Matchers.hasSize;
+import static org.hamcrest.collection.IsMapWithSize.aMapWithSize;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class AuthRealmITest extends RestTestBase {
+    private static final String URL_LIST_GROUP_NAMES = "/domain/configs/config/server-config/security-service/auth-realm/admin-realm/list-group-names";
+    private static final String URL_SUPPORTS_USER_MANAGEMENT = "/domain/configs/config/server-config/security-service/auth-realm/admin-realm/supports-user-management";
+    private static final String URL_LIST_ADMIN_REALM_USERS = "/domain/configs/config/server-config/security-service/auth-realm/admin-realm/list-users";
+    private static final String URL_LIST_FILE_USERS = "/domain/configs/config/server-config/security-service/auth-realm/file/list-users";
+    private static final String URL_CREATE_USER = "/domain/configs/config/server-config/security-service/auth-realm/file/create-user";
+    private static final String URL_DELETE_USER = "/domain/configs/config/server-config/security-service/auth-realm/file/delete-user";
+    private static final String URL_AUTH_REALM_CLASS_NAMES = "/domain/list-predefined-authrealm-classnames";
+
+    @Test
+    public void testListGroupNames() {
+        Response response = managementClient.get(URL_LIST_GROUP_NAMES, Map.of("userName", "admin", "realmName", "admin-realm"));
+        assertEquals(200, response.getStatus());
+        final String entity = response.readEntity(String.class);
+        Map responseMap = MarshallingUtils.buildMapFromDocument(entity);
+        Map extraProperties = (Map) responseMap.get("extraProperties");
+        List<String> groups = (List<String>) extraProperties.get("groups");
+        assertThat(groups, containsInAnyOrder("asadmin"));
+    }
+
+    @Test
+    public void testListAdminUsers() {
+        Response response = managementClient.get(URL_LIST_ADMIN_REALM_USERS);
+        assertEquals(200, response.getStatus());
+        final String entity = response.readEntity(String.class);
+        Map<String, ?> responseMap = MarshallingUtils.buildMapFromDocument(entity);
+        assertThat(responseMap.toString(), responseMap, aMapWithSize(5));
+        Map<String, ?> extraProperties = (Map<String, ?>) responseMap.get("extraProperties");
+        assertThat(extraProperties.toString(), extraProperties, aMapWithSize(3));
+        List<Map<String, List<String>>> users = (List<Map<String, List<String>>>) extraProperties.get("users");
+        assertThat(users, hasSize(1));
+        Map<String, ?> userAdmin = users.get(0);
+        assertThat(userAdmin, aMapWithSize(2));
+        assertThat((String) userAdmin.get("name"), equalTo("admin"));
+        assertThat((List<String>) userAdmin.get("groups"), contains("asadmin"));
+    }
+
+    @Test
+    public void testSupportsUserManagement() {
+        List<String> groups = getCommandResults(managementClient.get(URL_SUPPORTS_USER_MANAGEMENT));
+        assertEquals("true", groups.get(0));
+    }
+
+
+    @Test
+    public void testUserManagement() {
+        final String userName = "user" + generateRandomString();
+        {
+            Response response = managementClient.post(URL_CREATE_USER, Map.of("id", userName, "AS_ADMIN_USERPASSWORD", "password"));
+            assertEquals(200, response.getStatus());
+        }
+        {
+            List<String> values = getCommandResults(managementClient.get(URL_LIST_FILE_USERS));
+            assertThat(values, hasItem(userName));
+        }
+        {
+            Response response = managementClient.delete(URL_DELETE_USER, Map.of("id", userName));
+            assertEquals(200, response.getStatus());
+        }
+        {
+            List<String> values = getCommandResults(managementClient.get(URL_LIST_FILE_USERS));
+            assertThat(values, not(hasItem(userName)));
+        }
+    }
+
+
+    @Test
+    public void testListAuthRealmClassNames() {
+        List<String> classNameList = getCommandResults(managementClient.get(URL_AUTH_REALM_CLASS_NAMES));
+        assertThat(classNameList.toString(), classNameList, hasSize(6));
+        String[] realms = Stream.of(JDBCRealm.class, PamRealm.class, CertificateRealm.class, FileRealm.class,
+            LDAPRealm.class, SolarisRealm.class).map(Class::getName).toArray(String[]::new);
+        assertThat(classNameList, containsInAnyOrder(realms));
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/ClusterITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/ClusterITest.java
new file mode 100644
index 0000000..174bf79
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/ClusterITest.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.rest;
+
+import jakarta.ws.rs.core.Response;
+
+import java.util.Map;
+
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * @author jasonlee
+ */
+public class ClusterITest extends RestTestBase {
+
+    @Test
+    public void testClusterCreationAndDeletion() {
+        final String clusterName = "cluster_" + generateRandomString();
+        createCluster(clusterName);
+
+        Map<String, String> entity = getEntityValues(managementClient.get(URL_CLUSTER + "/" + clusterName));
+        assertEquals(clusterName + "-config", entity.get("configRef"));
+
+        deleteCluster(clusterName);
+    }
+
+    @Test
+    public void testListLifecycleModules() {
+        final String clusterName = "cluster_" + generateRandomString();
+        Response response = managementClient.post(URL_CLUSTER, Map.of("id", clusterName));
+        assertThat(response.getStatus(), equalTo(200));
+
+        response = managementClient.get(URL_CLUSTER + "/" + clusterName + "/list-lifecycle-modules");
+        assertThat(response.getStatus(), equalTo(200));
+
+        response = managementClient.delete(URL_CLUSTER + "/" + clusterName);
+        assertThat(response.getStatus(), equalTo(200));
+
+        response = managementClient.get(URL_CLUSTER + "/" + clusterName);
+        assertEquals(404, response.getStatus());
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/ConfigITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/ConfigITest.java
new file mode 100644
index 0000000..d156b82
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/ConfigITest.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.rest;
+
+import jakarta.ws.rs.core.MultivaluedHashMap;
+import jakarta.ws.rs.core.Response;
+
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * @author jasonlee
+ */
+public class ConfigITest extends RestTestBase {
+
+    @Test
+    public void testConfigCopy() {
+        String configName = "config-" + generateRandomString();
+        MultivaluedHashMap<String, String> formData = new MultivaluedHashMap<>();
+        formData.add("id", "default-config");
+        formData.add("id", configName);
+        createAndVerifyConfig(configName, formData);
+        deleteAndVerifyConfig(configName);
+    }
+
+    @Test
+    public void duplicitCopyShouldFail() {
+        MultivaluedHashMap<String, String> formData = new MultivaluedHashMap<>();
+        formData.add("id", "default-config");
+        formData.add("id", "server-config");
+        Response response = managementClient.post(URL_CONFIGS + "/copy-config", formData);
+        // FIXME: causes HTTP 500 without any log, should be 422.
+        assertThat(response.getStatus(), equalTo(500));
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/DomainITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/DomainITest.java
new file mode 100644
index 0000000..6368fe2
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/DomainITest.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.rest;
+
+import jakarta.ws.rs.core.Response;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class DomainITest extends RestTestBase {
+
+    private static final String URL_DOMAIN = "/domain";
+
+    @Test
+    public void testDomainGet() throws Exception {
+        Response response0 = managementClient.get(URL_DOMAIN);
+        assertThat(response0.getStatus(), equalTo(200));
+        Map<String, String> current = getEntityValues(response0);
+
+        // Select a random locale so we're not setting the locale to its current value
+        List<String> locales = new ArrayList<>(List.of("en_US", "en", "de_DE", "_GB", "en_US_WIN", "de__POSIX", "fr__MAC"));
+        locales.remove(current.get("locale"));
+        final int random = new Random().nextInt(locales.size());
+        String newLocale = locales.get(random);
+
+        Map<String, String> payload = new HashMap<>();
+        payload.put("locale", newLocale);
+        Response response = managementClient.post(URL_DOMAIN, payload);
+        assertEquals(200, response.getStatus());
+
+        // Reload the domain and make sure our new locale was saved
+        Map<String, String> map = getEntityValues(managementClient.get(URL_DOMAIN));
+        assertEquals(newLocale, map.get("locale"));
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/ElementStarITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/ElementStarITest.java
new file mode 100644
index 0000000..4d4d565
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/ElementStarITest.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.rest;
+
+import jakarta.ws.rs.core.Response;
+
+import java.net.URISyntaxException;
+import java.util.Map;
+
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.aMapWithSize;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * This class tests the changes to the handling of @Element("*") instances
+ *
+ * @author jasonlee
+ */
+public class ElementStarITest extends RestTestBase {
+    private static final String URL_CREATE_INSTANCE = "/domain/create-instance";
+
+    private String instanceName1;
+    private String instanceName2;
+
+    @BeforeEach
+    public void before() {
+        instanceName1 = "instance_" + generateRandomString();
+        instanceName2 = "instance_" + generateRandomString();
+
+        Response response = managementClient.post(URL_CREATE_INSTANCE,
+            Map.of("id", instanceName1, "node", "localhost-domain1"));
+        assertThat(response.getStatus(), equalTo(200));
+        response = managementClient.post(URL_CREATE_INSTANCE, Map.of("id", instanceName2, "node", "localhost-domain1"));
+        assertEquals(200, response.getStatus());
+    }
+
+
+    @AfterEach
+    public void after() {
+        Response response = managementClient.delete("/domain/servers/server/" + instanceName1 + "/delete-instance");
+        assertEquals(200, response.getStatus());
+        response = managementClient.delete("/domain/servers/server/" + instanceName2 + "/delete-instance");
+        assertEquals(200, response.getStatus());
+    }
+
+
+    @Test
+    public void testApplications() throws URISyntaxException {
+        final String app1 = "app" + generateRandomString();
+        final String app2 = "app" + generateRandomString();
+
+        deployApp(getWar("test"), app1, app1);
+        deployApp(getWar("test"), app2, app2);
+        addAppRef(app1, instanceName1);
+        addAppRef(app2, instanceName1);
+
+        Response response = managementClient.get("/domain/servers/server/" + instanceName1 + "/application-ref");
+        Map<String, String> children = this.getChildResources(response);
+        assertThat(children, aMapWithSize(2));
+    }
+
+
+    @Test
+    public void testResources() {
+        // The DAS should already have two resource-refs (jdbc/__TimerPool and jdbc/__default)
+        Response response = managementClient.get("/domain/servers/server/server/resource-ref");
+        Map<String, String> children = this.getChildResources(response);
+        assertThat(children, aMapWithSize(7));
+    }
+
+
+    @Test
+    public void testLoadBalancerConfigs() {
+        final String lbName = "lbconfig-" + generateRandomString();
+        Response response = managementClient.post("/domain/lb-configs/lb-config/",
+            Map.of("id", lbName, "target", instanceName1));
+        assertEquals(200, response.getStatus());
+
+        response = managementClient.post("/domain/lb-configs/lb-config/" + lbName + "/create-http-lb-ref",
+            Map.of("id", instanceName2));
+        assertEquals(200, response.getStatus());
+
+        response = managementClient.get("/domain/lb-configs/lb-config/" + lbName + "/server-ref");
+        Map<String, String> children = getChildResources(response);
+        assertThat(children, aMapWithSize(1));
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/ExternalResourceITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/ExternalResourceITest.java
new file mode 100644
index 0000000..12fc140
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/ExternalResourceITest.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.rest;
+
+import jakarta.ws.rs.core.Response;
+
+import java.util.Map;
+
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * @author jasonlee
+ */
+public class ExternalResourceITest extends RestTestBase {
+
+    private static final String URL_EXTERNAL_RESOURCE = "/domain/resources/external-jndi-resource";
+
+    @Test
+    public void createAndDeleteExternalResource() {
+        final String resourceName = "resource_" + generateRandomString();
+        final String jndiName = "jndi/" + resourceName;
+        Map<String, String> newResource = Map.of(
+            "id", resourceName,
+            "jndilookupname", jndiName,
+            "factoryClass", "org.glassfish.resources.custom.factory.PrimitivesAndStringFactory",
+            "restype", Double.class.getName()
+        );
+        Response response = managementClient.post(URL_EXTERNAL_RESOURCE, newResource);
+        assertThat(response.getStatus(), equalTo(200));
+
+        response = managementClient.get(URL_EXTERNAL_RESOURCE + "/" + resourceName);
+        assertThat(response.getStatus(), equalTo(200));
+
+        response = managementClient.delete(URL_EXTERNAL_RESOURCE + "/" + resourceName);
+        assertThat(response.getStatus(), equalTo(200));
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/JdbcITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/JdbcITest.java
new file mode 100644
index 0000000..9643dba
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/JdbcITest.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.rest;
+
+import jakarta.ws.rs.core.Response;
+
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import java.util.HashMap;
+import java.util.Map;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.aMapWithSize;
+import static org.hamcrest.Matchers.greaterThan;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+/**
+ * @author jasonlee
+ */
+public class JdbcITest extends RestTestBase {
+
+    @Test
+    public void testReadingPoolEntity() {
+        Map<String, String> entity = getEntityValues(managementClient.get(URL_JDBC_CONNECTION_POOL + "/__TimerPool"));
+        assertEquals("__TimerPool", entity.get("name"));
+    }
+
+
+    @Test
+    public void testCreateAndDeletePool() {
+        String poolName = "TestPool" + generateRandomString();
+        Map<String, String> params = new HashMap<>();
+        params.put("name", poolName);
+        params.put("datasourceClassname", "org.apache.derby.jdbc.ClientDataSource");
+        Response response = managementClient.post(URL_JDBC_CONNECTION_POOL, params);
+        assertEquals(200, response.getStatus());
+
+        Map<String, String> entity = getEntityValues(managementClient.get(URL_JDBC_CONNECTION_POOL + "/" + poolName));
+        assertThat(entity, aMapWithSize(greaterThan(40)));
+
+        response = managementClient.delete(URL_JDBC_CONNECTION_POOL + "/" + poolName, Map.of());
+        assertEquals(200, response.getStatus());
+
+        response = managementClient.get(URL_JDBC_CONNECTION_POOL + "/" + poolName);
+        assertEquals(404, response.getStatus());
+    }
+
+
+    @Test
+    public void testBackslashValidation() {
+        String poolName = "TestPool\\" + generateRandomString();
+        String encodedPoolName = URLEncoder.encode(poolName, StandardCharsets.UTF_8);
+        Map<String, String> params = new HashMap<>();
+        params.put("name", poolName);
+        params.put("poolName", "DerbyPool");
+
+        Response response = managementClient.post(URL_JDBC_RESOURCE, params);
+        assertEquals(500, response.getStatus());
+
+        Response responseGet = managementClient.get(URL_JDBC_CONNECTION_POOL + "/" + encodedPoolName);
+        assertEquals(500, response.getStatus());
+        Map<String, String> entity = getEntityValues(responseGet);
+        assertNull(entity);
+
+        response = managementClient.delete("/" + encodedPoolName, Map.of());
+        assertEquals(500, response.getStatus());
+
+        response = managementClient.get(URL_JDBC_CONNECTION_POOL + "/" + encodedPoolName);
+        assertEquals(500, response.getStatus());
+    }
+
+
+    @Test
+    public void createDuplicateResource() {
+        final String resourceName = "jdbc/__default";
+        Map<String, String> params = Map.of("id", resourceName, "poolName", "DerbyPool");
+        Response response = managementClient.post(URL_JDBC_RESOURCE, params);
+        assertEquals(500, response.getStatus());
+    }
+
+
+    @Test
+    public void createDuplicateConnectionPool() {
+        final String poolName = "DerbyPool";
+        Map<String, String> params = Map.of("id", poolName, "datasourceClassname",
+            "org.apache.derby.jdbc.ClientDataSource");
+        Response response = managementClient.post(URL_JDBC_CONNECTION_POOL, params);
+        assertEquals(500, response.getStatus());
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/JmsITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/JmsITest.java
new file mode 100644
index 0000000..84dae21
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/JmsITest.java
@@ -0,0 +1,211 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2010, 2020 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.rest;
+
+import jakarta.ws.rs.core.Response;
+
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.aMapWithSize;
+import static org.hamcrest.Matchers.greaterThanOrEqualTo;
+import static org.hamcrest.Matchers.stringContainsInOrder;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * @author jasonlee
+ * @since May 26, 2010
+ */
+public class JmsITest extends RestTestBase {
+    static final String URL_ADMIN_OBJECT_RESOURCE = "/domain/resources/admin-object-resource";
+    static final String URL_CONNECTOR_CONNECTION_POOL = "/domain/resources/connector-connection-pool";
+    static final String URL_CONNECTOR_RESOURCE = "/domain/resources/connector-resource";
+    static final String URL_JMS_HOST = "/domain/configs/config/server-config/jms-service/jms-host";
+    static final String URL_SEVER_JMS_DEST = "/domain/servers/server/server";
+    static final String DEST_TYPE = "topic";
+
+    @Test
+    public void testJmsConnectionFactories() {
+        // Create connection pool
+        final String poolName = "JmsConnectionFactory" + generateRandomString();
+        Map<String, String> ccp_attrs = Map.of("name", poolName, "connectiondefinition",
+            "jakarta.jms.ConnectionFactory", "raname", "jmsra");
+        Response response = managementClient.post(URL_CONNECTOR_CONNECTION_POOL, ccp_attrs);
+        assertThat(response.getStatus(), equalTo(200));
+
+        // Check connection pool creation
+        Map<String, String> pool = getEntityValues(managementClient.get(URL_CONNECTOR_CONNECTION_POOL + "/" + poolName));
+        assertThat(pool, aMapWithSize(greaterThanOrEqualTo(26)));
+
+        // Create connector resource
+        String resourceName = poolName + "Resource";
+        Map<String, String> cr_attrs = Map.of("name", resourceName, "poolname", poolName);
+        response = managementClient.post(URL_CONNECTOR_RESOURCE, cr_attrs);
+        assertThat(response.getStatus(), equalTo(200));
+
+        // Check connector resource
+        Map<String, String> resource = getEntityValues(managementClient.get(URL_CONNECTOR_RESOURCE + "/" + resourceName));
+        assertThat(resource, aMapWithSize(6));
+
+        // Edit and check ccp
+        response = managementClient.post(URL_CONNECTOR_CONNECTION_POOL + "/" + poolName, Map.of("description", poolName));
+        assertThat(response.getStatus(), equalTo(200));
+
+        pool = getEntityValues(managementClient.get(URL_CONNECTOR_CONNECTION_POOL + "/" + poolName));
+        assertThat(pool.get("description"), equalTo(poolName));
+
+        // Edit and check cr
+        response = managementClient.post(URL_CONNECTOR_RESOURCE + "/" + resourceName, Map.of("description", poolName));
+        assertThat(response.getStatus(), equalTo(200));
+
+        resource = getEntityValues(managementClient.get(URL_CONNECTOR_RESOURCE + "/" + resourceName));
+        assertThat(pool.get("description"), equalTo(poolName));
+
+        // Delete objects
+        response = managementClient.delete(URL_CONNECTOR_CONNECTION_POOL + "/" + poolName, Map.of("cascade", "true"));
+        assertThat(response.getStatus(), equalTo(200));
+    }
+
+    @Test
+    public void testJmsDestinationResources() {
+        final String jndiName = "jndi/" + generateRandomString();
+        String encodedJndiName = URLEncoder.encode(jndiName, StandardCharsets.UTF_8);
+
+        Map<String, String> attrs = Map.of("id", jndiName, "raname", "jmsra", "restype", "jakarta.jms.Topic");
+
+        Response response = managementClient.post(URL_ADMIN_OBJECT_RESOURCE, attrs);
+        assertThat(response.getStatus(), equalTo(200));
+
+        Map<String, String> entity = getEntityValues(
+            managementClient.get(URL_ADMIN_OBJECT_RESOURCE + "/" + encodedJndiName));
+        assertThat(entity, aMapWithSize(8));
+
+        response = managementClient.delete(URL_ADMIN_OBJECT_RESOURCE + "/" + encodedJndiName);
+        assertThat(response.getStatus(), equalTo(200));
+    }
+
+    @Test
+    public void testJmsPhysicalDestination() {
+        final String destName = "jmsDest" + generateRandomString();
+        final int maxNumMsgs = generateRandomNumber(500);
+        final int consumerFlowLimit = generateRandomNumber(500);
+
+        createJmsPhysicalDestination(destName, DEST_TYPE, URL_SEVER_JMS_DEST);
+
+        final Map<String, String> newDest = Map.of("id", destName, "desttype", DEST_TYPE);
+        Map<String, String> destProps = new HashMap<>(newDest);
+        destProps.putAll(Map.of("property", "MaxNumMsgs=" + maxNumMsgs + ":ConsumerFlowLimit=" + consumerFlowLimit));
+
+        Response response = managementClient.get(URL_SEVER_JMS_DEST + "/__get-jmsdest", newDest);
+        assertThat(response.getStatus(), equalTo(200));
+
+        response = managementClient.post(URL_SEVER_JMS_DEST + "/__update-jmsdest", destProps);
+        assertThat(response.getStatus(), equalTo(200));
+        response = managementClient.get(URL_SEVER_JMS_DEST + "/__get-jmsdest", newDest);
+        assertThat(response.getStatus(), equalTo(200));
+        Map<String, String> entity = getEntityValues(response);
+        assertEquals(maxNumMsgs, entity.get("MaxNumMsgs"));
+        assertEquals(consumerFlowLimit, entity.get("ConsumerFlowLimit"));
+
+        deleteJmsPhysicalDestination(destName, URL_SEVER_JMS_DEST);
+    }
+
+    @Test
+    @Disabled("Enable and fix OpenMQ - require more detailed message and probably to fix the cause:"
+        + " MQJMSRA_RA4001: getJMXServiceURLList:Exception:Message=Caught exception when contacing portmapper.]]")
+    public void testJmsPhysicalDestionationsWithClusters() {
+        final String destName = "jmsDest" + generateRandomString();
+        final String clusterName = createCluster();
+        createClusterInstance(clusterName, "in1_" + clusterName);
+        startCluster(clusterName);
+        final String endpoint = "/domain/clusters/cluster/" + clusterName;
+        try {
+            createJmsPhysicalDestination(destName, "topic", endpoint);
+            final Map<String, String> newDest = Map.of("id", destName, "desttype", DEST_TYPE);
+            Response response = managementClient.get(endpoint + "/__get-jmsdest", newDest);
+            assertThat(response.getStatus(), equalTo(200));
+
+            response = managementClient.get(URL_SEVER_JMS_DEST + "/__get-jmsdest", newDest);
+            assertThat(response.getStatus(), equalTo(200));
+        } finally {
+            deleteJmsPhysicalDestination(destName, endpoint);
+            stopCluster(clusterName);
+            deleteCluster(clusterName);
+        }
+    }
+
+    @Test
+    public void testJmsPing() {
+        String results = managementClient.get(URL_SEVER_JMS_DEST + "/jms-ping").readEntity(String.class);
+        assertThat(results, stringContainsInOrder("JMS-ping command executed successfully"));
+    }
+
+    @Test
+    public void testJmsFlush() {
+        Map<String, String> payload = Map.of("id", "mq.sys.dmq", "destType", "queue");
+        Response response = managementClient.post(URL_SEVER_JMS_DEST + "/flush-jmsdest", payload);
+        assertThat(response.getStatus(), equalTo(200));
+    }
+
+    @Test
+    public void testJmsHosts() {
+        final String jmsHostName = "jmshost" + generateRandomString();
+        Map<String, String> newHost = Map.of("id", jmsHostName, "adminPassword", "admin", "port", "7676",
+            "adminUserName", "admin", "host", "localhost");
+
+        // Test create
+        Response response = managementClient.post(URL_JMS_HOST, newHost);
+        assertThat(response.getStatus(), equalTo(200));
+
+        // Test edit
+        Map<String, String> entity = getEntityValues(managementClient.get(URL_JMS_HOST + "/" + jmsHostName));
+        assertThat(entity, aMapWithSize(greaterThanOrEqualTo(6)));
+        assertEquals(jmsHostName, entity.get("name"));
+        entity.put("port", "8686");
+        response = managementClient.post(URL_JMS_HOST + "/" + jmsHostName, entity);
+        assertThat(response.getStatus(), equalTo(200));
+        entity = getEntityValues(managementClient.get(URL_JMS_HOST + "/" + jmsHostName));
+        assertEquals("8686", entity.get("port"));
+
+        // Test delete
+        response = managementClient.delete(URL_JMS_HOST + "/" + jmsHostName);
+        assertThat(response.getStatus(), equalTo(200));
+    }
+
+    public void createJmsPhysicalDestination(final String destName, final String type, final String endpoint) {
+        final Map<String, String> newDest = Map.of("id", destName, "desttype", type);
+        Response response = managementClient.post(endpoint + "/create-jmsdest", newDest);
+        assertThat(response.getStatus(), equalTo(200));
+    }
+
+    public void deleteJmsPhysicalDestination(final String destName, final String endpoint) {
+        final Map<String, String> newDest = Map.of("id", destName, "desttype", DEST_TYPE);
+        Response response = managementClient.delete(endpoint + "/delete-jmsdest", newDest);
+        assertThat(response.getStatus(), equalTo(200));
+
+        response = managementClient.get(endpoint + "__get-jmsdest", newDest);
+        assertThat(response.getStatus(), equalTo(404));
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/JobsResourceITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/JobsResourceITest.java
new file mode 100644
index 0000000..cd7c57c
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/JobsResourceITest.java
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.rest;
+
+import jakarta.ws.rs.core.Response;
+
+import org.codehaus.jettison.json.JSONArray;
+import org.codehaus.jettison.json.JSONObject;
+import org.glassfish.main.admin.test.tool.DomainAdminRestClient;
+import org.glassfish.main.admin.test.tool.asadmin.GlassFishTestEnvironment;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.glassfish.main.admin.test.tool.AsadminResultMatcher.asadminOK;
+import static org.glassfish.main.admin.test.tool.asadmin.GlassFishTestEnvironment.getAsadmin;
+import static org.hamcrest.CoreMatchers.endsWith;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+/**
+ * @author jdlee
+ */
+public class JobsResourceITest extends RestTestBase {
+
+    private static final String GF_JSON_TYPE = "application/vnd.oracle.glassfish+json";
+    private static final String URL_JOBS = "/jobs";
+
+    private DomainAdminRestClient client;
+    private String jobId;
+
+    @BeforeEach
+    public void initInstanceClient() {
+        client = new DomainAdminRestClient(getBaseAdminUrl() + "/management", GF_JSON_TYPE);
+    }
+
+
+    @AfterEach
+    public void closeInstanceClient() {
+        if (jobId != null) {
+            GlassFishTestEnvironment.getAsadmin().exec("attach", jobId);
+        }
+        if (client != null) {
+            client.close();
+        }
+    }
+
+    @Test
+    public void testJobsListing() {
+        assertEquals(200, client.get(URL_JOBS).getStatus());
+    }
+
+    @Test
+    public void testGetJob() throws Exception {
+        // make sure we have at least one detached job
+        assertThat(getAsadmin().exec("--detach", "uptime"), asadminOK());
+
+        // verify getting the collection
+        Response response = client.get(URL_JOBS);
+        assertEquals(200, response.getStatus());
+
+        // verify the overall structure
+        JSONObject json = response.readEntity(JSONObject.class);
+        JSONArray resources = json.getJSONArray("resources");
+        assertNotNull(resources);
+        assertThat(resources.toString(), resources.length(), equalTo(1));
+
+        JSONArray items = json.getJSONArray("items");
+        assertNotNull(items);
+        assertThat(items.toString(), items.length(), equalTo(1));
+
+        // unlike most resources that also return a parent link,
+        // the jobs resource only returns child links.
+        // verify the first of them
+        JSONObject resource = resources.getJSONObject(0);
+        String uri = resource.getString("uri");
+        assertNotNull(uri);
+        assertEquals("job", resource.getString("rel"));
+
+        jobId = resource.getString("title");
+        assertNotNull(jobId);
+        assertThat(uri, endsWith(URL_JOBS + "/id/" + jobId));
+
+        // verify the job it refers to by following the link.
+        // it should only have a parent link
+        try (GenericClient genericClient = new GenericClient()) {
+            response = genericClient.get(uri);
+            assertThat(response.getStatus(), equalTo(200));
+            json = response.readEntity(JSONObject.class);
+        }
+        JSONObject item = json.getJSONObject("item");
+        System.out.println(item.toString());
+        assertNotNull(item);
+        assertEquals(jobId, item.getString("jobId"));
+
+        resources = json.getJSONArray("resources");
+        assertNotNull(resources);
+        assertThat(resources.toString(), resources.length(), equalTo(1));
+
+        resource = resources.getJSONObject(0);
+        assertEquals("parent", resource.getString("rel"));
+        assertThat(resource.getString("uri"), endsWith(URL_JOBS));
+
+        // verify that the collection returned the item too
+        item = null;
+        for (int i = 0; item == null && i < items.length(); i++) {
+            JSONObject thisItem = items.getJSONObject(i);
+            if (jobId.equals(thisItem.getString("jobId"))) {
+                item = thisItem;
+            }
+        }
+        assertNotNull(item);
+        assertEquals(jobId, item.getString("jobId"));
+    }
+
+
+    private static class GenericClient extends DomainAdminRestClient {
+        public GenericClient() {
+            super(GlassFishTestEnvironment.createClient(), "", GF_JSON_TYPE);
+        }
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/JvmOptionsITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/JvmOptionsITest.java
new file mode 100644
index 0000000..18c8471
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/JvmOptionsITest.java
@@ -0,0 +1,228 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.rest;
+
+import jakarta.ws.rs.core.MultivaluedHashMap;
+import jakarta.ws.rs.core.MultivaluedMap;
+import jakarta.ws.rs.core.Response;
+
+import java.util.List;
+import java.util.Map;
+
+import org.glassfish.admin.rest.client.utils.MarshallingUtils;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.CoreMatchers.hasItem;
+import static org.hamcrest.CoreMatchers.hasItems;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.allOf;
+import static org.hamcrest.Matchers.greaterThan;
+import static org.hamcrest.Matchers.hasSize;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * @author jasonlee
+ */
+public class JvmOptionsITest extends RestTestBase {
+    private static final String URL_SERVER_JVM_OPTIONS = "/domain/configs/config/server-config/java-config/jvm-options";
+    private static final String URL_DEFAULT_JVM_OPTIONS = "/domain/configs/config/default-config/java-config/jvm-options";
+
+    private static final String URL_SERVER_CONFIG_CREATE_PROFILER = "/domain/configs/config/server-config/java-config/create-profiler";
+    private static final String URL_SERVER_CONFIG_DELETE_PROFILER = "/domain/configs/config/server-config/java-config/profiler/delete-profiler";
+    private static final String URL_SERVER_CONFIG_PROFILER_JVM_OPTIONS = "/domain/configs/config/server-config/java-config/profiler/jvm-options";
+
+    private static final String URL_DEFAULT_CONFIG_CREATE_PROFILER = "/domain/configs/config/default-config/java-config/create-profiler";
+    private static final String URL_DEFAULT_CONFIG_DELETE_PROFILER = "/domain/configs/config/default-config/java-config/profiler/delete-profiler";
+    private static final String URL_DEFAULT_CONFIG_PROFILER_JVM_OPTIONS = "/domain/configs/config/default-config/java-config/profiler/jvm-options";
+
+    private static RestTestBase configManagement;
+    private String testConfigName;
+    private String testConfigUrl;
+    private String testConfigJvmOptionsUrl;
+
+    @BeforeAll
+    public static void initConfig() {
+        configManagement = new RestTestBase();
+    }
+
+    @BeforeEach
+    public void createConfig() {
+        testConfigName = "config-" + generateRandomString();
+        MultivaluedMap<String, String> formData = new MultivaluedHashMap<>() {{
+            add("id", "default-config");
+            add("id", testConfigName);
+        }};
+        configManagement.createAndVerifyConfig(testConfigName, formData);
+        testConfigUrl = "/domain/configs/config/" + testConfigName;
+        testConfigJvmOptionsUrl = testConfigUrl + "/java-config/jvm-options";
+    }
+
+    @AfterEach
+    public void deleteConfig() {
+        configManagement.deleteAndVerifyConfig(testConfigName);
+    }
+
+
+    @Test
+    public void getJvmOptions() {
+        Response response = managementClient.get(URL_SERVER_JVM_OPTIONS);
+        assertEquals(200, response.getStatus());
+        Map<String, ?> responseMap = MarshallingUtils.buildMapFromDocument(response.readEntity(String.class));
+        List<String> jvmOptions = (List<String>)((Map)responseMap.get("extraProperties")).get("leafList");
+        assertThat(jvmOptions, hasSize(greaterThan(10)));
+    }
+
+    @Test
+    public void createAndDeleteOptions() {
+        final String option1Name = "-Doption" + generateRandomString();
+        Map<String, String> newOptions = Map.of(option1Name, "someValue");
+
+        Response response = managementClient.post(testConfigJvmOptionsUrl, newOptions);
+        assertEquals(200, response.getStatus());
+        response = managementClient.get(testConfigJvmOptionsUrl);
+        List<String> jvmOptions = getJvmOptions(response);
+        assertThat(jvmOptions, hasItem(option1Name + "=someValue"));
+
+        response = managementClient.delete(testConfigJvmOptionsUrl, newOptions);
+        assertEquals(200, response.getStatus());
+        response = managementClient.get(testConfigJvmOptionsUrl);
+        jvmOptions = getJvmOptions(response);
+        assertThat(jvmOptions, not(hasItem(option1Name + "=someValue")));
+    }
+
+    @Test
+    public void createAndDeleteOptionsWithBackslashes() {
+        final String optionName = "-Dfile" + generateRandomString();
+        final String optionValue = "C:\\ABC\\DEF\\";
+        Map<String, String> newOptions = Map.of(optionName, escape(optionValue));
+
+        Response response = managementClient.post(testConfigJvmOptionsUrl, newOptions);
+        assertEquals(200, response.getStatus());
+        response = managementClient.get(testConfigJvmOptionsUrl);
+        List<String> jvmOptions = getJvmOptions(response);
+        assertThat(jvmOptions, hasItem(optionName + "=" + optionValue));
+
+        response = managementClient.delete(testConfigJvmOptionsUrl, newOptions);
+        assertEquals(200, response.getStatus());
+        response = managementClient.get(testConfigJvmOptionsUrl);
+        jvmOptions = getJvmOptions(response);
+        assertThat(jvmOptions, not(hasItem(optionName + "=" + optionValue)));
+    }
+
+    @Test
+    public void createAndDeleteOptionsWithoutValues() {
+        final String option1Name = "-Doption" + generateRandomString();
+        final String option2Name = "-Doption" + generateRandomString();
+        Map<String, String> newOptions = Map.of(option1Name, "", option2Name, "");
+        Response response = managementClient.post(testConfigJvmOptionsUrl, newOptions);
+        assertEquals(200, response.getStatus());
+        response = managementClient.get(testConfigJvmOptionsUrl);
+        List<String> jvmOptions = getJvmOptions(response);
+        assertThat(jvmOptions, hasItems(option2Name, option2Name));
+        assertThat(jvmOptions, not(hasItems(option1Name + '=', option2Name + '=')));
+
+        response = managementClient.delete(testConfigJvmOptionsUrl, newOptions);
+        assertEquals(200, response.getStatus());
+        response = managementClient.get(testConfigJvmOptionsUrl);
+        jvmOptions = getJvmOptions(response);
+        assertThat(jvmOptions, allOf(not(hasItem(option1Name)), not(hasItem(option2Name))));
+    }
+
+    @Test
+    public void testIsolatedOptionsCreationOnNewConfig() {
+        final String optionName = "-Doption" + generateRandomString();
+        Map<String, String> newOptions = Map.of(optionName, "", "target", testConfigName);
+
+        // Test new config to make sure option is there
+        Response response = managementClient.post(testConfigJvmOptionsUrl, newOptions);
+        assertEquals(200, response.getStatus());
+        response = managementClient.get(testConfigJvmOptionsUrl);
+        List<String> jvmOptions = getJvmOptions(response);
+        assertThat(jvmOptions, hasItem(optionName));
+
+        // Test server-config to make sure the options are NOT there
+        response = managementClient.get(URL_SERVER_JVM_OPTIONS);
+        jvmOptions = getJvmOptions(response);
+        assertThat(jvmOptions, not(hasItem(optionName)));
+    }
+
+    @Test
+    public void testProfilerJvmOptions() {
+        final String profilerName = "profiler" + generateRandomString();
+        final String optionName = "-Doption" + generateRandomString();
+        Map<String, String> attrs = Map.of("name", profilerName, "target", testConfigName);
+        Map<String, String> newOptions = Map.of(optionName, "");
+        deleteProfiler(testConfigUrl + "/java-config/profiler/delete-profiler", testConfigName, false);
+
+        Response response = managementClient.post(testConfigUrl + "/java-config/create-profiler", attrs);
+        assertEquals(200, response.getStatus());
+
+        response = managementClient.post(testConfigUrl + "/java-config/profiler/jvm-options", newOptions);
+        assertEquals(200, response.getStatus());
+
+        response = managementClient.get(testConfigUrl + "/java-config/profiler/jvm-options");
+        List<String> jvmOptions = getJvmOptions(response);
+        assertThat(jvmOptions, hasItem(optionName));
+
+        deleteProfiler(testConfigUrl + "/java-config/profiler/delete-profiler", testConfigName, true);
+    }
+
+    @Test
+    public void testJvmOptionWithColon() {
+        final String optionName = "-XX:MaxPermSize";
+        final String optionValue = "152m";
+        Map<String, String> newOptions = Map.of(escape(optionName), optionValue);
+
+        Response response = managementClient.post(testConfigJvmOptionsUrl, newOptions);
+        assertEquals(200, response.getStatus());
+        response = managementClient.get(testConfigJvmOptionsUrl);
+        assertEquals(200, response.getStatus());
+        List<String> jvmOptions = getJvmOptions(response);
+        assertThat(jvmOptions, hasItem(optionName + '=' + optionValue));
+
+        response = managementClient.delete(testConfigJvmOptionsUrl, newOptions);
+        assertEquals(200, response.getStatus());
+        response = managementClient.get(testConfigJvmOptionsUrl);
+        jvmOptions = getJvmOptions(response);
+        assertThat(jvmOptions, not(hasItem(optionName + '=' + optionValue)));
+    }
+
+    private void deleteProfiler(final String url, final String target, final boolean failOnError) {
+        Response response = managementClient.delete(url, Map.of("target", target));
+        if (failOnError) {
+            assertEquals(200, response.getStatus());
+        }
+    }
+
+    private List<String> getJvmOptions(Response response) {
+        Map<String, ?> responseMap = MarshallingUtils.buildMapFromDocument(response.readEntity(String.class));
+        List<String> jvmOptions = (List<String>)((Map)responseMap.get("extraProperties")).get("leafList");
+        return jvmOptions;
+    }
+
+    private String escape(String part) {
+        String changed = part
+                .replace("\\", "\\\\")
+                .replace(":", "\\:");
+        return changed;
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/MetadataITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/MetadataITest.java
new file mode 100644
index 0000000..7109299
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/MetadataITest.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.rest;
+
+import jakarta.ws.rs.core.Response;
+
+import java.util.Map;
+
+import org.glassfish.admin.rest.client.utils.MarshallingUtils;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.stringContainsInOrder;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+/**
+ * @author jasonlee
+ */
+public class MetadataITest extends RestTestBase {
+    private static final String URL_CONFIG = "/domain/configs/config.json";
+    private static final String URL_UPTIMECOMMAND = "/domain/uptime.json";
+
+    @Test
+    public void configParameterTest() {
+        Response response = managementClient.options(URL_CONFIG);
+        assertEquals(200, response.getStatus());
+        // Really dumb test.  Should be good enough for now
+
+        Map extraProperties = MarshallingUtils.buildMapFromDocument(response.readEntity(String.class));
+        assertNotNull(extraProperties);
+
+        // Another dumb test to make sure that "name" shows up on the HTML page
+        response = managementClient.get(URL_CONFIG);
+        String data = response.readEntity(String.class);
+        assertThat(data, stringContainsInOrder("extraProperties"));
+    }
+
+    @Test
+    public void upTimeMetadaDataTest() {
+        Response response = managementClient.options(URL_UPTIMECOMMAND);
+        assertEquals(200, response.getStatus());
+
+        Map<String, ?> extraProperties = MarshallingUtils.buildMapFromDocument(response.readEntity(String.class));
+        assertNotNull(extraProperties);
+
+        // Another dumb test to make sure that "extraProperties" shows up on the HTML page
+        response = managementClient.get(URL_UPTIMECOMMAND);
+        String resp = response.readEntity(String.class);
+        assertThat(resp, stringContainsInOrder("extraProperties"));
+        // test to see if we get the milliseconds parameter description which is an
+        //optional param metadata for the uptime command
+        assertThat(resp, stringContainsInOrder("milliseconds"));
+        assertThat(resp, stringContainsInOrder("GET"));
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/MonitoringITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/MonitoringITest.java
new file mode 100644
index 0000000..8cd5b9a
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/MonitoringITest.java
@@ -0,0 +1,184 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.rest;
+
+
+import jakarta.ws.rs.core.Response;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.glassfish.main.admin.test.tool.DomainAdminRestClient;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestMethodOrder;
+
+import static org.hamcrest.CoreMatchers.anyOf;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.aMapWithSize;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+/**
+ * Note regards HTTP 200/202 - not sure why it is happening, but the server probably needs some time
+ * to propagate changes, while we request another.
+ *
+ * @author Mitesh Meswani
+ */
+@TestMethodOrder(OrderAnnotation.class)
+public class MonitoringITest extends RestTestBase {
+
+    private static final String MONITORING_RESOURCE_URL = "/domain/configs/config/server-config/monitoring-service/module-monitoring-levels";
+    private static final String JDBC_CONNECTION_POOL_URL = "/domain/resources/jdbc-connection-pool";
+    private static final String PING_CONNECTION_POOL_URL = "/domain/resources/ping-connection-pool";
+    private static final String POOL_NAME_W_DOT = "poolNameWith.dot";
+
+    private static DomainAdminRestClient monitoringClient;
+
+    @BeforeAll
+    public static void init() {
+        monitoringClient = new DomainAdminRestClient(getBaseAdminUrl() + "/monitoring");
+    }
+
+
+    @AfterAll
+    public static void closeResources() {
+        Response responseDel = managementClient.delete(JDBC_CONNECTION_POOL_URL + '/' + POOL_NAME_W_DOT);
+        assertThat(responseDel.getStatus(), anyOf(equalTo(200), equalTo(202), equalTo(404)));
+        if (monitoringClient != null) {
+            monitoringClient.close();
+        }
+    }
+
+
+    @Test
+    @Order(1)
+    public void enableMonitoring() {
+        Map<String, String> payLoad = new HashMap<>() {
+            {
+                put("ThreadPool", "HIGH");
+                put("Orb", "HIGH");
+                put("EjbContainer", "HIGH");
+                put("WebContainer", "HIGH");
+                put("Deployment", "HIGH");
+                put("TransactionService", "HIGH");
+                put("HttpService", "HIGH");
+                put("JdbcConnectionPool", "HIGH");
+                put("ConnectorConnectionPool", "HIGH");
+                put("ConnectorService", "HIGH");
+                put("JmsService", "HIGH");
+                put("Jvm", "HIGH");
+                put("Security", "HIGH");
+                put("WebServicesContainer", "HIGH");
+                put("Jpa", "HIGH");
+                put("Jersey", "HIGH");
+            }
+        };
+        Response response = managementClient.post(MONITORING_RESOURCE_URL, payLoad);
+        assertThat(response.getStatus(), anyOf(equalTo(200), equalTo(202)));
+    }
+
+    /**
+     * Objective - Verify that basic monitoring is working
+     * Strategy - Call /monitoring/domain and assert that "server" is present as child element
+     */
+    @Test
+    @Order(2)
+    public void testBaseURL() {
+        Response response = monitoringClient.get("/domain");
+        assertThat(response.getStatus(), anyOf(equalTo(200), equalTo(202)));
+        // monitoring/domain
+        Map<String, String> entity = getChildResources(response);
+        assertNotNull(entity.get("server"), entity.toString());
+    }
+
+    /**
+     * Objective - Verify that invalid resources returns 404
+     * Strategy - Request an invalid resource under monitoring and ensure that 404 is returned
+     */
+    @Test
+    @Order(10)
+    public void testInvalidResource() {
+        Response response = monitoringClient.get("/domain/server/foo");
+        assertEquals(404, response.getStatus(), "Did not receive ");
+    }
+
+    /**
+     * Objective - Verify that resources with dot work
+     * Strategy - create a resource with "." in name and then try to access it
+     */
+    @Test
+    @Order(20)
+    public void testDot() {
+        Response responseDel = managementClient.delete(JDBC_CONNECTION_POOL_URL + '/' + POOL_NAME_W_DOT);
+        assertThat(responseDel.getStatus(), equalTo(404));
+
+        Map<String, String> payLoad = new HashMap<>() {
+            {
+                put("name", POOL_NAME_W_DOT);
+                put("resType", "javax.sql.DataSource");
+                put("datasourceClassname", "foo.bar");
+            }
+        };
+        Response response = managementClient.post(JDBC_CONNECTION_POOL_URL, payLoad);
+        assertThat(response.getStatus(), anyOf(equalTo(200), equalTo(202)));
+
+        // Step 2- Ping the connection pool to generate some monitoring data
+        Response responsePing = managementClient.get(PING_CONNECTION_POOL_URL, Map.of("id", POOL_NAME_W_DOT));
+        // foo.bar is invalid ds class
+        assertThat(responsePing.toString(), responsePing.getStatus(), equalTo(500));
+
+        // Step 3 - Access monitoring tree to assert it is accessible
+        Response responsePool = monitoringClient.get("/domain/server/resources/" + POOL_NAME_W_DOT);
+        assertEquals(200, responsePool.getStatus());
+        Map<String, String> responseEntity = getEntityValues(responsePool);
+        assertThat("Monitoring data: \n" + responseEntity, responseEntity, aMapWithSize(14));
+    }
+
+
+    @Test
+    @Order(1000)
+    public void testCleanup() {
+        Map<String, String> payLoad = new HashMap<>() {
+            {
+                put("ThreadPool", "OFF");
+                put("Orb", "OFF");
+                put("EjbContainer", "OFF");
+                put("WebContainer", "OFF");
+                put("Deployment", "OFF");
+                put("TransactionService", "OFF");
+                put("HttpService", "OFF");
+                put("JdbcConnectionPool", "OFF");
+                put("ConnectorConnectionPool", "OFF");
+                put("ConnectorService", "OFF");
+                put("JmsService", "OFF");
+                put("Jvm", "OFF");
+                put("Security", "OFF");
+                put("WebServicesContainer", "OFF");
+                put("Jpa", "OFF");
+                put("Jersey", "OFF");
+            }
+        };
+        Response response = managementClient.post(MONITORING_RESOURCE_URL, payLoad);
+        assertThat(response.getStatus(), anyOf(equalTo(200), equalTo(202)));
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/NetworkListenerITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/NetworkListenerITest.java
new file mode 100644
index 0000000..3c315e4
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/NetworkListenerITest.java
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.rest;
+
+import jakarta.ws.rs.core.Response;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.codehaus.jettison.json.JSONObject;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.stringContainsInOrder;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * @author jasonlee
+ */
+public class NetworkListenerITest extends RestTestBase {
+    private static final String URL_PROTOCOL = "/domain/configs/config/server-config/network-config/protocols/protocol";
+    private static final String URL_SSL = "/domain/configs/config/server-config/network-config/protocols/protocol/http-listener-2/ssl";
+
+    private static final String redirectProtocolName = "http-redirect";
+    private static final String portUniProtocolName = "pu-protocol";
+
+    private static final String redirectFilterName = "redirect-filter";
+    private static final String finderName1 = "http-finder";
+    private static final String finderName2 = "http-redirect";
+
+    @AfterAll
+    public static void cleanup() {
+        Response response = managementClient.post(
+            "/domain/configs/config/server-config/network-config/network-listeners/network-listener/http-listener-1",
+            Map.of("protocol", "http-listener-1"));
+        assertEquals(200, response.getStatus());
+        response = managementClient.delete(URL_PROTOCOL + "/" + portUniProtocolName + "/delete-protocol-finder",
+            Map.of("protocol", portUniProtocolName, "id", finderName1));
+        assertEquals(200, response.getStatus());
+        response = managementClient.delete(URL_PROTOCOL + "/" + portUniProtocolName + "/delete-protocol-finder",
+            Map.of("protocol", portUniProtocolName, "id", finderName2));
+        assertEquals(200, response.getStatus());
+        response = managementClient.delete(
+            URL_PROTOCOL + "/" + redirectProtocolName
+                + "/protocol-chain-instance-handler/protocol-chain/protocol-filter/" + redirectFilterName,
+            Map.of("protocol", redirectProtocolName));
+        assertEquals(200, response.getStatus());
+        response = managementClient.delete(URL_PROTOCOL + "/" + portUniProtocolName);
+        assertEquals(200, response.getStatus());
+        response = managementClient.delete(URL_PROTOCOL + "/" + redirectProtocolName);
+        assertEquals(200, response.getStatus());
+    }
+
+
+    @Test
+    public void createHttpListener() {
+        Response response = managementClient.post("/domain/set", Map.of(
+            "configs.config.server-config.network-config.network-listeners.network-listener.http-listener-1.protocol",
+            "http-listener-1"));
+        assertEquals(200, response.getStatus());
+        managementClient.delete(URL_PROTOCOL + "/" + portUniProtocolName);
+        assertEquals(200, response.getStatus());
+        managementClient.delete(URL_PROTOCOL + "/" + redirectProtocolName);
+        assertEquals(200, response.getStatus());
+        // asadmin commands taken from: http://www.antwerkz.com/port-unification-in-glassfish-3-part-1/
+        //        asadmin create-protocol --securityenabled=false http-redirect
+        //        asadmin create-protocol --securityenabled=false pu-protocol
+        response = managementClient.post(URL_PROTOCOL, Map.of("securityenabled", "false", "id", redirectProtocolName));
+        assertEquals(200, response.getStatus());
+        response = managementClient.post(URL_PROTOCOL, Map.of("securityenabled", "false", "id", portUniProtocolName));
+        assertEquals(200, response.getStatus());
+
+        //        asadmin create-protocol-filter --protocol http-redirect --classname org.glassfish.grizzly.config.portunif.HttpRedirectFilter redirect-filter
+        response = managementClient.post(URL_PROTOCOL + "/" + redirectProtocolName + "/create-protocol-filter",
+            Map.of("id", redirectFilterName, "protocol", redirectProtocolName,
+                "classname", "org.glassfish.grizzly.config.portunif.HttpRedirectFilter"));
+        assertEquals(200, response.getStatus());
+
+        //        asadmin create-protocol-finder --protocol pu-protocol --targetprotocol http-listener-2 --classname org.glassfish.grizzly.config.portunif.HttpProtocolFinder http-finder
+        //        asadmin create-protocol-finder --protocol pu-protocol --targetprotocol http-redirect   --classname org.glassfish.grizzly.config.portunif.HttpProtocolFinder http-redirect
+        response = managementClient.post(URL_PROTOCOL + "/" + portUniProtocolName + "/create-protocol-finder",
+            new HashMap<String, String>() {{
+                put ("id", finderName1);
+                put ("protocol", portUniProtocolName);
+                put ("targetprotocol", "http-listener-2");
+                put ("classname", "org.glassfish.grizzly.config.portunif.HttpProtocolFinder");
+            }});
+        assertEquals(200, response.getStatus());
+        response = managementClient.post(URL_PROTOCOL + "/" + portUniProtocolName + "/create-protocol-finder",
+            new HashMap<String, String>() {{
+                put ("id", finderName2);
+                put ("protocol", portUniProtocolName);
+                put ("targetprotocol", redirectProtocolName);
+                put ("classname", "org.glassfish.grizzly.config.portunif.HttpProtocolFinder");
+            }});
+        assertEquals(200, response.getStatus());
+
+
+        //        asadmin set configs.config.server-config.network-config.network-listeners.network-listener.http-listener-1.protocol=pu-protocol
+        response = managementClient.post(
+            "/domain/configs/config/server-config/network-config/network-listeners/network-listener/http-listener-1",
+            Map.of("protocol", portUniProtocolName));
+        assertEquals(200, response.getStatus());
+
+        response = managementClient.get("/domain/configs/config/server-config/network-config/network-listeners/network-listener/http-listener-1/find-http-protocol");
+        assertThat(response.readEntity(String.class), stringContainsInOrder("http-listener-2"));
+    }
+
+    @Test
+    public void testClearingProperties() {
+        Map<String, String> params = new HashMap<>() {{
+            put("keyStore", "foo");
+            put("trustAlgorithm", "bar");
+            put("trustMaxCertLength", "15");
+            put("trustStore", "baz");
+        }};
+
+        Response response = managementClient.post(URL_SSL, params);
+        assertEquals(200, response.getStatus());
+        response = managementClient.get(URL_SSL, params);
+        Map<String, String> entity = this.getEntityValues(response);
+        assertEquals(params.get("keyStore"), entity.get("keyStore"));
+        assertEquals(params.get("trustAlgorithm"), entity.get("trustAlgorithm"));
+        assertEquals(params.get("trustMaxCertLength"), entity.get("trustMaxCertLength"));
+        assertEquals(params.get("trustStore"), entity.get("trustStore"));
+
+        params.put("keyStore", "");
+        params.put("trustAlgorithm", "");
+        params.put("trustStore", "");
+        response = managementClient.post(URL_SSL, params);
+        assertEquals(200, response.getStatus());
+        response = managementClient.get(URL_SSL, params);
+        entity = this.getEntityValues(response);
+        assertEquals(JSONObject.NULL, entity.get("keyStore"));
+        assertEquals(JSONObject.NULL, entity.get("trustAlgorithm"));
+        assertEquals(JSONObject.NULL, entity.get("trustStore"));
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/NoCLICommandResourceCreationITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/NoCLICommandResourceCreationITest.java
new file mode 100644
index 0000000..f831288
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/NoCLICommandResourceCreationITest.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.rest;
+
+import jakarta.ws.rs.client.Entity;
+import jakarta.ws.rs.core.Response;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.jupiter.api.Test;
+
+import static jakarta.ws.rs.core.MediaType.APPLICATION_XML;
+import static org.glassfish.admin.rest.client.utils.MarshallingUtils.getXmlForProperties;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * @author Mitesh Meswani
+ */
+public class NoCLICommandResourceCreationITest extends RestTestBase {
+    private static final String URL_SERVER_PROPERTY = "/domain/servers/server/server/property";
+
+
+    @Test
+    public void testPropertyCreation() {
+        final String propertyKey = "propertyName" + generateRandomString();
+        String propertyValue = generateRandomString();
+
+        //Create a property
+        Map<String, String> param = new HashMap<>();
+        param.put("name", propertyKey);
+        param.put("value", propertyValue);
+        Response response = managementClient.post(URL_SERVER_PROPERTY,
+            Entity.entity(getXmlForProperties(param), APPLICATION_XML));
+        assertEquals(200, response.getStatus());
+
+        //Verify the property got created
+        String propertyURL = URL_SERVER_PROPERTY + "/" + propertyKey;
+        response = managementClient.get(propertyURL);
+        assertEquals(200, response.getStatus());
+        Map<String, String> entity = getEntityValues(response);
+        assertEquals(propertyKey, entity.get("name"));
+        assertEquals(propertyValue, entity.get("value"));
+
+        // Verify property update
+        propertyValue = generateRandomString();
+        param.put("value", propertyValue);
+        response = managementClient.put(URL_SERVER_PROPERTY, Entity.entity(getXmlForProperties(param), APPLICATION_XML));
+        assertEquals(200, response.getStatus());
+        response = managementClient.get(propertyURL);
+        assertEquals(200, response.getStatus());
+        entity = getEntityValues(response);
+        assertEquals(propertyKey, entity.get("name"));
+        assertEquals(propertyValue, entity.get("value"));
+
+        //Clean up to leave domain.xml good for next run
+        response = managementClient.delete(propertyURL, new HashMap<String, String>());
+        assertEquals(200, response.getStatus());
+    }
+}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/PartialUpdateTest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/PartialUpdateITest.java
similarity index 70%
rename from nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/PartialUpdateTest.java
rename to appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/PartialUpdateITest.java
index f6f277f..7fab0c0 100644
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/PartialUpdateTest.java
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/PartialUpdateITest.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -14,29 +15,30 @@
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
  */
 
-package org.glassfish.nucleus.admin.rest;
+package org.glassfish.main.admin.test.rest;
 
-import java.util.HashMap;
+import jakarta.ws.rs.core.Response;
+
 import java.util.Map;
-import static org.testng.AssertJUnit.*;
-import org.testng.annotations.Test;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 /**
- *
  * @author jasonlee
  */
-public class PartialUpdateTest extends RestTestBase {
-    @Test(enabled=false)
-    // TODO: rework this to use something nucleus-friendly
+public class PartialUpdateITest extends RestTestBase {
+
+    @Test
     public void testPartialUpdate() {
-        final String endpoint = JdbcTest.BASE_JDBC_CONNECTION_POOL_URL + "/DerbyPool";
+        final String endpoint = URL_JDBC_CONNECTION_POOL + "/DerbyPool";
         final String newDesc = generateRandomString();
-        Map<String, String> origAttrs = getEntityValues(get(endpoint));
-        Map<String, String> newAttrs = new HashMap<String, String>() {{
-            put ("description", newDesc);
-        }};
-        post(endpoint, newAttrs);
-        Map<String, String> updatedAttrs = getEntityValues(get(endpoint));
+        Map<String, String> origAttrs = getEntityValues(managementClient.get(endpoint));
+        Map<String, String> newAttrs = Map.of("description", newDesc);
+        Response response = managementClient.post(endpoint, newAttrs);
+        assertEquals(200, response.getStatus());
+        Map<String, String> updatedAttrs = getEntityValues(managementClient.get(endpoint));
         assertEquals(newDesc, updatedAttrs.get("description"));
         assertEquals(origAttrs.get("driverClassname"), updatedAttrs.get("driverClassname"));
         assertEquals(origAttrs.get("resType"), updatedAttrs.get("resType"));
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/PropertiesBagTest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/PropertiesBagITest.java
similarity index 63%
rename from nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/PropertiesBagTest.java
rename to appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/PropertiesBagITest.java
index 1d6a001..fe476a6 100644
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/PropertiesBagTest.java
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/PropertiesBagITest.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -14,37 +15,46 @@
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
  */
 
-package org.glassfish.nucleus.admin.rest;
+package org.glassfish.main.admin.test.rest;
+
+import jakarta.ws.rs.client.Entity;
+import jakarta.ws.rs.core.Response;
 
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import jakarta.ws.rs.client.Entity;
-import jakarta.ws.rs.core.MediaType;
-import jakarta.ws.rs.core.Response;
+
 import org.codehaus.jettison.json.JSONArray;
 import org.glassfish.admin.rest.client.utils.MarshallingUtils;
-import static org.testng.AssertJUnit.*;
-import org.testng.annotations.Test;
+import org.junit.jupiter.api.Test;
+
+import static jakarta.ws.rs.core.MediaType.APPLICATION_JSON;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotSame;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 /**
- *
  * @author jasonlee
  */
-public class PropertiesBagTest extends RestTestBase {
+public class PropertiesBagITest extends RestTestBase {
 
-    protected static final String PROP_DOMAIN_NAME = "administrative.domain.name";
-    protected static final String URL_DOMAIN_PROPERTIES = "/domain/property";
-    protected static final String URL_JAVA_CONFIG_PROPERTIES = "/domain/configs/config/default-config/java-config/property";
-    protected static final String URL_SERVER_PROPERTIES = "/domain/servers/server/server/property";
-    protected static final String URL_DERBYPOOL_PROPERTIES = "/domain/resources/jdbc-connection-pool/DerbyPool/property";
-    private static final String REQUEST_FORMAT = MediaType.APPLICATION_JSON;
+    private static final String PROP_DOMAIN_NAME = "administrative.domain.name";
+    private static final String URL_DOMAIN_PROPERTIES = "/domain/property";
+    private static final String URL_JAVA_CONFIG_PROPERTIES = "/domain/configs/config/default-config/java-config/property";
+    private static final String URL_SERVER_PROPERTIES = "/domain/servers/server/server/property";
+    private static final String URL_DERBYPOOL_PROPERTIES = "/domain/resources/jdbc-connection-pool/DerbyPool/property";
 
     @Test
     public void propertyRetrieval() {
-        Response response = get(URL_DOMAIN_PROPERTIES);
-        checkStatusForSuccess(response);
+        Response response = managementClient.get(URL_DOMAIN_PROPERTIES);
+        assertEquals(200, response.getStatus());
         List<Map<String, String>> properties = getProperties(response);
         assertTrue(isPropertyFound(properties, PROP_DOMAIN_NAME));
     }
@@ -59,9 +69,9 @@
         createAndDeleteProperties(URL_SERVER_PROPERTIES);
     }
 
-    @Test(enabled=false)
+    @Test
     public void propsWithEmptyValues() {
-        List<Map<String, String>> properties = new ArrayList<Map<String, String>>();
+        List<Map<String, String>> properties = new ArrayList<>();
         final String empty = "empty" + generateRandomNumber();
         final String foo = "foo" + generateRandomNumber();
         final String bar = "bar" + generateRandomNumber();
@@ -71,7 +81,7 @@
         properties.add(createProperty(foo,"foovalue"));
         properties.add(createProperty(bar,"barvalue"));
         createProperties(URL_DERBYPOOL_PROPERTIES, properties);
-        List<Map<String, String>> newProperties = getProperties(get(URL_DERBYPOOL_PROPERTIES));
+        List<Map<String, String>> newProperties = getProperties(managementClient.get(URL_DERBYPOOL_PROPERTIES));
 
         assertFalse(isPropertyFound(newProperties, empty));
         assertTrue(isPropertyFound(newProperties, foo));
@@ -80,7 +90,7 @@
         properties.clear();
         properties.add(createProperty(abc,"abcvalue"));
         createProperties(URL_DERBYPOOL_PROPERTIES, properties);
-        newProperties = getProperties(get(URL_DERBYPOOL_PROPERTIES));
+        newProperties = getProperties(managementClient.get(URL_DERBYPOOL_PROPERTIES));
 
         assertTrue(isPropertyFound(newProperties, abc));
         assertFalse(isPropertyFound(newProperties, empty));
@@ -88,10 +98,10 @@
         assertFalse(isPropertyFound(newProperties, bar));
     }
 
-    @Test(enabled=false)
+    @Test
     public void testOptimizedPropertyHandling() {
         // First, test changing one property and adding a new
-        List<Map<String, String>> properties = new ArrayList<Map<String, String>>();
+        List<Map<String, String>> properties = new ArrayList<>();
         properties.add(createProperty("PortNumber","1527"));
         properties.add(createProperty("Password","APP"));
         properties.add(createProperty("User","APP"));
@@ -101,7 +111,7 @@
         properties.add(createProperty("foo","bar","test"));
         createProperties(URL_DERBYPOOL_PROPERTIES, properties);
 
-        List<Map<String, String>> newProperties = getProperties(get(URL_DERBYPOOL_PROPERTIES));
+        List<Map<String, String>> newProperties = getProperties(managementClient.get(URL_DERBYPOOL_PROPERTIES));
         for (Map<String, String> property : newProperties) {
             if (property.get("name").equals("connectionAttributes")) {
                 assertEquals(";create=false", property.get("value"));
@@ -116,7 +126,7 @@
         properties.add(createProperty("foo","bar 2","test 2"));
         createProperties(URL_DERBYPOOL_PROPERTIES, properties);
 
-        newProperties = getProperties(get(URL_DERBYPOOL_PROPERTIES));
+        newProperties = getProperties(managementClient.get(URL_DERBYPOOL_PROPERTIES));
         assertNotSame(1, newProperties);
         for (Map<String, String> property : newProperties) {
             if (property.get("name").equals("foo")) {
@@ -136,7 +146,7 @@
 
         createProperties(URL_DERBYPOOL_PROPERTIES, properties);
 
-        newProperties = getProperties(get(URL_DERBYPOOL_PROPERTIES));
+        newProperties = getProperties(managementClient.get(URL_DERBYPOOL_PROPERTIES));
         for (Map<String, String> property : newProperties) {
             if (property.get("name").equals("connectionAttributes")) {
                 assertEquals(";create=true", property.get("value"));
@@ -146,21 +156,20 @@
         }
     }
 
-    // the prop name can not contain .
-    // need to remove the . test when http://java.net/jira/browse/GLASSFISH-15418  is fixed
-//    @Test
+    @Test
     public void testPropertiesWithDots() {
-        List<Map<String, String>> properties = new ArrayList<Map<String, String>>();
-        final String prop = "some.property.with.dots." + generateRandomNumber();
+        List<Map<String, String>> properties = new ArrayList<>();
+        final String key = "some.property.with.dots." + generateRandomNumber();
         final String description = "This is the description";
         final String value = generateRandomString();
-        properties.add(createProperty(prop, value, description));
+        properties.add(createProperty(key, value, description));
         createProperties(URL_DERBYPOOL_PROPERTIES, properties);
-        List<Map<String, String>> newProperties = getProperties(get(URL_DERBYPOOL_PROPERTIES));
-        Map<String, String> newProp = getProperty(newProperties, prop);
-        assertTrue(newProp != null);
-        assertTrue(value.equals(newProp.get("value")));
-        assertTrue(description.equals(newProp.get("description")));
+
+        List<Map<String, String>> newProperties = getProperties(managementClient.get(URL_DERBYPOOL_PROPERTIES));
+        Map<String, String> newProp = getProperty(newProperties, key);
+        assertNotNull(newProp);
+        assertEquals(value, newProp.get("value"));
+        assertNull(newProp.get("description"), "Descriptions are not returned at this moment: " + newProp);
     }
 
     // This operation is taking a REALLY long time from the console, probably due
@@ -170,9 +179,9 @@
     // saved. This test will create the jmsra config with a set of properties,
     // then update only one the object's properties, which should be a very quick,
     // inexpensive operation.
-    @Test(enabled=false)
+    @Test
     public void testJmsRaCreateAndUpdate() {
-        List<Map<String, String>> props = new ArrayList<Map<String, String>>(){{
+        List<Map<String, String>> props = new ArrayList<>(){{
            add(createProperty("AddressListBehavior", "random"));
            add(createProperty("AddressListIterations", "3"));
            add(createProperty("AdminPassword", "admin"));
@@ -190,20 +199,20 @@
            add(createProperty("startRMIRegistry", "false"));
         }};
         final String propertyList = buildPropertyList(props);
-        Map<String, String> attrs = new HashMap<String, String>() {{
+        Map<String, String> attrs = new HashMap<>() {{
             put("objecttype","user");
             put("id","jmsra");
             put("threadPoolIds","thread-pool-1");
             put("property", propertyList);
         }};
 
-        final String URL = "/domain/resources/resource-adapter-config";
-        delete(URL+"/jmsra");
-        Response response = post(URL, attrs);
-        assertTrue(isSuccess(response));
+        final String url = "/domain/resources/resource-adapter-config";
+        managementClient.delete(url + "/jmsra");
+        Response response = managementClient.post(url, attrs);
+        assertEquals(200, response.getStatus());
 
         // Change one property value (AddressListIterations) and update the object
-        props = new ArrayList<Map<String, String>>(){{
+        props = new ArrayList<>(){{
            add(createProperty("AddressListBehavior", "random"));
            add(createProperty("AddressListIterations", "4"));
            add(createProperty("AdminPassword", "admin"));
@@ -220,13 +229,12 @@
            add(createProperty("doBind", "false"));
            add(createProperty("startRMIRegistry", "false"));
         }};
-        createProperties(URL+"/jmsra/property", props);
+        createProperties(url + "/jmsra/property", props);
 
-        delete(URL+"/jmsra");
+        managementClient.delete(url + "/jmsra");
     }
 
-    //Disable this test for now. The functionality this tests is not available in nucleus
-    //@Test
+    @Test
     public void test20810() {
         Map<String, String> payload = new HashMap<>();
         payload.put("persistenceScope","session");
@@ -238,21 +246,19 @@
         payload.put("ssoFailoverEnabled","false");
 
         final String wcaUri = "/domain/configs/config/default-config/availability-service/web-container-availability";
-        Response r = post(wcaUri, payload);
-        assertTrue(isSuccess(r));
+        Response response = managementClient.post(wcaUri, payload);
+        assertThat(response.getStatus(), equalTo(200));
 
-        assertTrue(isSuccess(get(wcaUri)));
+        assertThat(managementClient.get(wcaUri).getStatus(), equalTo(200));
 
-        r = getClient()
-                .target(getAddress("/domain/configs/config/default-config/availability-service/web-container-availability/property")).
-                request(getResponseType())
-                .post(Entity.json(new JSONArray()), Response.class);
-        assertTrue(isSuccess(r));
-
-        assertTrue(isSuccess(get(wcaUri)));
+        response = managementClient.post(
+            "/domain/configs/config/default-config/availability-service/web-container-availability/property",
+            Entity.json(new JSONArray()));
+        assertThat(response.getStatus(), equalTo(200));
+        assertThat(managementClient.get(wcaUri).getStatus(), equalTo(200));
     }
 
-    protected String buildPropertyList(List<Map<String, String>> props) {
+    private String buildPropertyList(List<Map<String, String>> props) {
         StringBuilder sb = new StringBuilder();
         String sep = "";
         for (Map<String, String> prop : props) {
@@ -263,81 +269,82 @@
         return sb.toString();
     }
 
-    protected void createAndDeleteProperties(String endpoint) {
-        Response response = get(endpoint);
-        checkStatusForSuccess(response);
+    private void createAndDeleteProperties(String endpoint) {
+        Response response = managementClient.get(endpoint);
+        assertEquals(200, response.getStatus());
         assertNotNull(getProperties(response));
 
-        List<Map<String, String>> properties = new ArrayList<Map<String, String>>();
+        List<Map<String, String>> properties = new ArrayList<>();
 
         for(int i = 0, max = generateRandomNumber(16); i < max; i++) {
             properties.add(createProperty("property_" + generateRandomString(), generateRandomString(), generateRandomString()));
         }
 
         createProperties(endpoint, properties);
-        response = delete(endpoint);
-        checkStatusForSuccess(response);
+        response = managementClient.delete(endpoint);
+        assertEquals(200, response.getStatus());
     }
 
-    protected Map<String, String> createProperty(final String name, final String value) {
+    private Map<String, String> createProperty(final String name, final String value) {
         return createProperty(name, value, null);
     }
 
-    protected Map<String, String> createProperty(final String name, final String value, final String description) {
-        return new HashMap<String, String>() {{
-                put ("name", name);
-                put ("value", value);
+    private Map<String, String> createProperty(final String name, final String value, final String description) {
+        return new HashMap<>() {
+            {
+                put("name", name);
+                put("value", value);
                 if (description != null) {
-                    put ("description", description);
+                    put("description", description);
                 }
-            }};
+            }
+        };
     }
 
-    protected void createProperties(String endpoint, List<Map<String, String>> properties) {
+    private void createProperties(String endpoint, List<Map<String, String>> properties) {
         final String payload = buildPayload(properties);
-        Response response = getClient().target(getAddress(endpoint))
-            .request(RESPONSE_TYPE)
-            .post(Entity.entity(payload, REQUEST_FORMAT), Response.class);
-        checkStatusForSuccess(response);
-        response = get(endpoint);
-        checkStatusForSuccess(response);
+
+        Response response = managementClient.post(endpoint, Entity.entity(payload, APPLICATION_JSON));
+        assertEquals(200, response.getStatus());
+        response = managementClient.get(endpoint);
+        assertEquals(200, response.getStatus());
 
         // Retrieve the properties and make sure they were created.
-//        List<Map<String, String>> newProperties = getProperties(response);
-//
-//        for (Map<String, String> property : properties) {
-//            assertTrue(isPropertyFound(newProperties, property.get("name")));
-//        }
-    }
-
-    // Restore and verify the default domain properties
-    protected void restoreDomainProperties() {
-        final HashMap<String, String> domainProps = new HashMap<String, String>() {{
-            put("name", PROP_DOMAIN_NAME);
-            put("value", "domain1");
-        }};
-        Response response = getClient().target(getAddress(URL_DOMAIN_PROPERTIES))
-                .request(RESPONSE_TYPE)
-                .put(Entity.entity(buildPayload(new ArrayList<Map<String, String>>() {{ add(domainProps); }}), REQUEST_FORMAT), Response.class);
-        checkStatusForSuccess(response);
-        response = get(URL_DOMAIN_PROPERTIES);
-        checkStatusForSuccess(response);
-        assertTrue(isPropertyFound(getProperties(response), PROP_DOMAIN_NAME));
-    }
-
-    protected String buildPayload(List<Map<String, String>> properties) {
-        if (RESPONSE_TYPE.equals(MediaType.APPLICATION_XML)) {
-            return MarshallingUtils.getXmlForProperties(properties);
-        } else {
-            return MarshallingUtils.getJsonForProperties(properties);
+        List<Map<String, String>> newProperties = getProperties(response);
+        for (Map<String, String> property : properties) {
+            String name = property.get("name");
+            String value = property.get("value");
+            if (value == null || value.isBlank()) {
+                assertFalse(isPropertyFound(newProperties, name));
+            } else {
+                assertTrue(isPropertyFound(newProperties, name));
+            }
         }
     }
 
-    protected boolean isPropertyFound(List<Map<String, String>> properties, String name) {
+    // Restore and verify the default domain properties
+    private void restoreDomainProperties() {
+        final HashMap<String, String> domainProps = new HashMap<>() {{
+            put("name", PROP_DOMAIN_NAME);
+            put("value", "domain1");
+        }};
+        Response response = managementClient.put(URL_DOMAIN_PROPERTIES,
+            Entity.entity(buildPayload(List.of(domainProps)), APPLICATION_JSON));
+        assertEquals(200, response.getStatus());
+        response = managementClient.get(URL_DOMAIN_PROPERTIES);
+        assertEquals(200, response.getStatus());
+        assertTrue(isPropertyFound(getProperties(response), PROP_DOMAIN_NAME));
+    }
+
+    private String buildPayload(List<Map<String, String>> properties) {
+        return MarshallingUtils.getJsonForProperties(properties);
+    }
+
+    private boolean isPropertyFound(List<Map<String, String>> properties, String name) {
         return getProperty(properties, name) != null;
     }
 
-    protected Map<String, String> getProperty(List<Map<String, String>> properties, String name) {
+    private Map<String, String> getProperty(List<Map<String, String>> properties, String name) {
         Map<String, String> retval = null;
         for (Map<String,String> property : properties) {
             if (name.equals(property.get("name"))) {
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/ProvidersITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/ProvidersITest.java
new file mode 100644
index 0000000..e911bcd
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/ProvidersITest.java
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.rest;
+
+import jakarta.ws.rs.core.Response;
+
+import org.glassfish.main.admin.test.tool.DomainAdminRestClient;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * @author jasonlee
+ */
+public class ProvidersITest extends RestTestBase {
+    private static final String URL_ACTION_REPORT_RESULT = "/domain/uptime";
+    private static final String URL_COMMAND_RESOURCE_GET_RESULT = "/domain/stop";
+    private static final String URL_GET_RESULT = "/domain";
+    private static final String URL_GET_RESULT_LIST = "/domain/servers/server";
+    private static final String URL_OPTIONS_RESULT = "/domain";
+    private static final String URL_STRING_LIST_RESULT = "/domain/configs/config/server-config/java-config/jvm-options";
+
+    private static DomainAdminRestClient monitoringClient;
+
+    @BeforeAll
+    public static void init() {
+        monitoringClient = new DomainAdminRestClient(getBaseAdminUrl() + "/monitoring/domain");
+    }
+
+
+    @AfterAll
+    public static void closeResources() {
+        if (monitoringClient != null) {
+            monitoringClient.close();
+        }
+    }
+
+    @Test
+    public void testActionReportResultHtmlProvider() {
+        Response response = managementClient.get(URL_ACTION_REPORT_RESULT + ".html");
+        assertEquals(200, response.getStatus());
+    }
+
+    @Test
+    public void testActionReportResultXmlProvider() {
+        Response response = managementClient.get(URL_ACTION_REPORT_RESULT + ".xml");
+        assertEquals(200, response.getStatus());
+    }
+
+    @Test
+    public void testActionReportResultJsonProvider() {
+        Response response = managementClient.get(URL_ACTION_REPORT_RESULT + ".json");
+        assertEquals(200, response.getStatus());
+    }
+
+    @Test
+    public void testCommandResourceGetResultHtmlProvider() {
+        Response response = managementClient.get(URL_COMMAND_RESOURCE_GET_RESULT + ".html");
+        assertEquals(200, response.getStatus());
+    }
+
+    @Test
+    public void testCommandResourceGetResultXmlProvider() {
+        Response response = managementClient.get(URL_COMMAND_RESOURCE_GET_RESULT + ".xml");
+        assertEquals(200, response.getStatus());
+    }
+
+    @Test
+    public void testCommandResourceGetResultJsonProvider() {
+        Response response = managementClient.get(URL_COMMAND_RESOURCE_GET_RESULT + ".json");
+        assertEquals(200, response.getStatus());
+    }
+
+    @Test
+    public void testGetResultHtmlProvider() {
+        Response response = managementClient.get(URL_GET_RESULT + ".html");
+        assertEquals(200, response.getStatus());
+    }
+
+    @Test
+    public void testGetResultXmlProvider() {
+        Response response = managementClient.get(URL_GET_RESULT + ".xml");
+        assertEquals(200, response.getStatus());
+    }
+
+    @Test
+    public void testGetResultJsonProvider() {
+        Response response = managementClient.get(URL_GET_RESULT + ".json");
+        assertEquals(200, response.getStatus());
+    }
+
+    @Test
+    public void testGetResultListHtmlProvider() {
+        Response response = managementClient.get(URL_GET_RESULT_LIST + ".html");
+        assertEquals(200, response.getStatus());
+    }
+
+    @Test
+    public void testGetResultListXmlProvider() {
+        Response response = managementClient.get(URL_GET_RESULT_LIST + ".xml");
+        assertEquals(200, response.getStatus());
+    }
+
+    @Test
+    public void testGetResultListJsonProvider() {
+        Response response = managementClient.get(URL_GET_RESULT_LIST + ".json");
+        assertEquals(200, response.getStatus());
+    }
+
+    @Test
+    public void testOptionsResultXmlProvider() {
+        Response response = managementClient.options(URL_OPTIONS_RESULT + ".xml");
+        assertEquals(200, response.getStatus());
+    }
+
+    @Test
+    public void testOptionsResultJsonProvider() {
+        Response response = managementClient.options(URL_OPTIONS_RESULT + ".json");
+        assertEquals(200, response.getStatus());
+    }
+
+    @Test
+    public void testStringListResultHtmlProvider() {
+        Response response = managementClient.get(URL_STRING_LIST_RESULT + ".html");
+        assertEquals(200, response.getStatus());
+    }
+
+    @Test
+    public void testStringListResultXmlProvider() {
+        Response response = managementClient.get(URL_STRING_LIST_RESULT + ".xml");
+        assertEquals(200, response.getStatus());
+    }
+
+    @Test
+    public void testStringListResultJsonProvider() {
+        Response response = managementClient.get(URL_STRING_LIST_RESULT + ".json");
+        assertEquals(200, response.getStatus());
+    }
+
+    @Test
+    public void testTreeNodeHtmlProvider() {
+        Response response = monitoringClient.get(".html");
+        assertEquals(200, response.getStatus());
+    }
+
+    @Test
+    public void testTreeNodeXmlProvider() {
+        Response response = monitoringClient.get(".xml");
+        assertEquals(200, response.getStatus());
+    }
+
+    @Test
+    public void testTreeNodeJsonProvider() {
+        Response response = monitoringClient.get(".json");
+        assertEquals(200, response.getStatus());
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/ResourceRefITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/ResourceRefITest.java
new file mode 100644
index 0000000..14c2d70
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/ResourceRefITest.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.rest;
+
+import jakarta.ws.rs.core.Response;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.glassfish.main.admin.test.tool.asadmin.Asadmin;
+import org.glassfish.main.admin.test.tool.asadmin.GlassFishTestEnvironment;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * @author jasonlee
+ */
+public class ResourceRefITest extends RestTestBase {
+    private static final String URL_CREATE_INSTANCE = "/domain/create-instance";
+    private static final String URL_JDBC_RESOURCE = "/domain/resources/jdbc-resource";
+    private static final String URL_RESOURCE_REF = "/domain/servers/server/server/resource-ref";
+
+    private final String instanceName = "instance_" + generateRandomString();
+    private final String jdbcResourceName = "jdbc_" + generateRandomString();
+
+    @AfterEach
+    public void cleanup() {
+        Asadmin asadmin = GlassFishTestEnvironment.getAsadmin();
+        asadmin.exec("delete-resource-ref", jdbcResourceName);
+        asadmin.exec("delete-jdbc-resource", jdbcResourceName);
+        asadmin.exec("delete-instance", instanceName);
+    }
+
+
+    @Test
+    public void testCreatingResourceRef() {
+        Map<String, String> newInstance = new HashMap<>() {{
+            put("id", instanceName);
+            put("node", "localhost-domain1");
+        }};
+        Map<String, String> jdbcResource = new HashMap<>() {{
+            put("id", jdbcResourceName);
+            put("connectionpoolid", "DerbyPool");
+            put("target", instanceName);
+        }};
+        Map<String, String> resourceRef = new HashMap<>() {{
+            put("id", jdbcResourceName);
+            put("target", "server");
+        }};
+
+        Response response = managementClient.post(URL_CREATE_INSTANCE, newInstance);
+        assertEquals(200, response.getStatus());
+
+        response = managementClient.post(URL_JDBC_RESOURCE, jdbcResource);
+        assertEquals(200, response.getStatus());
+
+        response = managementClient.post(URL_RESOURCE_REF, resourceRef);
+        assertEquals(200, response.getStatus());
+        response = managementClient.delete(
+            "/domain/servers/server/" + instanceName + "/resource-ref/" + jdbcResourceName,
+            Map.of("target", instanceName));
+        assertEquals(200, response.getStatus());
+        response = managementClient.get("/domain/servers/server/" + instanceName + "/resource-ref/" + jdbcResourceName);
+        assertEquals(404, response.getStatus());
+
+        response = managementClient.delete(URL_JDBC_RESOURCE + "/" + jdbcResourceName);
+        assertEquals(200, response.getStatus());
+        response = managementClient.get(URL_JDBC_RESOURCE + "/" + jdbcResourceName);
+        assertEquals(404, response.getStatus());
+
+        response = managementClient.delete("/domain/servers/server/" + instanceName + "/delete-instance");
+        assertEquals(200, response.getStatus());
+        response = managementClient.get("/domain/servers/server/" + instanceName);
+        assertEquals(404, response.getStatus());
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/RestTestBase.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/RestTestBase.java
new file mode 100644
index 0000000..fa5a84a
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/RestTestBase.java
@@ -0,0 +1,311 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.rest;
+
+import jakarta.ws.rs.client.Client;
+import jakarta.ws.rs.core.MultivaluedMap;
+import jakarta.ws.rs.core.Response;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.math.BigInteger;
+import java.security.SecureRandom;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.glassfish.admin.rest.client.utils.MarshallingUtils;
+import org.glassfish.main.admin.test.tool.DomainAdminRestClient;
+import org.glassfish.main.admin.test.webapp.HelloServlet;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.exporter.ZipExporter;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.TestInfo;
+
+import static jakarta.ws.rs.core.MediaType.TEXT_PLAIN;
+import static org.glassfish.main.admin.test.tool.asadmin.GlassFishTestEnvironment.getTargetDirectory;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class RestTestBase {
+
+    private static final Logger LOG = Logger.getLogger(RestTestBase.class.getName());
+
+    protected static final String CONTEXT_ROOT_MANAGEMENT = "/management";
+
+    protected static final String URL_CLUSTER = "/domain/clusters/cluster";
+    protected static final String URL_APPLICATION_DEPLOY = "/domain/applications/application";
+    protected static final String URL_CREATE_INSTANCE = "/domain/create-instance";
+    protected static final String URL_CONFIGS = "/domain/configs";
+    protected static final String URL_JDBC_RESOURCE = "/domain/resources/jdbc-resource";
+    protected static final String URL_JDBC_CONNECTION_POOL = "/domain/resources/jdbc-connection-pool";
+
+    private static String baseAdminUrl;
+    private static String baseInstanceUrl;
+    protected static DomainAdminRestClient managementClient;
+
+    private Client client;
+
+    @BeforeAll
+    public static void initialize() {
+        baseAdminUrl = "http://localhost:4848";
+        baseInstanceUrl = "http://localhost:8080";
+        managementClient = new DomainAdminRestClient(baseAdminUrl + CONTEXT_ROOT_MANAGEMENT);
+        Response response = managementClient.get("/domain/rotate-log");
+        assertThat(response.getStatus(), equalTo(200));
+    }
+
+    @AfterAll
+    public static void captureLogAndCloseClient(final TestInfo testInfo) throws Exception {
+        if (managementClient != null) {
+            managementClient.close();
+        }
+        try (DomainAdminRestClient client = new DomainAdminRestClient(baseAdminUrl + CONTEXT_ROOT_MANAGEMENT, TEXT_PLAIN)) {
+            Response response = client.get("/domain/view-log");
+            assertThat(response.getStatus(), equalTo(200));
+            File directory = new File(getTargetDirectory(), "surefire-reports");
+            directory.mkdirs();
+            File output = new File(directory, testInfo.getTestClass().get().getName() + "-server.log");
+            try (PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(output)))) {
+                out.write(response.readEntity(String.class));
+            }
+        }
+    }
+
+    @AfterEach
+    protected void closeClient() throws Exception {
+        if (client == null) {
+            return;
+        }
+        client.close();
+        client = null;
+    }
+
+    public void createAndVerifyConfig(String configName, MultivaluedMap<String, String> configData) {
+        Response response = managementClient.post(URL_CONFIGS + "/copy-config", configData);
+        assertThat(response.getStatus(), equalTo(200));
+
+        response = managementClient.get(URL_CONFIGS + "/config/" + configName);
+        assertThat(response.getStatus(), equalTo(200));
+    }
+
+    public void deleteAndVerifyConfig(String configName) {
+        Response response = managementClient.post(URL_CONFIGS + "/config/" + configName + "/delete-config");
+        assertThat(response.getStatus(), equalTo(200));
+
+        response = managementClient.get(URL_CONFIGS + "/config/" + configName);
+        assertThat(response.getStatus(), equalTo(404));
+    }
+
+    public String createCluster() {
+        final String clusterName = "cluster_" + generateRandomString();
+        createCluster(clusterName);
+        return clusterName;
+    }
+
+    public void createCluster(final String clusterName) {
+        Map<String, String> newCluster = Map.of("id", clusterName);
+        Response response = managementClient.post(URL_CLUSTER, newCluster);
+        assertThat(response.getStatus(), equalTo(200));
+    }
+
+    public void startCluster(String clusterName) {
+        Response response = managementClient.post(URL_CLUSTER + "/" + clusterName + "/start-cluster");
+        assertThat(response.getStatus(), equalTo(200));
+    }
+
+    public void stopCluster(String clusterName) {
+        Response response = managementClient.post(URL_CLUSTER + "/" + clusterName + "/stop-cluster");
+        assertThat(response.getStatus(), equalTo(200));
+    }
+
+    public void createClusterInstance(final String clusterName, final String instanceName) {
+        Response response = managementClient.post("/domain/create-instance",
+            Map.of("cluster", clusterName, "id", instanceName, "node", "localhost-domain1"));
+        assertThat(response.getStatus(), equalTo(200));
+    }
+
+    public void deleteCluster(String clusterName) {
+        Response response = managementClient.get(URL_CLUSTER + "/" + clusterName + "/list-instances");
+        Map<String, ?> body = MarshallingUtils.buildMapFromDocument(response.readEntity(String.class));
+        Map<String, ?> extraProperties = (Map<String, ?>) body.get("extraProperties");
+        if (extraProperties != null) {
+            List<Map<String, String>> instanceList = (List<Map<String, String>>) extraProperties.get("instanceList");
+            LOG.log(Level.INFO, "Found instances: {0}", instanceList);
+            if (instanceList != null && !instanceList.isEmpty()) {
+                for (Map<String, String> instance : instanceList) {
+                    String instanceName = instance.get("name");
+                    response = managementClient.post("/domain/servers/server/" + instanceName + "/stop-instance");
+                    assertThat(instanceName, response.getStatus(), equalTo(200));
+                    response = managementClient.delete("/domain/servers/server/" + instanceName + "/delete-instance");
+                    assertThat(instanceName, response.getStatus(), equalTo(200));
+                }
+            }
+        }
+        response = managementClient.delete(URL_CLUSTER + "/" + clusterName);
+        assertEquals(200, response.getStatus());
+        response = managementClient.get(URL_CLUSTER + "/" + clusterName);
+        assertEquals(404, response.getStatus());
+    }
+
+    public Map<String, String> deployApp(final File archive, final String contextRoot, final String name) {
+        Map<String, Object> app = Map.of(
+            "id", archive,
+            "contextroot", contextRoot,
+            "name", name
+        );
+        Response response = managementClient.postWithUpload(URL_APPLICATION_DEPLOY, app);
+        assertThat(response.getStatus(), equalTo(200));
+        return getEntityValues(managementClient.get(URL_APPLICATION_DEPLOY + "/" + app.get("name")));
+    }
+
+    public void addAppRef(final String applicationName, final String targetName){
+        Response response = managementClient.post("/domain/servers/server/" + targetName + "/application-ref",
+            Map.of("id", applicationName, "target", targetName));
+        assertThat(response.getStatus(), equalTo(200));
+    }
+
+    public Response undeployApp(String appName) {
+        Response response = managementClient.delete(URL_APPLICATION_DEPLOY + "/" + appName);
+        assertThat(response.getStatus(), equalTo(200));
+        return response;
+    }
+
+    protected static String generateRandomString() {
+        SecureRandom random = new SecureRandom();
+        return new BigInteger(130, random).toString(16);
+    }
+
+    protected static int generateRandomNumber() {
+        Random r = new Random();
+        return Math.abs(r.nextInt()) + 1;
+    }
+
+    protected int generateRandomNumber(int max) {
+        Random r = new Random();
+        return Math.abs(r.nextInt(max - 1)) + 1;
+    }
+
+    protected static String getBaseAdminUrl() {
+        return baseAdminUrl;
+    }
+
+    protected static String getBaseInstanceUrl() {
+        return baseInstanceUrl;
+    }
+
+
+    /**
+     * This method will parse the provided XML document and return a map of the attributes and values on the root
+     * element
+     *
+     * @param response
+     * @return
+     */
+    protected Map<String, String> getEntityValues(Response response) {
+        String xml = response.readEntity(String.class);
+        Map<String, Object> responseMap = MarshallingUtils.buildMapFromDocument(xml);
+        if (responseMap == null) {
+            return null;
+        }
+        Map<String, Object> obj = (Map<String, Object>) responseMap.get("extraProperties");
+        if (obj == null) {
+            return null;
+        }
+        return (Map<String, String>) obj.get("entity");
+    }
+
+    protected List<String> getCommandResults(Response response) {
+        String document = response.readEntity(String.class);
+        List<String> results = new ArrayList<>();
+        Map map = MarshallingUtils.buildMapFromDocument(document);
+        String message = (String) map.get("message");
+        if (message != null && !"".equals(message)) {
+            results.add(message);
+        }
+        Object children = map.get("children");
+        if (children instanceof List) {
+            for (Object child : (List) children) {
+                Map childMap = (Map) child;
+                message = (String) childMap.get("message");
+                if (message != null) {
+                    results.add(message);
+                }
+            }
+        }
+        return results;
+    }
+
+    protected Map<String, String> getChildResources(Response response) {
+        Map responseMap = MarshallingUtils.buildMapFromDocument(response.readEntity(String.class));
+        LOG.log(Level.INFO, "responseMap: \n{0}", responseMap);
+        Map<String, Map> extraProperties = (Map<String, Map>) responseMap.get("extraProperties");
+        if (extraProperties != null) {
+            return extraProperties.get("childResources");
+        }
+
+        return new HashMap<>();
+    }
+
+
+    protected List<Map<String, String>> getProperties(Response response) {
+        Map responseMap = MarshallingUtils.buildMapFromDocument(response.readEntity(String.class));
+        Map extraProperties = (Map) responseMap.get("extraProperties");
+        if (extraProperties != null) {
+            return (List<Map<String, String>>) extraProperties.get("properties");
+        }
+        return new ArrayList<>();
+    }
+
+
+    protected static File getEar(final String appName) {
+        final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class).addAsModule(getWar(appName), "simple.war");
+        LOG.info(ear.toString(true));
+        try {
+            File tempFile = File.createTempFile(appName, ".ear");
+            ear.as(ZipExporter.class).exportTo(tempFile, true);
+            return tempFile;
+        } catch (IOException e) {
+            throw new IllegalStateException("Deployment failed - cannot load the input archive!", e);
+        }
+    }
+
+    protected static File getWar(final String appName) {
+        final WebArchive war = ShrinkWrap.create(WebArchive.class).addPackage(HelloServlet.class.getPackage());
+        LOG.info(war.toString(true));
+        try {
+            File tempFile = File.createTempFile(appName, ".war");
+            war.as(ZipExporter.class).exportTo(tempFile, true);
+            return tempFile;
+        } catch (IOException e) {
+            throw new IllegalStateException("Deployment failed - cannot load the input archive!", e);
+        }
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/SystemPropertiesITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/SystemPropertiesITest.java
new file mode 100644
index 0000000..2211a03
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/SystemPropertiesITest.java
@@ -0,0 +1,234 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.rest;
+
+import jakarta.ws.rs.core.Response;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.jupiter.api.Test;
+
+import static org.glassfish.admin.rest.client.utils.MarshallingUtils.buildMapFromDocument;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+/**
+ * @author jasonlee
+ */
+public class SystemPropertiesITest extends RestTestBase {
+    public static final String URL_CONFIG_SYSTEM_PROPERTIES = "/domain/configs/config/%config%/system-properties";
+    public static final String URL_CLUSTER_SYSTEM_PROPERTIES = "/domain/clusters/cluster/%clusterName%/system-properties";
+    public static final String URL_INSTANCE_SYSTEM_PROPERTIES = "/domain/servers/server/%instanceName%/system-properties";
+    public static final String URL_DAS_SYSTEM_PROPERTIES = URL_INSTANCE_SYSTEM_PROPERTIES.replaceAll("%instanceName%", "server");
+    public static final String URL_CREATE_INSTANCE = "/domain/create-instance";
+    public static final String PROP_VALUE = "${com.sun.aas.instanceRoot}/foo";
+
+    @Test
+    public void getSystemProperties() {
+        Response response = managementClient.get(URL_DAS_SYSTEM_PROPERTIES);
+        assertEquals(200, response.getStatus());
+        List<Map<String, String>> systemProperties = getSystemProperties(
+            buildMapFromDocument(response.readEntity(String.class)));
+        assertNotNull(systemProperties);
+    }
+
+
+    @Test
+    public void createSystemProperties() {
+        final String prop1 = "property" + generateRandomString();
+        final String prop2 = "property" + generateRandomString();
+        Map<String, String> payload = new HashMap<>() {
+
+            {
+                put(prop1, "value1");
+                put(prop2, "value2");
+            }
+        };
+        Response response = managementClient.post(URL_DAS_SYSTEM_PROPERTIES, payload);
+        assertEquals(200, response.getStatus());
+        response = managementClient.get(URL_DAS_SYSTEM_PROPERTIES);
+        List<Map<String, String>> systemProperties = getSystemProperties(
+            buildMapFromDocument(response.readEntity(String.class)));
+        assertNotNull(systemProperties);
+
+        int testPropsFound = 0;
+        for (Map<String, String> systemProperty : systemProperties) {
+            String name = systemProperty.get("name");
+            if (prop1.equals(name) || prop2.equals(name)) {
+                testPropsFound++;
+            }
+        }
+
+        assertEquals(2, testPropsFound);
+
+        response = managementClient.delete(URL_DAS_SYSTEM_PROPERTIES+"/"+prop1);
+        assertEquals(200, response.getStatus());
+        response = managementClient.delete(URL_DAS_SYSTEM_PROPERTIES+"/"+prop2);
+        assertEquals(200, response.getStatus());
+    }
+
+    @Test
+    public void createPropertiesWithColons() {
+        final String prop1 = "property" + generateRandomString();
+        Map<String, String> payload = new HashMap<>() {{
+            put(prop1, "http://localhost:4848");
+        }};
+        Response response = managementClient.post(URL_DAS_SYSTEM_PROPERTIES, payload);
+        assertEquals(200, response.getStatus());
+        response = managementClient.get(URL_DAS_SYSTEM_PROPERTIES);
+        List<Map<String, String>> systemProperties = getSystemProperties(
+            buildMapFromDocument(response.readEntity(String.class)));
+        assertNotNull(systemProperties);
+
+        int testPropsFound = 0;
+        for (Map<String, String> systemProperty : systemProperties) {
+            String name = systemProperty.get("name");
+            if (prop1.equals(name)) {
+                testPropsFound++;
+            }
+        }
+
+        assertEquals(1, testPropsFound);
+
+        response = managementClient.delete(URL_DAS_SYSTEM_PROPERTIES + "/" + prop1);
+        assertEquals(200, response.getStatus());
+    }
+
+    @Test
+    public void testNotResolvingDasSystemProperties() {
+        final String prop1 = "property" + generateRandomString();
+        createAndTestConfigProperty(prop1, PROP_VALUE, "server-config");
+        createAndTestInstanceOverride(prop1, PROP_VALUE, PROP_VALUE+"-instace", "server");
+    }
+
+    @Test
+    public void testNotResolvingDasInstanceProperties() {
+        final String instanceName = "in" + generateRandomNumber();
+        final String propertyName = "property" + generateRandomString();
+
+        Response response = managementClient.post(URL_CREATE_INSTANCE, Map.of("id", instanceName, "node", "localhost-domain1"));
+        assertEquals(200, response.getStatus());
+
+        createAndTestConfigProperty(propertyName, PROP_VALUE, instanceName + "-config");
+        createAndTestInstanceOverride(propertyName, PROP_VALUE, PROP_VALUE + "-instance", instanceName);
+    }
+
+    @Test
+    public void testNotResolvingClusterProperties() {
+        final String propertyName = "property" + generateRandomString();
+        final String clusterName = "cluster_" + generateRandomNumber();
+        final String instanceName = clusterName + "_instance_" + generateRandomNumber();
+        createCluster(clusterName);
+        createClusterInstance(clusterName, instanceName);
+
+        createAndTestConfigProperty(propertyName, PROP_VALUE, clusterName + "-config");
+        createAndTestClusterOverride(propertyName, PROP_VALUE, PROP_VALUE + "-cluster", clusterName);
+        createAndTestInstanceOverride(propertyName, PROP_VALUE+"-cluster", PROP_VALUE + "-instance", instanceName);
+
+        deleteCluster(clusterName);
+    }
+
+    private void createAndTestConfigProperty(final String propertyName, final String propertyValue, String configName) {
+        final String url = URL_CONFIG_SYSTEM_PROPERTIES.replaceAll("%config%", configName);
+        Response response = managementClient.get(url);
+        Map<String, String> payload = getSystemPropertiesMap(getSystemProperties(buildMapFromDocument(response.readEntity(String.class))));
+        payload.put(propertyName, propertyValue);
+        response = managementClient.post(url, payload);
+        assertEquals(200, response.getStatus());
+
+        response = managementClient.get(url);
+        List<Map<String, String>> systemProperties = getSystemProperties(buildMapFromDocument(response.readEntity(String.class)));
+        Map<String, String> sysProp = getSystemProperty(propertyName, systemProperties);
+        assertNotNull(sysProp);
+        assertEquals(propertyValue, sysProp.get("value"));
+    }
+
+    private void createAndTestClusterOverride(final String propertyName, final String defaultValue, final String propertyValue, final String clusterName) {
+        final String clusterSysPropsUrl = URL_CLUSTER_SYSTEM_PROPERTIES.replaceAll("%clusterName%", clusterName);
+
+        Response response = managementClient.get(clusterSysPropsUrl);
+        List<Map<String, String>> systemProperties = getSystemProperties(buildMapFromDocument(response.readEntity(String.class)));
+        Map<String, String> sysProp = getSystemProperty(propertyName, systemProperties);
+        assertNotNull(sysProp);
+        assertEquals(sysProp.get("defaultValue"), defaultValue);
+
+        response = managementClient.post(clusterSysPropsUrl, Map.of(propertyName, propertyValue));
+        assertEquals(200, response.getStatus());
+
+        // Check updated/overriden system property
+        response = managementClient.get(clusterSysPropsUrl);
+        systemProperties = getSystemProperties(buildMapFromDocument(response.readEntity(String.class)));
+        sysProp = getSystemProperty(propertyName, systemProperties);
+        assertNotNull(sysProp);
+        assertEquals(sysProp.get("value"), propertyValue);
+        assertEquals(sysProp.get("defaultValue"), defaultValue);
+    }
+
+    private void createAndTestInstanceOverride(final String propertyName, final String defaultValue, final String propertyValue, final String instanceName) {
+        final String instanceSysPropsUrl = URL_INSTANCE_SYSTEM_PROPERTIES.replaceAll("%instanceName%", instanceName);
+
+        Response response = managementClient.get(instanceSysPropsUrl);
+        List<Map<String, String>> systemProperties = getSystemProperties(buildMapFromDocument(response.readEntity(String.class)));
+        Map<String, String> sysProp = getSystemProperty(propertyName, systemProperties);
+        assertNotNull(sysProp);
+        assertEquals(sysProp.get("defaultValue"), defaultValue);
+
+        response = managementClient.post(instanceSysPropsUrl, Map.of(propertyName, propertyValue));
+        assertEquals(200, response.getStatus());
+
+        // Check updated/overriden system property
+        response = managementClient.get(instanceSysPropsUrl);
+        systemProperties = getSystemProperties(buildMapFromDocument(response.readEntity(String.class)));
+        sysProp = getSystemProperty(propertyName, systemProperties);
+        assertNotNull(sysProp);
+        assertEquals(propertyValue, sysProp.get("value"));
+        assertEquals(defaultValue, sysProp.get("defaultValue"));
+    }
+
+    private List<Map<String, String>> getSystemProperties(Map<String, ?> map) {
+        Map<String, Object> extraProperties = (Map<String, Object>) map.get("extraProperties");
+        if (extraProperties == null) {
+            return null;
+        }
+        return (List<Map<String, String>>) extraProperties.get("systemProperties");
+    }
+
+    private Map<String, String> getSystemProperty(String propName, List<Map<String, String>> systemProperties) {
+        for (Map<String, String> sysProp : systemProperties) {
+            if (sysProp.get("name").equals(propName)) {
+                return sysProp;
+            }
+        }
+
+        return null;
+    }
+
+    private Map<String, String> getSystemPropertiesMap (List<Map<String, String>> propsList) {
+        if (propsList == null) {
+            return new HashMap<>();
+        }
+        Map<String, String> allPropsMap = new HashMap<>();
+        for (Map<String, String> sysProp : propsList) {
+            allPropsMap.put(sysProp.get("name"),  sysProp.get("value"));
+        }
+        return allPropsMap;
+    }
+
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/TokenAuthenticationITest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/TokenAuthenticationITest.java
new file mode 100644
index 0000000..13bd63f
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/TokenAuthenticationITest.java
@@ -0,0 +1,172 @@
+/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
+ * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.rest;
+
+import jakarta.ws.rs.core.Cookie;
+import jakarta.ws.rs.core.Response;
+
+import java.util.Map;
+
+import org.glassfish.admin.rest.client.ClientWrapper;
+import org.glassfish.admin.rest.client.utils.MarshallingUtils;
+import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
+import org.glassfish.main.admin.test.tool.DomainAdminRestClient;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Test;
+
+import static jakarta.ws.rs.core.MediaType.APPLICATION_JSON;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+/**
+ * @author Mitesh Meswani
+ */
+public class TokenAuthenticationITest extends RestTestBase {
+    private static final String URL_DOMAIN_SESSIONS = "/sessions";
+    private static final String URL_CREATE_USER = "/domain/configs/config/server-config/security-service/auth-realm/admin-realm/create-user";
+    private static final String URL_DELETE_USER = "/domain/configs/config/server-config/security-service/auth-realm/admin-realm/delete-user";
+    private static final String GF_REST_TOKEN_COOKIE_NAME = "gfresttoken";
+
+    private static final String AUTH_USER_NAME = "dummyuser";
+    private static final String AUTH_PASSWORD = "dummypass";
+    private static final HttpAuthenticationFeature AUTH_DUMMY = HttpAuthenticationFeature.basic(AUTH_USER_NAME, AUTH_PASSWORD);
+
+    @AfterAll
+    public static void cleanup() {
+        managementClient.delete(URL_DELETE_USER, Map.of("id", AUTH_USER_NAME));
+    }
+
+
+    @Test
+    public void testTokenCreateAndDelete() {
+        String token = getSessionToken(managementClient);
+        assertNotNull(token, "token");
+
+        // Verify we can use the session token.
+        Response response = managementClient.getRequestBuilder("/domain")
+            .cookie(new Cookie(GF_REST_TOKEN_COOKIE_NAME, token)).get(Response.class);
+        assertEquals(200, response.getStatus());
+
+        // Delete the token
+        response = managementClient.getRequestBuilder(URL_DOMAIN_SESSIONS + "/" + token)
+            .cookie(new Cookie(GF_REST_TOKEN_COOKIE_NAME, token)).delete(Response.class);
+        managementClient.delete(URL_DOMAIN_SESSIONS);
+        assertEquals(200, response.getStatus());
+    }
+
+
+    @Test
+    public void testAuthRequired() {
+        Response delResponse = managementClient.delete(URL_DELETE_USER, Map.of("id", AUTH_USER_NAME));
+        // as of gf6 any error means 500. The user doesn't exist.
+        assertEquals(500, delResponse.getStatus());
+
+        try (DummyClient client = new DummyClient()) {
+            Response response = client.get("/domain");
+            assertEquals(401, response.getStatus());
+        }
+        {
+            // Create the new user
+            Map<String, String> newUser = Map.of(
+                "id", AUTH_USER_NAME,
+                "groups", "asadmin",
+                "authrealmname", "admin-realm",
+                "AS_ADMIN_USERPASSWORD", AUTH_PASSWORD
+                );
+            Response createUserResponse = managementClient.post(URL_CREATE_USER, newUser);
+            assertEquals(200, createUserResponse.getStatus());
+        }
+        try (AnonymousClient client = new AnonymousClient()) {
+            Response response = client.getRequestBuilder("/domain").get(Response.class);
+            assertEquals(401, response.getStatus());
+        }
+        final String token;
+        try (DummyClient dummyClient = new DummyClient()) {
+            token = getSessionToken(dummyClient);
+        }
+
+        try (CookieClient cookieClient = new CookieClient(token)) {
+            Response response = cookieClient.get("/domain");
+            assertEquals(200, response.getStatus());
+        }
+        try (AnonymousClient client = new AnonymousClient()) {
+            Response response = client.getRequestBuilder("/domain").get(Response.class);
+            assertEquals(401, response.getStatus());
+        }
+        try (CookieClient cookieClient = new CookieClient(token)) {
+            Response response = cookieClient.delete(URL_DELETE_USER, Map.of("id", AUTH_USER_NAME));
+            assertEquals(200, response.getStatus());
+        }
+    }
+
+
+    private String getSessionToken(DomainAdminRestClient client) {
+        Response response = client.post(URL_DOMAIN_SESSIONS);
+        assertEquals(200, response.getStatus());
+        Map<String, ?> responseMap = MarshallingUtils.buildMapFromDocument(response.readEntity(String.class));
+        Map<String, Object> extraProperties = (Map<String, Object>) responseMap.get("extraProperties");
+        return (String) extraProperties.get("token");
+    }
+
+
+    private static final class AnonymousClient extends DomainAdminRestClient {
+
+        public AnonymousClient() {
+            super(new ClientWrapper(), managementClient.getBaseUrl(), APPLICATION_JSON);
+        }
+    }
+
+
+    private static final class DummyClient extends DomainAdminRestClient {
+
+        public DummyClient() {
+            super(createClient(), managementClient.getBaseUrl(), APPLICATION_JSON);
+        }
+
+        private static ClientWrapper createClient() {
+            ClientWrapper client = new ClientWrapper();
+            client.register(AUTH_DUMMY);
+            return client;
+        }
+    }
+
+
+    private static final class CookieClient extends DomainAdminRestClient {
+
+        private final String securityCookie;
+
+        public CookieClient(final String securityCookie) {
+            super(new ClientWrapper(), managementClient.getBaseUrl(), APPLICATION_JSON);
+            this.securityCookie = securityCookie;
+        }
+
+        @Override
+        public Response delete(final String relativePath, final Map<String, String> queryParams) {
+            return getTarget(relativePath, queryParams).request()
+                .cookie(new Cookie(GF_REST_TOKEN_COOKIE_NAME, securityCookie)).delete(Response.class);
+        }
+
+
+        @Override
+        public Response get(final String relativePath, final Map<String, String> queryParams) {
+            return getTarget(relativePath, queryParams).request()
+                .cookie(new Cookie(GF_REST_TOKEN_COOKIE_NAME, securityCookie)).get(Response.class);
+        }
+
+    }
+}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/ZeroConfigTest.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/ZeroConfigITest.java
similarity index 74%
rename from nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/ZeroConfigTest.java
rename to appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/ZeroConfigITest.java
index 6380a08..103ebda 100644
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/ZeroConfigTest.java
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/rest/ZeroConfigITest.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -14,12 +15,16 @@
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
  */
 
-package org.glassfish.nucleus.admin.rest;
+package org.glassfish.main.admin.test.rest;
+
+import jakarta.ws.rs.core.Response;
 
 import java.util.Map;
-import jakarta.ws.rs.core.Response;
-import static org.testng.AssertJUnit.*;
-import org.testng.annotations.Test;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 /**
  * This class will test that the zero-config effort is handled correctly by the
@@ -31,17 +36,18 @@
  * data.
  * @author jdlee
  */
-public class ZeroConfigTest extends RestTestBase {
+public class ZeroConfigITest extends RestTestBase {
     public static final String BASE_SERVER_CONFIG_URL = "/domain/configs/config/server-config";
+
     /**
      * Currently (6/29/2012), the transaction-service element is missing from
-     * server-config out of the box.  This should continue to be the case once
+     * server-config stdOut of the box.  This should continue to be the case once
      * zero-config is fully implemented and integrated.
      */
-    @Test(enabled=false)
+    @Test
     public void testTransactionService() {
-        final Response response = get(BASE_SERVER_CONFIG_URL + "/transaction-service");
-        assertTrue(isSuccess(response));
+        final Response response = managementClient.get(BASE_SERVER_CONFIG_URL + "/transaction-service");
+        assertEquals(200, response.getStatus());
         Map<String, String> entity = getEntityValues(response);
         assertNotNull(entity);
     }
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/tool/AsadminResultMatcher.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/tool/AsadminResultMatcher.java
new file mode 100644
index 0000000..5e7ef0d
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/tool/AsadminResultMatcher.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2022 Eclipse Foundation and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.tool;
+
+import org.glassfish.main.admin.test.tool.asadmin.Asadmin;
+import org.glassfish.main.admin.test.tool.asadmin.AsadminResult;
+import org.hamcrest.CustomTypeSafeMatcher;
+
+
+/**
+ * Matcher checking that {@link Asadmin} command succeeded. Prints it's output otherwise.
+ *
+ * @author David Matejcek
+ */
+public class AsadminResultMatcher extends CustomTypeSafeMatcher<AsadminResult> {
+
+    private AsadminResultMatcher() {
+        super("asadmin succeeded");
+    }
+
+
+    @Override
+    protected boolean matchesSafely(AsadminResult item) {
+        return !item.isError();
+    }
+
+
+    /**
+     * @return matcher checking that {@link Asadmin} command succeeded. Prints it's output otherwise.
+     */
+    public static AsadminResultMatcher asadminOK() {
+        return new AsadminResultMatcher();
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/tool/DomainAdminRestClient.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/tool/DomainAdminRestClient.java
new file mode 100644
index 0000000..280b000
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/tool/DomainAdminRestClient.java
@@ -0,0 +1,168 @@
+/*
+ * Copyright (c) 2022 Eclipse Foundation and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.tool;
+
+import jakarta.ws.rs.client.Entity;
+import jakarta.ws.rs.client.Invocation.Builder;
+import jakarta.ws.rs.client.WebTarget;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.MultivaluedHashMap;
+import jakarta.ws.rs.core.MultivaluedMap;
+import jakarta.ws.rs.core.Response;
+
+import java.io.Closeable;
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.glassfish.admin.rest.client.ClientWrapper;
+import org.glassfish.jersey.media.multipart.FormDataMultiPart;
+import org.glassfish.jersey.media.multipart.file.FileDataBodyPart;
+import org.glassfish.main.admin.test.tool.asadmin.GlassFishTestEnvironment;
+
+import static jakarta.ws.rs.core.MediaType.APPLICATION_FORM_URLENCODED;
+
+/**
+ * @author David Matejcek
+ */
+public class DomainAdminRestClient implements Closeable {
+
+    private final ClientWrapper client;
+    private final String baseUrl;
+    private final String responseType;
+
+    public DomainAdminRestClient(final String baseUrl) {
+        this(baseUrl, MediaType.APPLICATION_JSON);
+    }
+
+
+    public DomainAdminRestClient(final String baseUrl, final String responseType) {
+        this(GlassFishTestEnvironment.createClient(), baseUrl, responseType);
+    }
+
+
+    public DomainAdminRestClient(final ClientWrapper client, final String baseUrl, final String responseType) {
+        this.client = client;
+        this.baseUrl = baseUrl;
+        this.responseType = responseType;
+    }
+
+
+    /**
+     * @return http://localhost:4848/management or something else, see constructor.
+     */
+    public final String getBaseUrl() {
+        return baseUrl;
+    }
+
+
+    public Response options(final String relativePath) {
+        return getRequestBuilder(relativePath).options(Response.class);
+    }
+
+
+    public Response get(final String relativePath) {
+        return get(relativePath, new HashMap<String, String>());
+    }
+
+
+    public Response get(final String relativePath, final Map<String, String> queryParams) {
+        final WebTarget target = getTarget(relativePath, queryParams);
+        return target.request(responseType).get(Response.class);
+    }
+
+    public <T> Response put(final String relativePath, final Entity<T> entityPayload) {
+        return getRequestBuilder(relativePath).put(entityPayload, Response.class);
+    }
+
+
+    public Response post(final String relativePath) {
+        return getRequestBuilder(relativePath).post(Entity.entity(null, APPLICATION_FORM_URLENCODED), Response.class);
+    }
+
+
+    public Response post(final String relativePath, final Map<String, String> payload) {
+        return post(relativePath, buildMultivaluedMap(payload));
+    }
+
+
+    public Response post(final String relativePath, final MultivaluedMap<String, String> payload) {
+        return getRequestBuilder(relativePath).post(Entity.entity(payload, APPLICATION_FORM_URLENCODED), Response.class);
+    }
+
+
+    public <T> Response post(final String relativePath, final Entity<T> entityPayload) {
+        return getRequestBuilder(relativePath).post(entityPayload, Response.class);
+    }
+
+    public Response postWithUpload(final String relativePath, final Map<String, Object> payload) {
+        final FormDataMultiPart form = new FormDataMultiPart();
+        for (final Map.Entry<String, Object> entry : payload.entrySet()) {
+            if (entry.getValue() instanceof File) {
+                form.getBodyParts().add((new FileDataBodyPart(entry.getKey(), (File) entry.getValue())));
+            } else {
+                form.field(entry.getKey(), entry.getValue(), MediaType.TEXT_PLAIN_TYPE);
+            }
+        }
+        return getRequestBuilder(relativePath).post(Entity.entity(form, MediaType.MULTIPART_FORM_DATA), Response.class);
+    }
+
+
+    public Response delete(final String relativePath) {
+        return delete(relativePath, new HashMap<String, String>());
+    }
+
+    public Response delete(final String relativePath, final Map<String, String> queryParams) {
+        final WebTarget target = getTarget(relativePath, queryParams);
+        return target.request(responseType).delete(Response.class);
+    }
+
+
+    public Builder getRequestBuilder(final String relativePath) {
+        return getTarget(relativePath, null).request(responseType);
+    }
+
+
+    public WebTarget getTarget(final String relativePath, final Map<String, String> queryParams) {
+        WebTarget target = client.target(baseUrl + relativePath);
+        if (queryParams == null) {
+            return target;
+        }
+        for (final Map.Entry<String, String> entry : queryParams.entrySet()) {
+            target = target.queryParam(entry.getKey(), entry.getValue());
+        }
+        return target;
+    }
+
+
+    @Override
+    public void close() {
+        client.close();
+    }
+
+
+    private MultivaluedMap<String, String> buildMultivaluedMap(final Map<String, String> payload) {
+        final MultivaluedMap<String, String> formData = new MultivaluedHashMap<>();
+        if (payload != null) {
+            for (final Entry<String, String> entry : payload.entrySet()) {
+                formData.add(entry.getKey(), entry.getValue());
+            }
+        }
+        return formData;
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/tool/asadmin/Asadmin.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/tool/asadmin/Asadmin.java
new file mode 100644
index 0000000..b18ca6d
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/tool/asadmin/Asadmin.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright (c) 2022 Eclipse Foundation and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.tool.asadmin;
+
+import com.sun.enterprise.universal.process.ProcessManager;
+import com.sun.enterprise.universal.process.ProcessManagerException;
+import com.sun.enterprise.universal.process.ProcessManagerTimeoutException;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Objects;
+import java.util.function.Function;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.stream.Collectors;
+
+import static java.util.Arrays.asList;
+import static org.glassfish.main.admin.test.tool.AsadminResultMatcher.asadminOK;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Tool for executing asadmin/asadmin.bat commands.
+ * The tool is stateless.
+ *
+ * @author David Matejcek
+ */
+public class Asadmin {
+    private static final Logger LOG = Logger.getLogger(Asadmin.class.getName());
+
+    private static final int DEFAULT_TIMEOUT_MSEC = 30 * 1000;
+    private static final Function<String, KeyAndValue<String>> KEYVAL_SPLITTER = s -> {
+        int equalSignPos = s.indexOf('=');
+        if (equalSignPos <= 0 || equalSignPos == s.length() - 1) {
+            return null;
+        }
+        return new KeyAndValue<>(s.substring(0, equalSignPos), s.substring(equalSignPos + 1, s.length()));
+    };
+
+    private final File asadmin;
+    private final String adminUser;
+    private final File adminPasswordFile;
+
+
+    /**
+     * Creates a stateless instance of the tool.
+     *
+     * @param asadmin - executable file
+     * @param adminUser - username authorized to use the domain
+     * @param adminPasswordFile - a file containing admin's password set as <code>AS_ADMIN_PASSWORD=...</code>
+     */
+    public Asadmin(final File asadmin, final String adminUser, final File adminPasswordFile) {
+        this.asadmin = asadmin;
+        this.adminUser = adminUser;
+        this.adminPasswordFile = adminPasswordFile;
+    }
+
+
+    /**
+     * @return asadmin command file name
+     */
+    public String getCommandName() {
+        return asadmin.getName();
+    }
+
+
+    public <T> KeyAndValue<T> getValue(final String key, final Function<String, T> transformer) {
+        List<KeyAndValue<T>> result = get(key, transformer);
+        if (result.isEmpty()) {
+            return null;
+        }
+        if (result.size() > 1) {
+            throw new IllegalArgumentException("The key is not concrete enough to get a single value: " + key);
+        }
+        return result.get(0);
+    }
+
+
+    public <T> List<KeyAndValue<T>> get(final String key, final Function<String, T> transformer) {
+        AsadminResult result = exec("get", key);
+        assertThat(result, asadminOK());
+        return Arrays.stream(result.getStdOut().split(System.lineSeparator())).map(KEYVAL_SPLITTER)
+            .filter(Objects::nonNull).map(kv -> new KeyAndValue<>(kv.getKey(), transformer.apply(kv.getValue())))
+            .collect(Collectors.toList());
+    }
+
+
+    /**
+     * Executes the command with arguments asynchronously with {@value #DEFAULT_TIMEOUT_MSEC} ms timeout.
+     * The command can be attached by the attach command.
+     * You should find the job id in the {@link AsadminResult#getStdOut()} as <code>Job ID: [0-9]+</code>
+     *
+     * @param args
+     * @return {@link AsadminResult} never null.
+     */
+    public DetachedTerseAsadminResult execDetached(final String... args) {
+        return (DetachedTerseAsadminResult) exec(DEFAULT_TIMEOUT_MSEC, true, args);
+    }
+
+    /**
+     * Executes the command with arguments synchronously with {@value #DEFAULT_TIMEOUT_MSEC} ms timeout.
+     *
+     * @param args
+     * @return {@link AsadminResult} never null.
+     */
+    public AsadminResult exec(final String... args) {
+        return exec(DEFAULT_TIMEOUT_MSEC, false, args);
+    }
+    /**
+     * Executes the command with arguments synchronously with given timeout in millis.
+     *
+     * @param timeout
+     * @param args
+     * @return {@link AsadminResult} never null.
+     */
+    public AsadminResult exec(final int timeout, final String... args) {
+        return exec(timeout, false, args);
+    }
+
+    /**
+     * Executes the command with arguments.
+     *
+     * @param timeout timeout in millis
+     * @param detachedAndTerse - detached command is executed asynchronously, can be attached later by the attach command.
+     * @param args - command and arguments.
+     * @return {@link AsadminResult} never null.
+     */
+    private AsadminResult exec(final int timeout, final boolean detachedAndTerse, final String... args) {
+        final List<String> parameters = asList(args);
+        LOG.log(Level.INFO, "exec(timeout={0}, detached={1}, args={2})",
+            new Object[] {timeout, detachedAndTerse, parameters});
+        final List<String> command = new ArrayList<>();
+        command.add(asadmin.getAbsolutePath());
+        command.add("--user");
+        command.add(adminUser);
+        command.add("--passwordfile");
+        command.add(adminPasswordFile.getAbsolutePath());
+        if (detachedAndTerse) {
+            command.add("--terse");
+            command.add("--detach");
+        }
+        command.addAll(parameters);
+
+        final ProcessManager processManager = new ProcessManager(command);
+        processManager.setTimeoutMsec(timeout);
+        processManager.setEcho(false);
+
+        int exitCode;
+        String asadminErrorMessage = "";
+        try {
+            exitCode = processManager.execute();
+        } catch (final ProcessManagerTimeoutException e) {
+            asadminErrorMessage = "ProcessManagerTimeoutException: command timed out after " + timeout + " ms.\n";
+            exitCode = 1;
+        } catch (final ProcessManagerException e) {
+            LOG.log(Level.SEVERE, "The execution failed.", e);
+            asadminErrorMessage = e.getMessage();
+            exitCode = 1;
+        }
+
+        final String stdErr = processManager.getStderr() + '\n' + asadminErrorMessage;
+        final AsadminResult result;
+        if (detachedAndTerse) {
+            result = new DetachedTerseAsadminResult(args[0], exitCode, processManager.getStdout(), stdErr);
+        } else {
+            result = new AsadminResult(args[0], exitCode, processManager.getStdout(), stdErr);
+        }
+        System.out.print(result.getStdOut());
+        return result;
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/tool/asadmin/AsadminResult.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/tool/asadmin/AsadminResult.java
new file mode 100644
index 0000000..e7e09a0
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/tool/asadmin/AsadminResult.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2022 Eclipse Foundation and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.tool.asadmin;
+
+/**
+ * Result of the {@link Asadmin} execution.
+ *
+ * @author David Matejcek
+ */
+public class AsadminResult {
+
+    private final boolean error;
+    private final String stdOut;
+    private final String stdErr;
+    private final String output;
+
+    /**
+     * Creates a value object instance.
+     *
+     * @param commandName
+     * @param exitCode
+     * @param stdOut
+     * @param stdErr
+     */
+    public AsadminResult(final String commandName, final int exitCode, final String stdOut, final String stdErr) {
+        this.error = exitCode != 0 || containsError(stdOut, String.format("Command %s failed.", commandName));
+        this.stdOut = stdOut;
+        this.stdErr = stdErr;
+        this.output = this.stdOut + this.stdErr;
+    }
+
+
+    /**
+     * @return true if the error code was not zero OR stdOut contained text <i>Command x failed</i>.
+     */
+    public boolean isError() {
+        return error;
+    }
+
+
+    /**
+     * @return standard output made by the command.
+     */
+    public String getStdOut() {
+        return stdOut;
+    }
+
+    /**
+     * @return error output made by the command.
+     */
+    public String getStdErr() {
+        return stdErr;
+    }
+
+
+    /**
+     * @return {@link #getStdOut()} + {@link #getStdErr()}
+     */
+    public String getOutput() {
+        return output;
+    }
+
+
+    /**
+     * Returns {@link #getOutput()}. Important for hamcrest matchers!
+     */
+    @Override
+    public String toString() {
+        return getOutput();
+    }
+
+
+    private static boolean containsError(final String text, final String... invalidResults) {
+        for (final String result : invalidResults) {
+            if (text.contains(result)) {
+                return true;
+            }
+        }
+        return false;
+    }
+}
\ No newline at end of file
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/tool/asadmin/DetachedTerseAsadminResult.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/tool/asadmin/DetachedTerseAsadminResult.java
new file mode 100644
index 0000000..3f3daf1
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/tool/asadmin/DetachedTerseAsadminResult.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2022 Eclipse Foundation and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.tool.asadmin;
+
+import java.util.Arrays;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.arrayWithSize;
+
+/**
+ * @author David Matejcek
+ */
+public class DetachedTerseAsadminResult extends AsadminResult {
+
+    private final String jobId;
+
+    public DetachedTerseAsadminResult(String commandName, int exitCode, String stdOut, String stdErr) {
+        super(commandName, exitCode, stdOut, stdErr);
+        this.jobId = parseJobId(stdOut);
+    }
+
+
+    public String getJobId() {
+        return jobId;
+    }
+
+
+    private static String parseJobId(String stdOut) {
+        String[] lines = stdOut.split(System.lineSeparator());
+        assertThat(Arrays.toString(lines), lines, arrayWithSize(1));
+        return Integer.valueOf(lines[0]).toString();
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/tool/asadmin/GlassFishTestEnvironment.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/tool/asadmin/GlassFishTestEnvironment.java
new file mode 100644
index 0000000..a7c3f4e
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/tool/asadmin/GlassFishTestEnvironment.java
@@ -0,0 +1,199 @@
+/*
+ * Copyright (c) 2022 Eclipse Foundation and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.tool.asadmin;
+
+import jakarta.ws.rs.client.Client;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.Authenticator;
+import java.net.HttpURLConnection;
+import java.net.PasswordAuthentication;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.glassfish.admin.rest.client.ClientWrapper;
+import org.glassfish.main.admin.test.tool.AsadminResultMatcher;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * This class represents GlassFish installation outside test environment.
+ * <p>
+ * Ensures that the domain in executed before first test started, and that the domain stops
+ * after tests are finished.
+ *
+ * @author David Matejcek
+ */
+public class GlassFishTestEnvironment {
+    private static final Logger LOG = Logger.getLogger(GlassFishTestEnvironment.class.getName());
+
+    private static final File BASEDIR = detectBasedir();
+    private static final File GF_ROOT = resolveGlassFishRoot();
+
+    private static final String ADMIN_USER = "admin";
+    private static final String ADMIN_PASSWORD = "admintest";
+
+    private static final File ASADMIN = findAsadmin();
+    private static final File PASSWORD_FILE_FOR_UPDATE = findPasswordFile("password_update.txt");
+    private static final File PASSWORD_FILE = findPasswordFile("password.txt");
+
+
+    static {
+        LOG.log(Level.INFO, "Using basedir: {0}", BASEDIR);
+        LOG.log(Level.INFO, "Expected GlassFish directory: {0}", GF_ROOT);
+        changePassword();
+        Thread hook = new Thread(() -> {
+            getAsadmin().exec(10_000, "stop-domain", "--kill", "--force");
+        });
+        Runtime.getRuntime().addShutdownHook(hook);
+        assertThat(getAsadmin().exec(30_000, "start-domain"), AsadminResultMatcher.asadminOK());
+    }
+
+    /**
+     * @return {@link Asadmin} command api for tests.
+     */
+    public static Asadmin getAsadmin() {
+        return new Asadmin(ASADMIN, ADMIN_USER, PASSWORD_FILE);
+    }
+
+
+    /**
+     * @return project's target directory.
+     */
+    public static File getTargetDirectory() {
+        return new File(BASEDIR, "target");
+    }
+
+
+    /**
+     * Creates a {@link Client} instance for the domain administrator.
+     * Caller is responsible for closing.
+     *
+     * @return new {@link Client} instance
+     */
+    public static ClientWrapper createClient() {
+        return new ClientWrapper(new HashMap<String, String>(), ADMIN_USER, ADMIN_PASSWORD);
+    }
+
+
+    /**
+     * Creates a {@link HttpURLConnection} for the admin administrator.
+     *
+     * @param context - part of the url behind the <code>http://localhost:4848</code>
+     * @return a new disconnected {@link HttpURLConnection}.
+     * @throws IOException
+     */
+    public static HttpURLConnection openConnection(final String context) throws IOException {
+        final HttpURLConnection connection = (HttpURLConnection) new URL("http://localhost:4848" + context)
+            .openConnection();
+        connection.setRequestProperty("X-Requested-By", "JUnit5Test");
+        connection.setAuthenticator(new DasAuthenticator());
+        return connection;
+    }
+
+
+    /**
+     * This will delete the jobs.xml file
+     */
+    public static void deleteJobsFile() {
+        Path path = GF_ROOT.toPath().resolve(Paths.get("domains", "domain1", "config", "jobs.xml"));
+        LOG.log(Level.CONFIG, "Deleting: " + path);
+        try {
+            Files.deleteIfExists(path);
+        } catch (IOException e) {
+            throw new IllegalStateException(e);
+        }
+    }
+
+
+    /**
+     * Useful for a heuristic inside Eclipse and other environments.
+     *
+     * @return Absolute path to the glassfish directory.
+     */
+    private static File detectBasedir() {
+        final String basedir = System.getProperty("basedir");
+        if (basedir != null) {
+            return new File(basedir);
+        }
+        final File target = new File("target");
+        if (target.exists()) {
+            return target.getAbsoluteFile().getParentFile();
+        }
+        return new File(".").getAbsoluteFile().getParentFile();
+    }
+
+
+    private static File resolveGlassFishRoot() {
+        final File gfDir = BASEDIR.toPath().resolve(Path.of("target", "glassfish7", "glassfish")).toFile();
+        if (gfDir == null || !gfDir.exists()) {
+            throw new IllegalStateException("The expected GlassFish home directory doesn't exist: " + gfDir);
+        }
+        return gfDir;
+    }
+
+
+    private static File findAsadmin() {
+        return new File(GF_ROOT, isWindows() ? "bin/asadmin.bat" : "bin/asadmin");
+    }
+
+
+    private static boolean isWindows() {
+        return System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("win");
+    }
+
+
+    private static File findPasswordFile(final String filename) {
+        try {
+            final URL url = Asadmin.class.getResource("/" + filename);
+            if (url == null) {
+                throw new IllegalStateException(filename + " not found");
+            }
+            return Path.of(url.toURI()).toFile().getAbsoluteFile();
+        } catch (final URISyntaxException e) {
+            throw new IllegalStateException(e);
+        }
+    }
+
+
+    private static void changePassword() {
+        final Asadmin asadmin = new Asadmin(ASADMIN, ADMIN_USER, PASSWORD_FILE_FOR_UPDATE);
+        final AsadminResult result = asadmin.exec(5_000, "change-admin-password");
+        if (result.isError()) {
+            // probably changed by previous execution without maven clean
+            System.out.println("Admin password NOT changed.");
+        } else {
+            System.out.println("Admin password changed.");
+        }
+    }
+
+    private static class DasAuthenticator extends Authenticator {
+
+        @Override
+        protected PasswordAuthentication getPasswordAuthentication() {
+            return new PasswordAuthentication(ADMIN_USER, ADMIN_PASSWORD.toCharArray());
+        }
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/tool/asadmin/KeyAndValue.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/tool/asadmin/KeyAndValue.java
new file mode 100644
index 0000000..a5ee39c
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/tool/asadmin/KeyAndValue.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2022 Eclipse Foundation and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.tool.asadmin;
+
+import java.util.Comparator;
+import java.util.Objects;
+
+import static java.util.Comparator.comparing;
+
+/**
+ * @param <T> value type
+ *
+ * @author David Matejcek
+ */
+public class KeyAndValue<T> implements Comparable<KeyAndValue<?>> {
+
+
+    // note: toString should be fast.
+    private static final Comparator<Object> NULL_SAFE_COMPARATOR = comparing(o -> o == null ? "" : o.toString(),
+        String::compareTo);
+
+    private final String key;
+    private final T value;
+
+    public KeyAndValue(final String key, final T value) {
+        this.key = key;
+        this.value = value;
+    }
+
+
+    public String getKey() {
+        return key;
+    }
+
+
+    public T getValue() {
+        return value;
+    }
+
+
+    @Override
+    public String toString() {
+        return getKey() + '=' + getValue();
+    }
+
+
+    @Override
+    public boolean equals(Object object) {
+        if (object instanceof KeyAndValue<?>) {
+            KeyAndValue<?> another = (KeyAndValue<?>) object;
+            return Objects.equals(key, another.key) && Objects.equals(value, another.value);
+        }
+        return false;
+    }
+
+
+    @Override
+    public int hashCode() {
+        return key.hashCode();
+    }
+
+
+    @Override
+    public int compareTo(KeyAndValue<?> o) {
+        int keysComparisonResult = key.compareTo(o.key);
+        if (keysComparisonResult != 0) {
+            return keysComparisonResult;
+        }
+        return Objects.compare(value, o.value, NULL_SAFE_COMPARATOR);
+    }
+}
diff --git a/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/webapp/HelloServlet.java b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/webapp/HelloServlet.java
new file mode 100644
index 0000000..1515674
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/java/org/glassfish/main/admin/test/webapp/HelloServlet.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2022 Eclipse Foundation and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.main.admin.test.webapp;
+
+import jakarta.servlet.annotation.WebServlet;
+import jakarta.servlet.http.HttpServlet;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+
+import java.io.IOException;
+
+/**
+ * @author David Matejcek
+ */
+@WebServlet(urlPatterns = "/")
+public class HelloServlet extends HttpServlet {
+
+
+    @Override
+    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
+        response.getOutputStream().print("Hello!");
+    }
+
+}
diff --git a/appserver/tests/admin/tests/src/test/resources/password.txt b/appserver/tests/admin/tests/src/test/resources/password.txt
new file mode 100644
index 0000000..09e24de
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/resources/password.txt
@@ -0,0 +1 @@
+AS_ADMIN_PASSWORD=admintest
diff --git a/appserver/tests/admin/tests/src/test/resources/password_update.txt b/appserver/tests/admin/tests/src/test/resources/password_update.txt
new file mode 100644
index 0000000..73f0e04
--- /dev/null
+++ b/appserver/tests/admin/tests/src/test/resources/password_update.txt
@@ -0,0 +1,2 @@
+AS_ADMIN_PASSWORD=
+AS_ADMIN_NEWPASSWORD=admintest
diff --git a/appserver/tests/appserv-tests/util/reportbuilder/pom.xml b/appserver/tests/appserv-tests/util/reportbuilder/pom.xml
index 68857b3..f01f6d6 100644
--- a/appserver/tests/appserv-tests/util/reportbuilder/pom.xml
+++ b/appserver/tests/appserv-tests/util/reportbuilder/pom.xml
@@ -21,18 +21,17 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
     <parent>
-        <groupId>org.eclipse.ee4j</groupId>
-        <artifactId>project</artifactId>
-        <version>1.0</version>
+        <groupId>org.glassfish.main.tests</groupId>
+        <artifactId>ant-tests</artifactId>
+        <version>7.0.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.glassfish.devtests</groupId>
-        <version>4.0-SNAPSHOT</version>
     <artifactId>report-builder</artifactId>
     <packaging>jar</packaging>
     <name>report-builder</name>
     <build>
-        <finalName>${artifactId}</finalName>
+        <finalName>${project.artifactId}</finalName>
         <defaultGoal>install</defaultGoal>
         <plugins>
             <plugin>
@@ -42,7 +41,7 @@
                         <phase>install</phase>
                         <configuration>
                             <tasks>
-                                <copy file="target/${artifactId}.jar" tofile="../../lib/reportbuilder.jar"/>
+                                <copy file="target/${project.artifactId}.jar" tofile="../../lib/reportbuilder.jar"/>
                             </tasks>
                         </configuration>
                         <goals>
diff --git a/appserver/tests/gftest.sh b/appserver/tests/gftest.sh
index 7957205..2fcb499 100755
--- a/appserver/tests/gftest.sh
+++ b/appserver/tests/gftest.sh
@@ -54,8 +54,11 @@
   fi
   echo "Removing old glassfish directory: ${S1AS_HOME}";
   rm -rf "${S1AS_HOME}";
+  if [ -z "${MVN_EXTRA}" ]; then
+    export MVN_EXTRA="";
+  fi
   if [ -z "${GF_VERSION}" ]; then
-    export GF_VERSION="$(mvn help:evaluate -f \"${APS_HOME}/pom.xml\" -Dexpression=project.version -q -DforceStdout)"
+    export GF_VERSION="$(mvn help:evaluate -f \"${APS_HOME}/pom.xml\" -Dexpression=project.version -q -DforceStdout ${MVN_EXTRA})"
   fi
   if [ -z "${MVN_REPOSITORY}" ]; then
     export MVN_REPOSITORY="${HOME}/.m2/repository";
diff --git a/appserver/tests/pom.xml b/appserver/tests/pom.xml
index 79f376b..fa31ee7 100755
--- a/appserver/tests/pom.xml
+++ b/appserver/tests/pom.xml
@@ -118,7 +118,7 @@
                 <activeByDefault>true</activeByDefault>
             </activation>
             <modules>
-                <module>tck</module>
+                <module>admin</module>
                 <module>appserv-tests</module>
             </modules>
         </profile>
@@ -129,14 +129,16 @@
         <profile>
             <id>fastest</id>
             <modules>
-                <!-- Compile dependencies -->
+                <!-- Builds compile dependencies for Ant tests executed by runtest.sh/gftest.sh -->
                 <module>appserv-tests</module>
             </modules>
         </profile>
         <profile>
-            <id>fast</id>
+            <id>tck</id>
             <modules>
+                <module>admin</module>
                 <module>appserv-tests</module>
+                <module>tck</module>
             </modules>
         </profile>
     </profiles>
diff --git a/appserver/tests/quicklook/pom.xml b/appserver/tests/quicklook/pom.xml
index 2bc75d2..cf495b1 100644
--- a/appserver/tests/quicklook/pom.xml
+++ b/appserver/tests/quicklook/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.eclipse.ee4j</groupId>
         <artifactId>project</artifactId>
-        <version>1.0</version>
+        <version>1.0.7</version>
         <relativePath/>
     </parent>
 
diff --git a/appserver/tests/tck/pom.xml b/appserver/tests/tck/pom.xml
index 65db0f2..11de7ec 100644
--- a/appserver/tests/tck/pom.xml
+++ b/appserver/tests/tck/pom.xml
@@ -33,9 +33,12 @@
     <name>TCK: Parent</name>
 
     <modules>
-        <module>tck-download</module>
-        <module>authorization</module>
         <module>embedded_ejb_smoke</module>
+        <module>tck-download</module>
+        <module>rest</module>
+        <module>faces</module>
+        <module>authentication</module>
+        <module>authorization</module>
     </modules>
 
     <build>
@@ -51,33 +54,4 @@
             </plugin>
         </plugins>
     </build>
-    
-    <profiles>
-        <profile>
-            <id>tck-all</id>
-            <modules>
-                <module>rest</module>
-                <module>faces</module>
-                <module>authentication</module>
-            </modules>
-        </profile>
-        <profile>
-            <id>tck-rest</id>
-            <modules>
-                <module>rest</module>
-            </modules>
-        </profile>
-        <profile>
-            <id>tck-faces</id>
-            <modules>
-                <module>faces</module>
-            </modules>
-        </profile>
-        <profile>
-            <id>tck-authentication</id>
-            <modules>
-                <module>authentication</module>
-            </modules>
-        </profile>
-    </profiles>
 </project>
diff --git a/appserver/tests/tck/tck-download/jakarta-authorization-tck/pom.xml b/appserver/tests/tck/tck-download/jakarta-authorization-tck/pom.xml
index 2ea96a3..e63ae53 100644
--- a/appserver/tests/tck/tck-download/jakarta-authorization-tck/pom.xml
+++ b/appserver/tests/tck/tck-download/jakarta-authorization-tck/pom.xml
@@ -31,7 +31,7 @@
     <name>TCK: Install Jakarta Authorization TCK</name>
 
     <properties>
-    	<tck.test.authorization.file>jakarta-authorization-tck-2.1.0.zip</tck.test.authorization.file>
+        <tck.test.authorization.file>jakarta-authorization-tck-2.1.0.zip</tck.test.authorization.file>
         <tck.tests.authorization.url>https://download.eclipse.org/ee4j/jakartaee-tck/jakartaee10/staged/eftl/${tck.test.authorization.file}</tck.tests.authorization.url>
     </properties>
 
diff --git a/appserver/tests/tck/tck-download/jakarta-rest-tck/pom.xml b/appserver/tests/tck/tck-download/jakarta-rest-tck/pom.xml
index bdb593a..086854a 100644
--- a/appserver/tests/tck/tck-download/jakarta-rest-tck/pom.xml
+++ b/appserver/tests/tck/tck-download/jakarta-rest-tck/pom.xml
@@ -32,7 +32,7 @@
     <name>TCK: Install Jakarta REST TCK</name>
 
     <properties>
-    	<tck.test.rest.file>jakarta-pages-tck-3.1.0.zip</tck.test.rest.file>
+        <tck.test.rest.file>jakarta-restful-ws-tck-3.1.0.zip</tck.test.rest.file>
         <tck.test.rest.url>https://download.eclipse.org/ee4j/jakartaee-tck/jakartaee10/staged/eftl/${tck.test.rest.file}</tck.test.rest.url>
     </properties>
 
diff --git a/appserver/tests/tck/tck-download/pom.xml b/appserver/tests/tck/tck-download/pom.xml
index 52574e1..b5bb013 100644
--- a/appserver/tests/tck/tck-download/pom.xml
+++ b/appserver/tests/tck/tck-download/pom.xml
@@ -32,6 +32,9 @@
     <name>TCK: Download and Install Dependencies not in Maven Repos</name>
 
     <modules>
+        <module>jakarta-rest-tck</module>
+        <module>jakarta-faces-tck</module>
+        <module>jakarta-authentication-tck</module>
         <module>jakarta-authorization-tck</module>
         <module>tsharness</module>
         <module>javatest</module>
@@ -52,34 +55,4 @@
             </plugin>
         </plugins>
     </build>
-    
-    <profiles>
-        <profile>
-            <id>tck-all</id>
-            <modules>
-                <module>jakarta-rest-tck</module>
-                <module>jakarta-faces-tck</module>
-                <module>jakarta-pages-tck</module>
-                <module>jakarta-authentication-tck</module>
-            </modules>
-        </profile>
-        <profile>
-            <id>tck-rest</id>
-            <modules>
-                <module>jakarta-rest-tck</module>
-            </modules>
-        </profile>
-        <profile>
-            <id>tck-faces</id>
-            <modules>
-                <module>jakarta-faces-tck</module>
-            </modules>
-        </profile>
-        <profile>
-            <id>tck-authentication</id>
-            <modules>
-                <module>jakarta-authentication-tck</module>
-            </modules>
-        </profile>
-    </profiles>
 </project>
diff --git a/appserver/webservices/connector/src/main/java/org/glassfish/webservices/config/RegistryLocation.java b/appserver/webservices/connector/src/main/java/org/glassfish/webservices/config/RegistryLocation.java
index 9ee64c8..b2e645a 100644
--- a/appserver/webservices/connector/src/main/java/org/glassfish/webservices/config/RegistryLocation.java
+++ b/appserver/webservices/connector/src/main/java/org/glassfish/webservices/config/RegistryLocation.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,15 +17,16 @@
 
 package org.glassfish.webservices.config;
 
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.ConfigBeanProxy;
-import static org.glassfish.config.support.Constants.NAME_REGEX;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
 
 import java.beans.PropertyVetoException;
 
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Pattern;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+
+import static org.glassfish.config.support.Constants.NAME_REGEX;
 
 /**
  * Specifies the registry where web service end point artifacts are published.
@@ -41,17 +43,17 @@
      * @return possible object is
      *         {@link String }
      */
-    @Attribute(key=true)
+    @Attribute(key = true)
     @NotNull
-    @Pattern(regexp=NAME_REGEX)
-    public String getConnectorResourceJndiName();
+    @Pattern(regexp = NAME_REGEX, message = "Pattern: " + NAME_REGEX)
+    String getConnectorResourceJndiName();
 
     /**
      * Sets the value of the connectorResourceJndiName property.
      *
      * @param value allowed object is
-     *              {@link String }
+     *            {@link String }
      */
-    public void setConnectorResourceJndiName(String value) throws PropertyVetoException;
+    void setConnectorResourceJndiName(String value) throws PropertyVetoException;
 
 }
diff --git a/docs/pom.xml b/docs/pom.xml
index 92ec0a6..3b2ac07 100644
--- a/docs/pom.xml
+++ b/docs/pom.xml
@@ -71,7 +71,6 @@
         <plugins>
             <plugin>
                 <artifactId>maven-enforcer-plugin</artifactId>
-                <version>1.4.1</version>
                 <executions>
                     <execution>
                         <id>enforce-versions</id>
@@ -82,7 +81,7 @@
                             <rules>
                                 <requireJavaVersion>
                                     <version>[1.8.0,1.9.0)</version>
-                                    <message>You need JDK8 or lower</message>
+                                    <message>You need JDK8</message>
                                 </requireJavaVersion>
                             </rules>
                         </configuration>
diff --git a/nucleus/admin/cli/pom.xml b/nucleus/admin/cli/pom.xml
index 2f4b21f..db844c8 100755
--- a/nucleus/admin/cli/pom.xml
+++ b/nucleus/admin/cli/pom.xml
@@ -192,7 +192,7 @@
                     <verbose>false</verbose>
                     <linksource>true</linksource>
                     <links>
-                        <link>https://docs.oracle.com/javase/8/docs/api/</link>
+                        <link>https://docs.oracle.com/en/java/javase/11/docs/api/</link>
                     </links>
                     <show>private</show>
                 </configuration>
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 07b8bcd..3aae330 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
@@ -19,6 +19,8 @@
 import com.sun.enterprise.admin.remote.reader.ProprietaryReaderFactory;
 import com.sun.enterprise.admin.remote.writer.ProprietaryWriterFactory;
 import java.io.PrintStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
@@ -59,7 +61,7 @@
     private String command;
     private ProgramOptions po;
     private CLIContainer cliContainer;
-    private Environment env = new Environment();
+    private final Environment env = new Environment();
     protected Logger logger;
     private final static int ERROR = 1;
     private final static int CONNECTION_ERROR = 2;
@@ -121,14 +123,15 @@
      * @return set of JAR files or directories with JAR files
      */
     protected Set<File> getExtensions() {
-        Set<File> result = new HashSet<File>();
+        Set<File> result = new HashSet<>();
         final File inst = new File(System.getProperty(SystemPropertyConstants.INSTALL_ROOT_PROPERTY));
         final File ext = new File(new File(inst, "lib"), "asadmin");
         if (ext.exists() && ext.isDirectory()) {
             result.add(ext);
         } else {
-            if (logger.isLoggable(Level.FINER))
+            if (logger.isLoggable(Level.FINER)) {
                 logger.finer(strings.get("ExtDirMissing", ext));
+            }
         }
         result.add(new File(new File(inst, "modules"), "admin-cli.jar"));
         return result;
@@ -147,8 +150,8 @@
      */
     private static class CLILoggerHandler extends ConsoleHandler {
 
-        private CLILoggerHandler() {
-            setFormatter(new CLILoggerFormatter());
+        private CLILoggerHandler(boolean printStacktraces) {
+            setFormatter(new CLILoggerFormatter(printStacktraces));
         }
 
         @Override
@@ -156,16 +159,35 @@
             if (!isLoggable(logRecord)) {
                 return;
             }
-            final PrintStream ps = (logRecord.getLevel() == Level.SEVERE) ? System.err : System.out;
+            @SuppressWarnings("resource")
+            final PrintStream ps = logRecord.getLevel() == Level.SEVERE ? System.err : System.out;
             ps.println(getFormatter().format(logRecord));
         }
     }
 
     private static class CLILoggerFormatter extends SimpleFormatter {
 
+        private final boolean printStacktraces;
+
+        CLILoggerFormatter(boolean printStacktraces) {
+            this.printStacktraces = printStacktraces;
+        }
+
         @Override
         public synchronized String format(LogRecord record) {
-            return formatMessage(record);
+            if (record.getThrown() == null || !printStacktraces) {
+                return formatMessage(record);
+            }
+            return formatMessage(record) + printStackTrace(record.getThrown());
+        }
+
+        private String printStackTrace(Throwable throwable) {
+            StringWriter sw = new StringWriter();
+            PrintWriter pw = new PrintWriter(sw);
+            pw.println();
+            throwable.printStackTrace(pw);
+            pw.close();
+            return sw.toString();
         }
     }
 
@@ -209,7 +231,7 @@
             logger.setLevel(Level.FINE);
         }
         logger.setUseParentHandlers(false);
-        Handler h = new CLILoggerHandler();
+        Handler h = new CLILoggerHandler(trace);
         h.setLevel(logger.getLevel());
         logger.addHandler(h);
 
@@ -223,9 +245,10 @@
 
         if (debug) {
             System.setProperty(CLIConstants.WALL_CLOCK_START_PROP, "" + System.currentTimeMillis());
-            if (logger.isLoggable(Level.FINER))
+            if (logger.isLoggable(Level.FINER)) {
                 logger.log(Level.FINER, "CLASSPATH= {0}\nCommands: {1}",
                         new Object[] { System.getProperty("java.class.path"), Arrays.toString(args) });
+            }
         }
         /*
          * Set the thread's context class loader so that everyone can load from
@@ -278,8 +301,9 @@
             break;
 
         case WARNING:
-            if (logger.isLoggable(Level.FINE))
+            if (logger.isLoggable(Level.FINE)) {
                 logger.fine(strings.get("CommandSuccessfulWithWarnings", command));
+            }
             exitCode = SUCCESS;
             break;
 
diff --git a/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/Parser.java b/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/Parser.java
index 69f6138..4b05048 100644
--- a/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/Parser.java
+++ b/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/Parser.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 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
@@ -16,29 +17,38 @@
 
 package com.sun.enterprise.admin.cli;
 
-import java.io.*;
-import java.util.*;
-import org.glassfish.api.admin.*;
-import org.glassfish.api.admin.CommandModel.ParamModel;
-import com.sun.enterprise.admin.util.*;
 import com.sun.enterprise.admin.util.CommandModelData.ParamModelData;
 import com.sun.enterprise.universal.i18n.LocalStringsImpl;
 
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Locale;
+import java.util.Objects;
+
+import org.glassfish.api.admin.CommandModel.ParamModel;
+import org.glassfish.api.admin.CommandValidationException;
+import org.glassfish.api.admin.ParameterMap;
+
 /**
  * The <code>Parser</code> object is used to parse the command line and verify that the command line is CLIP compliant.
  */
 public class Parser {
     // MultiMap of options and values from command-line
-    private ParameterMap optionsMap = new ParameterMap();
+    private final ParameterMap optionsMap = new ParameterMap();
 
     // Array of operands from command-line
-    private List<String> operands = new ArrayList<String>();
+    private final List<String> operands = new ArrayList<>();
 
     // The valid options for the command we're parsing
-    private Collection<ParamModel> options;
+    private final Collection<ParamModel> options;
 
     // Ignore unknown options when parsing?
-    private boolean ignoreUnknown;
+    private final boolean ignoreUnknown;
 
     private static final LocalStringsImpl strings = new LocalStringsImpl(Parser.class);
 
@@ -69,28 +79,32 @@
      * @throws CommandValidationException if command line is invalid
      */
     private void parseCommandLine(final String[] argv, final int start) throws CommandValidationException {
-
+        Objects.requireNonNull(argv, "parseCommandLine doesn't accept null as argv");
         for (int si = start; si < argv.length; si++) {
             String arg = argv[si];
             if (arg.equals("--")) { // end of options
                 // if we're ignoring unknown options, we include this
                 // delimiter as an operand, it will be eliminated later
                 // when we process all remaining options
-                if (!ignoreUnknown)
+                if (!ignoreUnknown) {
                     si++;
-                while (si < argv.length)
+                }
+                while (si < argv.length) {
                     operands.add(argv[si++]);
+                }
                 break;
             }
 
             // is it an operand or option value?
             if (!arg.startsWith("-") || arg.length() <= 1) {
                 operands.add(arg);
-                if (ignoreUnknown)
+                if (ignoreUnknown) {
                     continue;
+                }
                 si++;
-                while (si < argv.length)
+                while (si < argv.length) {
                     operands.add(argv[si++]);
+                }
                 break;
             }
 
@@ -108,17 +122,19 @@
                 }
                 // if of the form "--option=value", extract value
                 int ne = arg.indexOf('=');
-                if (ne < 0)
+                if (ne < 0) {
                     name = arg.substring(ns);
-                else {
-                    if (value != null)
+                } else {
+                    if (value != null) {
                         throw new CommandValidationException(strings.get("parser.noValueAllowed", arg));
+                    }
                     name = arg.substring(ns, ne);
                     value = arg.substring(ne + 1);
                 }
                 opt = lookupLongOption(name);
-                if (sawno && optionRequiresOperand(opt))
+                if (sawno && optionRequiresOperand(opt)) {
                     throw new CommandValidationException(strings.get("parser.illegalNo", opt.getName()));
+                }
             } else { // short option
                 /*
                  * possibilities are:
@@ -139,19 +155,21 @@
                         for (int i = 1; i < arg.length(); i++) {
                             opt = lookupShortOption(arg.charAt(i));
                             if (opt == null) {
-                                if (!ignoreUnknown)
+                                if (!ignoreUnknown) {
                                     throw new CommandValidationException(
                                             strings.get("parser.invalidOption", Character.toString(arg.charAt(i))));
+                                }
                                 // unknown option, skip all the rest
                                 operands.add(arg);
                                 break;
                             }
-                            if (opt.getType() == Boolean.class || opt.getType() == boolean.class)
+                            if (opt.getType() == Boolean.class || opt.getType() == boolean.class) {
                                 setOption(opt, "true");
-                            else {
-                                if (!ignoreUnknown)
+                            } else {
+                                if (!ignoreUnknown) {
                                     throw new CommandValidationException(
                                             strings.get("parser.nonbooleanNotAllowed", Character.toString(arg.charAt(i)), arg));
+                                }
                                 // unknown option, skip all the rest
                                 operands.add(arg);
                                 break;
@@ -164,8 +182,9 @@
 
             // is it a known option?
             if (opt == null) {
-                if (!ignoreUnknown)
+                if (!ignoreUnknown) {
                     throw new CommandValidationException(strings.get("parser.invalidOption", arg));
+                }
                 // unknown option, skip it
                 operands.add(arg);
                 continue;
@@ -176,13 +195,16 @@
                 // if no valid options were specified, we use the next argument
                 // as an option as long as it doesn't look like an option
                 if (options == null) {
-                    if (si + 1 < argv.length && !argv[si + 1].startsWith("-"))
+                    if (si + 1 < argv.length && !argv[si + 1].startsWith("-")) {
                         value = argv[++si];
-                    else
+                    }
+                    else {
                         ((ParamModelData) opt).type = Boolean.class; // fake it
+                    }
                 } else if (optionRequiresOperand(opt)) {
-                    if (++si >= argv.length)
+                    if (++si >= argv.length) {
                         throw new CommandValidationException(strings.get("parser.missingValue", name));
+                    }
                     value = argv[si];
                 } else if (opt.getType() == Boolean.class || opt.getType() == boolean.class) {
                     /*
@@ -222,6 +244,7 @@
         return operands;
     }
 
+    @Override
     public String toString() {
         return "CLI parser: Options = " + optionsMap + "; Operands = " + operands;
     }
@@ -230,20 +253,24 @@
      * Get ParamModel for long option name.
      */
     private ParamModel lookupLongOption(String s) {
-        if (s == null || s.length() == 0)
+        if (s == null || s.length() == 0) {
             return null;
+        }
         // XXX - for now, fake it if no options
         if (options == null) {
             // no valid options specified so everything is valid
             return new ParamModelData(s, String.class, true, null);
         }
         for (ParamModel od : options) {
-            if (od.getParam().primary())
+            if (od.getParam().primary()) {
                 continue;
-            if (s.equalsIgnoreCase(od.getName()))
+            }
+            if (s.equalsIgnoreCase(od.getName())) {
                 return od;
-            if (s.equalsIgnoreCase(od.getParam().alias()))
+            }
+            if (s.equalsIgnoreCase(od.getParam().alias())) {
                 return od;
+            }
         }
         return null;
     }
@@ -253,12 +280,14 @@
      */
     private ParamModel lookupShortOption(char c) {
         // XXX - for now, fake it if no options
-        if (options == null)
+        if (options == null) {
             return null;
+        }
         String sc = Character.toString(c);
         for (ParamModel od : options) {
-            if (od.getParam().shortName().equals(sc))
+            if (od.getParam().shortName().equals(sc)) {
                 return od;
+            }
         }
         return null;
     }
@@ -275,10 +304,12 @@
      */
     private void setOption(ParamModel opt, String value) throws CommandValidationException {
         // VERY basic validation
-        if (opt == null)
+        if (opt == null) {
             throw new NullPointerException("null option name");
-        if (value != null)
+        }
+        if (value != null) {
             value = value.trim();
+        }
 
         String name = opt.getName();
         if (opt.getType() == File.class) {
@@ -292,21 +323,24 @@
                 } catch (IOException ioex) {
                     throw new CommandValidationException(strings.get("parser.invalidFileEx", name, ioex.toString()));
                 } finally {
-                    if (is != null)
+                    if (is != null) {
                         try {
                             is.close();
                         } catch (IOException cex) {
                         }
+                    }
                 }
                 throw new CommandValidationException(strings.get("parser.invalidFile", name, value));
             }
         } else if (opt.getType() == Boolean.class || opt.getType() == boolean.class) {
-            if (value == null)
+            if (value == null) {
                 value = "true";
-            else if (!(value.toLowerCase(Locale.ENGLISH).equals("true") || value.toLowerCase(Locale.ENGLISH).equals("false")))
+            } else if (!(value.toLowerCase(Locale.ENGLISH).equals("true") || value.toLowerCase(Locale.ENGLISH).equals("false"))) {
                 throw new CommandValidationException(strings.get("parser.invalidBoolean", name, value));
-        } else if (opt.getParam().password())
+            }
+        } else if (opt.getParam().password()) {
             throw new CommandValidationException(strings.get("parser.passwordNotAllowed", opt.getName()));
+        }
 
         if (!opt.getParam().multiple()) {
             // repeats not allowed
diff --git a/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/remote/RemoteCLICommand.java b/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/remote/RemoteCLICommand.java
index 2a94bb1..30b2362 100644
--- a/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/remote/RemoteCLICommand.java
+++ b/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/remote/RemoteCLICommand.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -36,20 +37,34 @@
 import com.sun.enterprise.universal.i18n.LocalStringsImpl;
 import com.sun.enterprise.util.StringUtils;
 import com.sun.enterprise.util.SystemPropertyConstants;
-import java.io.*;
-import java.net.*;
+
+import java.io.BufferedReader;
+import java.io.Console;
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.io.Reader;
+import java.io.StringReader;
+import java.net.CookieHandler;
+import java.net.CookieManager;
+import java.net.CookiePolicy;
+import java.net.CookieStore;
+import java.net.HttpCookie;
+import java.net.URI;
+import java.net.URLConnection;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Locale;
 import java.util.logging.Level;
 import java.util.logging.Logger;
+
 import org.glassfish.api.ActionReport;
 import org.glassfish.api.ActionReport.ExitCode;
 import org.glassfish.api.admin.AdminCommandEventBroker;
 import org.glassfish.api.admin.AdminCommandEventBroker.AdminCommandListener;
 import org.glassfish.api.admin.AdminCommandState;
 import org.glassfish.api.admin.CommandException;
-import org.glassfish.api.admin.CommandModel;
 import org.glassfish.api.admin.CommandModel.ParamModel;
 import org.glassfish.api.admin.CommandProgress;
 import org.glassfish.api.admin.CommandValidationException;
@@ -80,7 +95,7 @@
     protected ParameterMap reExecutedOptions;
     protected List<String> reExecutedOperands;
     private RemoteCLICommand.CLIRemoteAdminCommand rac;
-    private final MultiMap<String, AdminCommandListener<GfSseInboundEvent>> listeners = new MultiMap<String, AdminCommandListener<GfSseInboundEvent>>();
+    private final MultiMap<String, AdminCommandListener<GfSseInboundEvent>> listeners = new MultiMap<>();
 
     /**
      * A special RemoteAdminCommand that overrides methods so that we can handle the interactive requirements of a CLI
@@ -165,17 +180,20 @@
                 if (programOpts.getUser() == null) {
                     cons.printf("%s ", strings.get("AdminUserPrompt"));
                     user = cons.readLine();
-                    if (user == null)
+                    if (user == null) {
                         return false;
+                    }
                 }
                 char[] password;
                 String puser = ok(user) ? user : programOpts.getUser();
-                if (ok(puser))
+                if (ok(puser)) {
                     password = readPassword(strings.get("AdminUserPasswordPrompt", puser));
-                else
+                } else {
                     password = readPassword(strings.get("AdminPasswordPrompt"));
-                if (password == null)
+                }
+                if (password == null) {
                     return false;
+                }
                 if (ok(user)) { // if none entered, don't change
                     programOpts.setUser(user);
                     this.user = user;
@@ -229,8 +247,9 @@
                 }
             }
 
-            if (msg == null)
+            if (msg == null) {
                 msg = strings.get("InvalidCredentials", programOpts.getUser());
+            }
             return msg;
         }
 
@@ -281,8 +300,9 @@
             try {
                 ((ClientCookieStore) cookieManager.getCookieStore()).load();
             } catch (IOException e) {
-                if (logger.isLoggable(Level.FINER))
+                if (logger.isLoggable(Level.FINER)) {
                     logger.finer("Unable to load cookies: " + e.toString());
+                }
                 return;
             }
 
@@ -343,7 +363,7 @@
 
         private void processCookieHeaders(final URLConnection urlConnection) {
 
-            CookieManager systemCookieManager = (CookieManager) CookieManager.getDefault();
+            CookieManager systemCookieManager = (CookieManager) CookieHandler.getDefault();
 
             if (systemCookieManager == null) {
                 logger.finer("Assertion failed: null system CookieManager");
@@ -382,16 +402,18 @@
                     cookieManager.put(((ClientCookieStore) cookieManager.getCookieStore()).getStaticURI(), urlConnection.getHeaderFields());
                 } catch (IOException e) {
                     // Thrown by cookieManger.put()
-                    if (logger.isLoggable(Level.FINER))
+                    if (logger.isLoggable(Level.FINER)) {
                         logger.finer("Unable to save cookies: " + e.toString());
+                    }
                     return;
                 }
 
                 try {
                     ((ClientCookieStore) cookieManager.getCookieStore()).store();
                 } catch (IOException e) {
-                    if (logger.isLoggable(Level.FINER))
+                    if (logger.isLoggable(Level.FINER)) {
                         logger.finer("Unable to store cookies: " + e.toString());
+                    }
                 }
                 return;
             }
@@ -402,8 +424,9 @@
                 try {
                     ((ClientCookieStore) cookieManager.getCookieStore()).load();
                 } catch (IOException e) {
-                    if (logger.isLoggable(Level.FINER))
+                    if (logger.isLoggable(Level.FINER)) {
                         logger.finer("Unable to load cookies: " + e.toString());
+                    }
                     return;
                 }
             }
@@ -444,14 +467,16 @@
                                 urlConnection.getHeaderFields());
                     } catch (IOException e) {
                         // Thrown by cookieManger.put()
-                        if (logger.isLoggable(Level.FINER))
+                        if (logger.isLoggable(Level.FINER)) {
                             logger.finer("Unable to save cookies: " + e.toString());
+                        }
                         return;
                     }
                     ((ClientCookieStore) cookieManager.getCookieStore()).store();
                 } catch (IOException e) {
-                    if (logger.isLoggable(Level.FINER))
+                    if (logger.isLoggable(Level.FINER)) {
                         logger.finer("Unable to store cookies: " + e.toString());
+                    }
                 }
             } else {
                 // No cookies changed.  Update the modification time on the store.
@@ -593,14 +618,12 @@
              * Find the metadata for the command.
              */
             commandModel = rac.getCommandModel();
-        } catch (CommandException cex) {
-            if (logger.isLoggable(Level.FINER))
-                logger.finer("RemoteCommand.prepare throws " + cex);
-            throw cex;
+        } catch (CommandException e) {
+            logger.log(Level.SEVERE, "RemoteCLICommand.prepare throws exception.", e);
+            throw e;
         } catch (Exception e) {
-            if (logger.isLoggable(Level.FINER))
-                logger.finer("RemoteCommand.prepare throws " + e);
-            throw new CommandException(e.getMessage());
+            logger.log(Level.SEVERE, "RemoteCLICommand.prepare throws exception.", e);
+            throw new CommandException(e.getMessage(), e);
         }
     }
 
@@ -612,7 +635,7 @@
                 ParamModel operandModel = getOperandModel();
                 if (operandModel != null && !operandModel.getParam().optional()) {
                     if (operands == null) {
-                        operands = new ArrayList<String>(reExecutedOperands.size());
+                        operands = new ArrayList<>(reExecutedOperands.size());
                     }
                     if (reExecutedOperands.size() > operands.size()) {
                         if (operandModel.getParam().multiple()) {
@@ -695,9 +718,7 @@
     @Override
     protected int executeCommand() throws CommandException, CommandValidationException {
         try {
-            if (logger.isLoggable(Level.FINER)) {
-                logger.finer("RemoteCLICommand.executeCommand()");
-            }
+            logger.finer("RemoteCLICommand.executeCommand()");
             rac.statusPrinter.reset();
             options.set("DEFAULT", operands);
             if (programOpts.isDetachedCommand()) {
@@ -733,8 +754,9 @@
                         PrintWriter pw = new PrintWriter(System.out);
                         char[] buf = new char[8192];
                         int cnt;
-                        while ((cnt = br.read(buf)) > 0)
+                        while ((cnt = br.read(buf)) > 0) {
                             pw.write(buf, 0, cnt);
+                        }
                         pw.flush();
                         return SUCCESS;
                     }
@@ -742,8 +764,9 @@
                     // ignore it and throw original exception
                 } finally {
                     try {
-                        if (br != null)
+                        if (br != null) {
                             br.close();
+                        }
                     } catch (IOException ioex3) {
                         // ignore it
                     }
@@ -806,8 +829,9 @@
             }
             usage = rac.getUsage();
         }
-        if (usage == null)
+        if (usage == null) {
             return super.getUsage();
+        }
 
         StringBuilder usageText = new StringBuilder();
         usageText.append(strings.get("Usage", getBriefCommandUsage()));
@@ -878,8 +902,9 @@
         try {
             LoginInfoStore store = LoginInfoStoreFactory.getDefaultStore();
             li = store.read(programOpts.getHost(), programOpts.getPort());
-            if (li == null)
+            if (li == null) {
                 return;
+            }
         } catch (StoreException se) {
             logger.finer("Login info could not be read from ~/.asadminpass file");
             return;
@@ -896,8 +921,9 @@
          */
         if (programOpts.getUser() == null) {
             // not on command line and in .asadminpass
-            if (logger.isLoggable(Level.FINER))
+            if (logger.isLoggable(Level.FINER)) {
                 logger.finer("Getting user name from ~/.asadminpass: " + li.getUser());
+            }
             programOpts.setUser(li.getUser());
             if (programOpts.getPassword() == null) {
                 // not in passwordfile and in .asadminpass
@@ -932,8 +958,9 @@
         ServiceLocator h = getManHabitat();
         String cname = "org.glassfish.api.admin.AdminCommand";
         ActiveDescriptor<?> ad = h.getBestDescriptor(BuilderHelper.createNameAndContractFilter(cname, cmdName));
-        if (ad == null)
+        if (ad == null) {
             return null;
+        }
         return ad.getImplementation();
     }
 
@@ -941,8 +968,9 @@
      * Return a ServiceLocator used just for reading man pages from the modules in the modules directory.
      */
     private static synchronized ServiceLocator getManHabitat() {
-        if (manServiceLocator != null)
+        if (manServiceLocator != null) {
             return manServiceLocator;
+        }
         ModulesRegistry registry = new StaticModulesRegistry(getModuleClassLoader());
         manServiceLocator = registry.createServiceLocator("default");
         return manServiceLocator;
@@ -952,8 +980,9 @@
      * Return a ClassLoader that loads classes from all the modules (jar files) in the <INSTALL_ROOT>/modules directory.
      */
     private static synchronized ClassLoader getModuleClassLoader() {
-        if (moduleClassLoader != null)
+        if (moduleClassLoader != null) {
             return moduleClassLoader;
+        }
         try {
             File installDir = new File(System.getProperty(SystemPropertyConstants.INSTALL_ROOT_PROPERTY));
             File modulesDir = new File(installDir, "modules");
diff --git a/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/remote/RemoteCommand.java b/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/remote/RemoteCommand.java
index 61d8bf3..996f337 100644
--- a/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/remote/RemoteCommand.java
+++ b/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/remote/RemoteCommand.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 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
@@ -20,29 +21,50 @@
 import com.sun.appserv.management.client.prefs.LoginInfoStore;
 import com.sun.appserv.management.client.prefs.LoginInfoStoreFactory;
 import com.sun.appserv.management.client.prefs.StoreException;
-import com.sun.enterprise.admin.cli.*;
+import com.sun.enterprise.admin.cli.CLICommand;
+import com.sun.enterprise.admin.cli.DirectoryClassLoader;
+import com.sun.enterprise.admin.cli.Environment;
+import com.sun.enterprise.admin.cli.ProgramOptions;
 import com.sun.enterprise.admin.cli.ProgramOptions.PasswordLocation;
 import com.sun.enterprise.admin.remote.RemoteAdminCommand;
-import com.sun.enterprise.admin.util.*;
+import com.sun.enterprise.admin.util.CachedCommandModel;
+import com.sun.enterprise.admin.util.CommandModelData;
 import com.sun.enterprise.admin.util.CommandModelData.ParamModelData;
-import com.sun.enterprise.module.*;
+import com.sun.enterprise.module.ModulesRegistry;
 import com.sun.enterprise.module.single.StaticModulesRegistry;
 import com.sun.enterprise.security.store.AsadminSecurityUtil;
 import com.sun.enterprise.universal.i18n.LocalStringsImpl;
 import com.sun.enterprise.util.SystemPropertyConstants;
-import java.io.*;
-import java.net.*;
-import java.util.*;
+
+import java.io.BufferedReader;
+import java.io.Console;
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.io.Reader;
+import java.io.StringReader;
+import java.net.CookieHandler;
+import java.net.CookieManager;
+import java.net.CookiePolicy;
+import java.net.CookieStore;
+import java.net.HttpCookie;
+import java.net.URI;
+import java.net.URLConnection;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import org.glassfish.api.Param;
-import org.glassfish.api.admin.*;
+import org.glassfish.api.admin.CommandException;
+import org.glassfish.api.admin.CommandModel;
+import org.glassfish.api.admin.CommandValidationException;
+import org.glassfish.api.admin.ParameterMap;
 import org.glassfish.common.util.admin.ManPageFinder;
 import org.glassfish.hk2.api.ActiveDescriptor;
 import org.glassfish.hk2.api.ServiceLocator;
 import org.glassfish.hk2.utilities.BuilderHelper;
-import org.jvnet.hk2.component.*;
 
 /**
  * A remote command handled by the asadmin CLI.
@@ -128,17 +150,20 @@
                 if (programOpts.getUser() == null) {
                     cons.printf("%s ", strings.get("AdminUserPrompt"));
                     user = cons.readLine();
-                    if (user == null)
+                    if (user == null) {
                         return false;
+                    }
                 }
                 char[] password;
                 String puser = ok(user) ? user : programOpts.getUser();
-                if (ok(puser))
+                if (ok(puser)) {
                     password = readPassword(strings.get("AdminUserPasswordPrompt", puser));
-                else
+                } else {
                     password = readPassword(strings.get("AdminPasswordPrompt"));
-                if (password == null)
+                }
+                if (password == null) {
                     return false;
+                }
                 if (ok(user)) { // if none entered, don't change
                     programOpts.setUser(user);
                     this.user = user;
@@ -188,8 +213,9 @@
                 }
             }
 
-            if (msg == null)
+            if (msg == null) {
                 msg = strings.get("InvalidCredentials", programOpts.getUser());
+            }
             return msg;
         }
 
@@ -227,8 +253,9 @@
             try {
                 ((ClientCookieStore) cookieManager.getCookieStore()).load();
             } catch (IOException e) {
-                if (logger.isLoggable(Level.FINER))
-                    logger.finer("Unable to load cookies: " + e.toString());
+                if (logger.isLoggable(Level.FINER)) {
+                    logger.finer("Unable to load cookies: " + e);
+                }
                 return;
             }
 
@@ -268,8 +295,9 @@
                     if (cookie.getName().equals(JSESSIONID)) {
                         if ((creationTime / 1000 + cookie.getMaxAge()) < System.currentTimeMillis() / 1000) {
                             return true;
-                        } else
+                        } else {
                             return false;
+                        }
                     }
                 }
             }
@@ -288,7 +316,7 @@
 
         private void processCookieHeaders(final URLConnection urlConnection) {
 
-            CookieManager systemCookieManager = (CookieManager) CookieManager.getDefault();
+            CookieManager systemCookieManager = (CookieManager) CookieHandler.getDefault();
 
             if (systemCookieManager == null) {
                 logger.finer("Assertion failed: null system CookieManager");
@@ -327,16 +355,18 @@
                     cookieManager.put(((ClientCookieStore) cookieManager.getCookieStore()).getStaticURI(), urlConnection.getHeaderFields());
                 } catch (IOException e) {
                     // Thrown by cookieManger.put()
-                    if (logger.isLoggable(Level.FINER))
+                    if (logger.isLoggable(Level.FINER)) {
                         logger.finer("Unable to save cookies: " + e.toString());
+                    }
                     return;
                 }
 
                 try {
                     ((ClientCookieStore) cookieManager.getCookieStore()).store();
                 } catch (IOException e) {
-                    if (logger.isLoggable(Level.FINER))
+                    if (logger.isLoggable(Level.FINER)) {
                         logger.finer("Unable to store cookies: " + e.toString());
+                    }
                 }
                 return;
             }
@@ -347,8 +377,9 @@
                 try {
                     ((ClientCookieStore) cookieManager.getCookieStore()).load();
                 } catch (IOException e) {
-                    if (logger.isLoggable(Level.FINER))
+                    if (logger.isLoggable(Level.FINER)) {
                         logger.finer("Unable to load cookies: " + e.toString());
+                    }
                     return;
                 }
             }
@@ -389,14 +420,16 @@
                                 urlConnection.getHeaderFields());
                     } catch (IOException e) {
                         // Thrown by cookieManger.put()
-                        if (logger.isLoggable(Level.FINER))
+                        if (logger.isLoggable(Level.FINER)) {
                             logger.finer("Unable to save cookies: " + e.toString());
+                        }
                         return;
                     }
                     ((ClientCookieStore) cookieManager.getCookieStore()).store();
                 } catch (IOException e) {
-                    if (logger.isLoggable(Level.FINER))
+                    if (logger.isLoggable(Level.FINER)) {
                         logger.finer("Unable to store cookies: " + e.toString());
+                    }
                 }
             } else {
                 // No cookies changed.  Update the modification time on the store.
@@ -466,7 +499,7 @@
         if (eTag != null && eTag.equals(newETag)) {
             return; //Nothing change in command model
         }
-        logger.log(Level.WARNING, "Command signature of {0} command was changed. " + "Reexecuting with new metadata.", name);
+        logger.log(Level.WARNING, "Command signature of {0} command was changed. Reexecuting with new metadata.", name);
         //clean state of this instance
         this.options = null;
         this.operands = null;
@@ -537,16 +570,13 @@
 
             if (programOpts.isNotifyCommand()) {
                 commandModel.add(new ParamModelData("notify", boolean.class, true, "false"));
-
             }
-        } catch (CommandException cex) {
-            if (logger.isLoggable(Level.FINER))
-                logger.finer("RemoteCommand.prepare throws " + cex);
-            throw cex;
+        } catch (CommandException e) {
+            logger.log(Level.SEVERE, "RemoteCommand.prepare throws exception.", e);
+            throw e;
         } catch (Exception e) {
-            if (logger.isLoggable(Level.FINER))
-                logger.finer("RemoteCommand.prepare throws " + e);
-            throw new CommandException(e.getMessage());
+            logger.log(Level.SEVERE, "RemoteCommand.prepare throws exception.", e);
+            throw new CommandException(e.getMessage(), e);
         }
     }
 
@@ -602,9 +632,9 @@
         try {
             options.set("DEFAULT", operands);
             output = rac.executeCommand(options);
-            if (returnAttributes)
+            if (returnAttributes) {
                 attrs = rac.getAttributes();
-            else if (!returnOutput) {
+            } else if (!returnOutput) {
                 if (output.length() > 0) {
                     logger.info(output);
                 }
@@ -623,8 +653,9 @@
                         PrintWriter pw = new PrintWriter(System.out);
                         char[] buf = new char[8192];
                         int cnt;
-                        while ((cnt = br.read(buf)) > 0)
+                        while ((cnt = br.read(buf)) > 0) {
                             pw.write(buf, 0, cnt);
+                        }
                         pw.flush();
                         return SUCCESS;
                     }
@@ -632,8 +663,9 @@
                     // ignore it and throw original exception
                 } finally {
                     try {
-                        if (br != null)
+                        if (br != null) {
                             br.close();
+                        }
                     } catch (IOException ioex3) {
                         // ignore it
                     }
@@ -643,8 +675,9 @@
         }
         final Map<String, String> racAttrs = rac.getAttributes();
         String returnVal = racAttrs != null ? racAttrs.get("exit-code") : null;
-        if (returnVal != null && "WARNING".equals(returnVal))
+        if (returnVal != null && "WARNING".equals(returnVal)) {
             return WARNING;
+        }
         return SUCCESS;
     }
 
@@ -696,8 +729,9 @@
             }
             usage = rac.getUsage();
         }
-        if (usage == null)
+        if (usage == null) {
             return super.getUsage();
+        }
 
         StringBuilder usageText = new StringBuilder();
         usageText.append(strings.get("Usage", getBriefCommandUsage()));
@@ -710,6 +744,7 @@
      * Get the man page from the server. If the man page isn't available, e.g., because the server is down, try to find it
      * locally by looking in the modules directory.
      */
+    @Override
     public BufferedReader getManPage() {
         try {
             initializeRemoteAdminCommand();
@@ -767,8 +802,9 @@
         try {
             LoginInfoStore store = LoginInfoStoreFactory.getDefaultStore();
             li = store.read(programOpts.getHost(), programOpts.getPort());
-            if (li == null)
+            if (li == null) {
                 return;
+            }
         } catch (StoreException se) {
             logger.finer("Login info could not be read from ~/.asadminpass file");
             return;
@@ -785,8 +821,9 @@
          */
         if (programOpts.getUser() == null) {
             // not on command line and in .asadminpass
-            if (logger.isLoggable(Level.FINER))
+            if (logger.isLoggable(Level.FINER)) {
                 logger.finer("Getting user name from ~/.asadminpass: " + li.getUser());
+            }
             programOpts.setUser(li.getUser());
             if (programOpts.getPassword() == null) {
                 // not in passwordfile and in .asadminpass
@@ -833,8 +870,9 @@
      * Return a ServiceLocator used just for reading man pages from the modules in the modules directory.
      */
     private static synchronized ServiceLocator getManHabitat() {
-        if (manServiceLocator != null)
+        if (manServiceLocator != null) {
             return manServiceLocator;
+        }
 
         ModulesRegistry registry = new StaticModulesRegistry(getModuleClassLoader());
         ServiceLocator serviceLocator = registry.createServiceLocator("default");
@@ -846,8 +884,9 @@
      * Return a ClassLoader that loads classes from all the modules (jar files) in the <INSTALL_ROOT>/modules directory.
      */
     private static synchronized ClassLoader getModuleClassLoader() {
-        if (moduleClassLoader != null)
+        if (moduleClassLoader != null) {
             return moduleClassLoader;
+        }
         try {
             File installDir = new File(System.getProperty(SystemPropertyConstants.INSTALL_ROOT_PROPERTY));
             File modulesDir = new File(installDir, "modules");
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/AdminService.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/AdminService.java
index 70ee529..dc59d63 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/AdminService.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/AdminService.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,17 +17,21 @@
 
 package com.sun.enterprise.config.serverbeans;
 
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
+
 import java.beans.PropertyVetoException;
 import java.util.List;
 
 import org.glassfish.api.admin.config.PropertiesDesc;
+import org.glassfish.quality.ToDo;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.DuckTyped;
+import org.jvnet.hk2.config.Element;
 import org.jvnet.hk2.config.types.Property;
 import org.jvnet.hk2.config.types.PropertyBag;
-import org.glassfish.quality.ToDo;
-import org.jvnet.hk2.config.*;
-
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Pattern;
 
 /* @XmlType(name = "", propOrder = {
     "jmxConnector",
@@ -40,6 +45,8 @@
 @Configured
 public interface AdminService extends ConfigBeanProxy, PropertyBag {
 
+    String PATTERN_TYPE = "(das|das-and-server|server)";
+
     /**
      * Gets the value of the type property. An instance can either be of type das Domain Administration Server in SE/EE or
      * the PE instance das-and-server same as das server Any non-DAS instance in SE/EE. Not valid for PE.
@@ -47,7 +54,7 @@
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "server")
-    @Pattern(regexp = "(das|das-and-server|server)")
+    @Pattern(regexp = PATTERN_TYPE, message = "Pattern: " + PATTERN_TYPE)
     String getType();
 
     /**
@@ -98,6 +105,7 @@
     /**
      * Properties as per {@link org.jvnet.hk2.config.types.PropertyBag}
      */
+    @Override
     @ToDo(priority = ToDo.Priority.IMPORTANT, details = "Provide PropertyDesc for legal props")
     @PropertiesDesc(props = {})
     @Element
@@ -150,8 +158,9 @@
             SecurityService ss = cfg.getSecurityService();
             List<AuthRealm> realms = ss.getAuthRealm();
             for (AuthRealm realm : realms) {
-                if (rn.equals(realm.getName()))
+                if (rn.equals(realm.getName())) {
                     return realm;
+                }
             }
             return null;
         }
@@ -167,8 +176,9 @@
             boolean usesFR = false;
             AuthRealm ar = as.getAssociatedAuthRealm();
             //Note: This is type unsafe.
-            if (ar != null && "com.sun.enterprise.security.auth.realm.file.FileRealm".equals(ar.getClassname()))
+            if (ar != null && "com.sun.enterprise.security.auth.realm.file.FileRealm".equals(ar.getClassname())) {
                 usesFR = true;
+            }
             return usesFR;
         }
     }
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/AuditModule.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/AuditModule.java
index dd22685..82a5fb9 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/AuditModule.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/AuditModule.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,27 +17,27 @@
 
 package com.sun.enterprise.config.serverbeans;
 
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.ConfigBeanProxy;
-import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.Element;
+import com.sun.enterprise.config.serverbeans.customvalidators.JavaClassName;
+
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
 
 import java.beans.PropertyVetoException;
 import java.util.List;
 
+import org.glassfish.api.admin.RestRedirect;
+import org.glassfish.api.admin.RestRedirects;
 import org.glassfish.api.admin.config.PropertiesDesc;
+import org.glassfish.quality.ToDo;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.Element;
 import org.jvnet.hk2.config.types.Property;
 import org.jvnet.hk2.config.types.PropertyBag;
-import org.glassfish.api.admin.RestRedirects;
-import org.glassfish.api.admin.RestRedirect;
-import org.glassfish.quality.ToDo;
+
 import static org.glassfish.config.support.Constants.NAME_REGEX;
 
-import jakarta.validation.constraints.Pattern;
-import jakarta.validation.constraints.NotNull;
-
-import com.sun.enterprise.config.serverbeans.customvalidators.JavaClassName;
-
 /**
  * An audit-module specifies an optional plug-in module which implements audit capabilities.
  */
@@ -57,7 +58,7 @@
      */
     @Attribute(key = true)
     @NotNull
-    @Pattern(regexp = NAME_REGEX)
+    @Pattern(regexp = NAME_REGEX, message = "Pattern: " + NAME_REGEX)
     String getName();
 
     /**
@@ -87,6 +88,7 @@
     /**
      * Properties as per {@link PropertyBag}
      */
+    @Override
     @ToDo(priority = ToDo.Priority.IMPORTANT, details = "Provide PropertyDesc for legal props")
     @PropertiesDesc(props = {})
     @Element
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/AuthRealm.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/AuthRealm.java
index ffe4941..cc8127d 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/AuthRealm.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/AuthRealm.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,28 +17,42 @@
 
 package com.sun.enterprise.config.serverbeans;
 
-import com.sun.enterprise.config.serverbeans.customvalidators.*;
+import com.sun.enterprise.config.serverbeans.customvalidators.FileRealmPropertyCheck;
+import com.sun.enterprise.config.serverbeans.customvalidators.JDBCRealmPropertyCheck;
+import com.sun.enterprise.config.serverbeans.customvalidators.JavaClassName;
+import com.sun.enterprise.config.serverbeans.customvalidators.LDAPRealmPropertyCheck;
+import com.sun.enterprise.config.serverbeans.customvalidators.SolarisRealmPropertyCheck;
+
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
+
+import java.beans.PropertyVetoException;
+import java.util.List;
+
 import org.glassfish.api.admin.RestRedirect;
 import org.glassfish.api.admin.RestRedirects;
 import org.glassfish.api.admin.config.PropertiesDesc;
 import org.glassfish.api.admin.config.PropertyDesc;
-import org.jvnet.hk2.config.*;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.DuckTyped;
+import org.jvnet.hk2.config.Element;
 import org.jvnet.hk2.config.types.Property;
 import org.jvnet.hk2.config.types.PropertyBag;
-import static org.glassfish.config.support.Constants.NAME_REGEX;
 
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Pattern;
-import java.beans.PropertyVetoException;
-import java.util.List;
+import static org.glassfish.config.support.Constants.NAME_REGEX;
 
 @Configured
 @FileRealmPropertyCheck
 @LDAPRealmPropertyCheck
 @JDBCRealmPropertyCheck
 @SolarisRealmPropertyCheck
-@RestRedirects({ @RestRedirect(opType = RestRedirect.OpType.POST, commandName = "create-auth-realm"),
-        @RestRedirect(opType = RestRedirect.OpType.DELETE, commandName = "delete-auth-realm") })
+@RestRedirects({
+    @RestRedirect(opType = RestRedirect.OpType.POST, commandName = "create-auth-realm"),
+    @RestRedirect(opType = RestRedirect.OpType.DELETE, commandName = "delete-auth-realm")
+})
+
 /**
  * The auth-realm element defines and configures one authentication realm. There must be at least one realm available
  * for a server instance; any number can be configured, as desired. Authentication realms need provider-specific
@@ -54,7 +69,7 @@
      */
     @Attribute(key = true)
     @NotNull
-    @Pattern(regexp = NAME_REGEX)
+    @Pattern(regexp = NAME_REGEX, message = "Pattern: " + NAME_REGEX)
     String getName();
 
     /**
@@ -87,8 +102,9 @@
     class Duck {
         public static String getGroupMapping(AuthRealm me) {
             Property prop = me.getProperty("group-mapping"); //have to hard-code this, unfortunately :(
-            if (prop != null)
+            if (prop != null) {
                 return prop.getValue();
+            }
             return null;
         }
     }
@@ -96,6 +112,7 @@
     /**
      * Properties.
      */
+    @Override
     @PropertiesDesc(props = {
             @PropertyDesc(name = "jaas-context", description = "jaas-contextfile,jdbcSpecifies the JAAS (Java Authentication and Authorization Service) context"),
             @PropertyDesc(name = "file", defaultValue = "${com.sun.aas.instanceRoot}/config/keyfile", description = "file realm. Specifies the file that stores user names, passwords, and group names."),
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/BindableResource.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/BindableResource.java
index 1ca80f8..677596d 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/BindableResource.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/BindableResource.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -17,17 +18,21 @@
 package com.sun.enterprise.config.serverbeans;
 
 import com.sun.enterprise.config.serverbeans.customvalidators.ResourceNameConstraint;
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.DuckTyped;
 
-import java.beans.PropertyVetoException;
 import jakarta.validation.Payload;
-
 import jakarta.validation.constraints.NotNull;
 import jakarta.validation.constraints.Pattern;
 
+import java.beans.PropertyVetoException;
+
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.DuckTyped;
+
 @ResourceNameConstraint(message = "{resourcename.invalid.character}", payload = BindableResource.class)
 public interface BindableResource extends Resource, Payload {
+
+    String PATTERN_JNDI = "[^',][^',\\\\]*";
+
     /**
      * Gets the value of the jndiName property.
      *
@@ -35,15 +40,15 @@
      */
     @Attribute(key = true)
     @NotNull
-    @Pattern(regexp = "[^',][^',\\\\]*")
-    public String getJndiName();
+    @Pattern(regexp = PATTERN_JNDI, message = "Pattern: " + PATTERN_JNDI)
+    String getJndiName();
 
     /**
      * Sets the value of the jndiName property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setJndiName(String value) throws PropertyVetoException;
+    void setJndiName(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the enabled property.
@@ -60,6 +65,7 @@
      */
     void setEnabled(String value) throws PropertyVetoException;
 
+    @Override
     @DuckTyped
     String getIdentity();
 
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Cluster.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Cluster.java
index 4bfffa8..7e2df79 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Cluster.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Cluster.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,44 +17,14 @@
 
 package com.sun.enterprise.config.serverbeans;
 
-import com.sun.enterprise.config.serverbeans.customvalidators.NotTargetKeyword;
-import com.sun.enterprise.config.serverbeans.customvalidators.NotDuplicateTargetName;
 import com.sun.enterprise.config.serverbeans.customvalidators.ConfigRefConstraint;
 import com.sun.enterprise.config.serverbeans.customvalidators.ConfigRefValidator;
+import com.sun.enterprise.config.serverbeans.customvalidators.NotDuplicateTargetName;
+import com.sun.enterprise.config.serverbeans.customvalidators.NotTargetKeyword;
 import com.sun.enterprise.config.serverbeans.customvalidators.ReferenceConstraint;
 import com.sun.enterprise.config.util.ConfigApiLoggerInfo;
 import com.sun.enterprise.util.LocalStringManagerImpl;
 import com.sun.enterprise.util.io.FileUtils;
-import com.sun.logging.LogDomains;
-import java.io.*;
-import org.glassfish.api.ActionReport;
-import org.glassfish.api.I18n;
-import org.glassfish.api.Param;
-import org.glassfish.api.admin.*;
-import org.glassfish.config.support.*;
-import static org.glassfish.config.support.Constants.NAME_SERVER_REGEX;
-
-import org.jvnet.hk2.annotations.Service;
-import org.glassfish.hk2.api.PerLookup;
-import org.glassfish.hk2.api.ServiceLocator;
-import org.jvnet.hk2.config.*;
-import org.glassfish.api.admin.config.Named;
-import org.glassfish.api.admin.config.PropertyDesc;
-import org.glassfish.api.admin.config.ReferenceContainer;
-// import org.glassfish.virtualization.util.RuntimeContext;
-
-import java.beans.PropertyVetoException;
-import java.util.List;
-import java.util.ArrayList;
-import java.security.SecureRandom;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.glassfish.api.admin.config.PropertiesDesc;
-import org.jvnet.hk2.config.types.Property;
-import org.jvnet.hk2.config.types.PropertyBag;
-
-import org.glassfish.quality.ToDo;
 
 import jakarta.inject.Inject;
 import jakarta.validation.Payload;
@@ -62,12 +33,51 @@
 import jakarta.validation.constraints.NotNull;
 import jakarta.validation.constraints.Pattern;
 
+import java.beans.PropertyVetoException;
+import java.io.File;
+import java.security.SecureRandom;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.glassfish.api.ActionReport;
+import org.glassfish.api.I18n;
+import org.glassfish.api.Param;
+import org.glassfish.api.admin.AdminCommand;
+import org.glassfish.api.admin.AdminCommandContext;
+import org.glassfish.api.admin.CommandRunner;
+import org.glassfish.api.admin.ServerEnvironment;
+import org.glassfish.api.admin.config.Named;
+import org.glassfish.api.admin.config.PropertiesDesc;
+import org.glassfish.api.admin.config.PropertyDesc;
+import org.glassfish.api.admin.config.ReferenceContainer;
+import org.glassfish.config.support.CreationDecorator;
+import org.glassfish.config.support.DeletionDecorator;
+import org.glassfish.hk2.api.PerLookup;
+import org.glassfish.hk2.api.ServiceLocator;
+import org.glassfish.quality.ToDo;
+import org.jvnet.hk2.annotations.Service;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.ConfigSupport;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.Dom;
+import org.jvnet.hk2.config.DuckTyped;
+import org.jvnet.hk2.config.Element;
+import org.jvnet.hk2.config.SingleConfigCode;
+import org.jvnet.hk2.config.Transaction;
+import org.jvnet.hk2.config.TransactionFailure;
+import org.jvnet.hk2.config.types.Property;
+import org.jvnet.hk2.config.types.PropertyBag;
+
+import static org.glassfish.config.support.Constants.NAME_SERVER_REGEX;
+
 /**
  * A cluster defines a homogeneous set of server instances that share the same applications, resources, and
  * configuration.
  */
 @Configured
-@SuppressWarnings("unused")
 @ConfigRefConstraint(message = "{configref.invalid}", payload = ConfigRefValidator.class)
 @NotDuplicateTargetName(message = "{cluster.duplicate.name}", payload = Cluster.class)
 @ReferenceConstraint(skipDuringCreation = true, payload = Cluster.class)
@@ -80,13 +90,11 @@
      * @throws PropertyVetoException if a listener vetoes the change
      */
     @Param(name = "name", primary = true)
-    @Override
-    public void setName(String value) throws PropertyVetoException;
+    @Override void setName(String value) throws PropertyVetoException;
 
     @NotTargetKeyword(message = "{cluster.reserved.name}", payload = Cluster.class)
     @Pattern(regexp = NAME_SERVER_REGEX, message = "{cluster.invalid.name}", payload = Cluster.class)
-    @Override
-    public String getName();
+    @Override String getName();
 
     /**
      * points to a named config. All server instances in the cluster will share this config.
@@ -95,7 +103,7 @@
      */
     @Attribute
     @NotNull
-    @Pattern(regexp = NAME_SERVER_REGEX)
+    @Pattern(regexp = NAME_SERVER_REGEX, message = "{config.invalid.name}")
     @ReferenceConstraint.RemoteKey(message = "{resourceref.invalid.configref}", type = Config.class)
     String getConfigRef();
 
@@ -334,8 +342,7 @@
     @DuckTyped
     List<Server> getInstances();
 
-    @DuckTyped
-    public ServerRef getServerRefByRef(String ref);
+    @DuckTyped ServerRef getServerRefByRef(String ref);
 
     // four trivial methods that ReferenceContainer's need to implement
     @DuckTyped
@@ -408,7 +415,7 @@
             Dom clusterDom = Dom.unwrap(cluster);
             Domain domain = clusterDom.getHabitat().getService(Domain.class);
 
-            ArrayList<Server> instances = new ArrayList<Server>();
+            ArrayList<Server> instances = new ArrayList<>();
             for (ServerRef sRef : cluster.getServerRef()) {
                 Server svr = domain.getServerNamed(sRef.getRef());
                 // the instance's domain.xml only has its own server
@@ -456,6 +463,7 @@
             if (ref != null) {
                 ConfigSupport.apply(new SingleConfigCode<Cluster>() {
 
+                    @Override
                     public Object run(Cluster param) {
                         return param.getResourceRef().remove(ref);
                     }
@@ -467,6 +475,7 @@
 
             ConfigSupport.apply(new SingleConfigCode<Cluster>() {
 
+                @Override
                 public Object run(Cluster param) throws PropertyVetoException, TransactionFailure {
 
                     ResourceRef newResourceRef = param.createChild(ResourceRef.class);
@@ -479,7 +488,7 @@
         }
 
         public static <T extends ClusterExtension> List<T> getExtensionsByType(Cluster cluster, Class<T> type) {
-            List<T> extensions = new ArrayList<T>();
+            List<T> extensions = new ArrayList<>();
             for (ClusterExtension ce : cluster.getExtensions()) {
                 try {
                     type.cast(ce);
@@ -829,8 +838,9 @@
 
             // check if the config is null or still in use by some other
             // ReferenceContainer or is not <cluster-name>-config -- if so just return...
-            if (config == null || domain.getReferenceContainersOf(config).size() > 1 || !instanceConfig.equals(child.getName() + "-config"))
+            if (config == null || domain.getReferenceContainersOf(config).size() > 1 || !instanceConfig.equals(child.getName() + "-config")) {
                 return;
+            }
 
             try {
                 File configConfigDir = new File(env.getConfigDirPath(), config.getName());
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ClusterRef.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ClusterRef.java
index 588aa7a..de372c6 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ClusterRef.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ClusterRef.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -17,18 +18,22 @@
 package com.sun.enterprise.config.serverbeans;
 
 import com.sun.enterprise.config.serverbeans.customvalidators.ReferenceConstraint;
+
 import jakarta.validation.Payload;
-import org.jvnet.hk2.config.*;
-import static org.glassfish.config.support.Constants.NAME_SERVER_REGEX;
-
-import java.beans.PropertyVetoException;
-
 import jakarta.validation.constraints.NotNull;
 import jakarta.validation.constraints.Pattern;
 
+import java.beans.PropertyVetoException;
+
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.Element;
+
+import static org.glassfish.config.support.Constants.NAME_SERVER_REGEX;
+
 /**
  * Element relating a reference to a cluster to be load balanced to an (optional) health-checker
- *
  */
 
 /* @XmlType(name = "", propOrder = {
@@ -47,17 +52,16 @@
     @Override
     @Attribute(key = true)
     @NotNull
-    @Pattern(regexp = NAME_SERVER_REGEX)
+    @Pattern(regexp = NAME_SERVER_REGEX, message = "{config.invalid.name}")
     @ReferenceConstraint.RemoteKey(message = "{resourceref.invalid.cluster-ref}", type = Cluster.class)
-    public String getRef();
+    String getRef();
 
     /**
      * Sets the value of the ref property.
      *
      * @param value allowed object is {@link String }
      */
-    @Override
-    public void setRef(String value) throws PropertyVetoException;
+    @Override void setRef(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the lbPolicy property.
@@ -70,14 +74,14 @@
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "round-robin")
-    public String getLbPolicy();
+    String getLbPolicy();
 
     /**
      * Sets the value of the lbPolicy property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setLbPolicy(String value) throws PropertyVetoException;
+    void setLbPolicy(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the lbPolicyModule property.
@@ -89,14 +93,14 @@
      * @return possible object is {@link String }
      */
     @Attribute
-    public String getLbPolicyModule();
+    String getLbPolicyModule();
 
     /**
      * Sets the value of the lbPolicyModule property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setLbPolicyModule(String value) throws PropertyVetoException;
+    void setLbPolicyModule(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the healthChecker property.
@@ -106,12 +110,12 @@
      * @return possible object is {@link HealthChecker }
      */
     @Element
-    public HealthChecker getHealthChecker();
+    HealthChecker getHealthChecker();
 
     /**
      * Sets the value of the healthChecker property.
      *
      * @param value allowed object is {@link HealthChecker }
      */
-    public void setHealthChecker(HealthChecker value) throws PropertyVetoException;
+    void setHealthChecker(HealthChecker value) throws PropertyVetoException;
 }
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Config.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Config.java
index a48383a..a01b3b5 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Config.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Config.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -17,10 +18,21 @@
 package com.sun.enterprise.config.serverbeans;
 
 import com.sun.common.util.logging.LoggingConfigImpl;
-import com.sun.enterprise.config.modularity.parser.ModuleConfigurationLoader;
 import com.sun.enterprise.config.serverbeans.customvalidators.NotDuplicateTargetName;
 import com.sun.enterprise.config.serverbeans.customvalidators.NotTargetKeyword;
 import com.sun.enterprise.config.util.ServerHelper;
+
+import jakarta.validation.Payload;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
+
+import java.beans.PropertyVetoException;
+import java.io.IOException;
+import java.lang.reflect.Proxy;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 import org.glassfish.api.admin.config.ConfigExtension;
 import org.glassfish.api.admin.config.Container;
 import org.glassfish.api.admin.config.Named;
@@ -29,26 +41,25 @@
 import org.glassfish.config.support.datatypes.Port;
 import org.glassfish.grizzly.config.dom.NetworkConfig;
 import org.glassfish.grizzly.config.dom.NetworkListener;
-import org.glassfish.hk2.api.ActiveDescriptor;
 import org.glassfish.hk2.api.ServiceLocator;
 import org.glassfish.hk2.utilities.BuilderHelper;
 import org.glassfish.hk2.utilities.ServiceLocatorUtilities;
 import org.glassfish.quality.ToDo;
 import org.glassfish.server.ServerEnvironmentImpl;
-import org.jvnet.hk2.config.*;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBean;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.ConfigExtensionMethod;
+import org.jvnet.hk2.config.ConfigSupport;
+import org.jvnet.hk2.config.ConfigView;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.DuckTyped;
+import org.jvnet.hk2.config.Element;
+import org.jvnet.hk2.config.SingleConfigCode;
+import org.jvnet.hk2.config.TransactionFailure;
 import org.jvnet.hk2.config.types.Property;
 import org.jvnet.hk2.config.types.PropertyBag;
 
-import jakarta.validation.Payload;
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Pattern;
-import java.beans.PropertyVetoException;
-import java.io.IOException;
-import java.lang.reflect.Proxy;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
 import static org.glassfish.config.support.Constants.NAME_SERVER_REGEX;
 
 /**
@@ -373,8 +384,9 @@
             try {
                 String type = c.getAdminService().getType();
 
-                if (type != null && (type.equals("das") || type.equals("das-and-server")))
+                if (type != null && (type.equals("das") || type.equals("das-and-server"))) {
                     return true;
+                }
             } catch (Exception e) {
                 // fall through
             }
@@ -401,7 +413,7 @@
             LoggingConfigImpl loggingConfig = new LoggingConfigImpl();
             loggingConfig.setupConfigDir(env.getConfigDirPath(), env.getLibPath());
 
-            Map<String, String> map = new HashMap<String, String>();
+            Map<String, String> map = new HashMap<>();
             try {
                 map = loggingConfig.getLoggingProperties();
             } catch (IOException ex) {
@@ -415,7 +427,7 @@
             LoggingConfigImpl loggingConfig = new LoggingConfigImpl();
             loggingConfig.setupConfigDir(env.getConfigDirPath(), env.getLibPath());
 
-            Map<String, String> map = new HashMap<String, String>();
+            Map<String, String> map = new HashMap<>();
             try {
                 map = loggingConfig.updateLoggingProperties(properties);
             } catch (IOException ex) {
@@ -463,6 +475,7 @@
         public static void createResourceRef(Config config, final String enabled, final String refName) throws TransactionFailure {
             ConfigSupport.apply(new SingleConfigCode<Config>() {
 
+                @Override
                 public Object run(Config param) throws PropertyVetoException, TransactionFailure {
 
                     ResourceRef newResourceRef = param.createChild(ResourceRef.class);
@@ -492,6 +505,7 @@
             if (ref != null) {
                 ConfigSupport.apply(new SingleConfigCode<Config>() {
 
+                    @Override
                     public Object run(Config param) {
                         return param.getResourceRef().remove(ref);
                     }
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Domain.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Domain.java
index f5eedd5..7a50092 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Domain.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Domain.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,9 +17,20 @@
 
 package com.sun.enterprise.config.serverbeans;
 
-import com.sun.enterprise.config.modularity.parser.ModuleConfigurationLoader;
 import com.sun.enterprise.config.util.ConfigApiLoggerInfo;
 import com.sun.enterprise.util.StringUtils;
+
+import jakarta.validation.constraints.NotNull;
+
+import java.beans.PropertyVetoException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
 import org.glassfish.api.admin.config.ApplicationName;
 import org.glassfish.api.admin.config.PropertiesDesc;
 import org.glassfish.api.admin.config.PropertyDesc;
@@ -30,20 +42,9 @@
 import org.jvnet.hk2.config.Configured;
 import org.jvnet.hk2.config.DuckTyped;
 import org.jvnet.hk2.config.Element;
-import org.jvnet.hk2.config.TransactionFailure;
 import org.jvnet.hk2.config.types.Property;
 import org.jvnet.hk2.config.types.PropertyBag;
 
-import jakarta.validation.constraints.NotNull;
-import java.beans.PropertyVetoException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
 @Configured
 /**
  * Top level Domain Element that includes applications, resources, configs, servers, clusters and node-agents, load
@@ -52,7 +53,7 @@
  */
 public interface Domain extends ConfigBeanProxy, PropertyBag, SystemPropertyBag, ConfigLoader {
 
-    public static final String DOMAIN_NAME_PROPERTY = "administrative.domain.name";
+    String DOMAIN_NAME_PROPERTY = "administrative.domain.name";
 
     /**
      * Gets the value of the applicationRoot property.
@@ -269,6 +270,7 @@
      * <p/>
      * Objects of the following type(s) are allowed in the list {@link SystemProperty }
      */
+    @Override
     @ToDo(priority = ToDo.Priority.IMPORTANT, details = "Any more legal system properties?")
     @PropertiesDesc(systemProperties = true, props = {
             @PropertyDesc(name = "com.sun.aas.installRoot", description = "Operating system dependent. Path to the directory where the server is installed"),
@@ -294,6 +296,7 @@
     /**
      * Properties as per {@link PropertyBag}
      */
+    @Override
     @ToDo(priority = ToDo.Priority.IMPORTANT, details = "Provide PropertyDesc for legal props")
     @PropertiesDesc(props = {})
     @Element
@@ -376,8 +379,7 @@
     @DuckTyped
     List<String> getAllTargets();
 
-    @DuckTyped
-    public List<String> getTargets(final String tgt);
+    @DuckTyped List<String> getTargets(final String tgt);
 
     @DuckTyped
     List<Application> getApplicationsInTarget(String target);
@@ -428,16 +430,18 @@
          * or if no matches
          */
         public static List<Server> getInstancesOnNode(Domain domain, String nodeName) {
-            List<Server> ret = new LinkedList<Server>();
+            List<Server> ret = new LinkedList<>();
             try {
-                if (!StringUtils.ok(nodeName))
+                if (!StringUtils.ok(nodeName)) {
                     return ret;
+                }
 
                 List<Server> servers = domain.getServers().getServer();
 
                 for (Server server : servers) {
-                    if (nodeName.equals(server.getNodeRef()))
+                    if (nodeName.equals(server.getNodeRef())) {
                         ret.add(server);
+                    }
                 }
             } catch (Exception e) {
                 logger.log(Level.WARNING, ConfigApiLoggerInfo.errorGettingServers, e.getLocalizedMessage());
@@ -450,7 +454,7 @@
          */
         public static List<Cluster> getClustersOnNode(Domain domain, String nodeName) {
 
-            HashMap<String, Cluster> clMap = new HashMap<String, Cluster>();
+            HashMap<String, Cluster> clMap = new HashMap<>();
             List<Server> serverList = getInstancesOnNode(domain, nodeName);
 
             try {
@@ -468,12 +472,13 @@
         }
 
         public static List<Application> getAllDefinedSystemApplications(Domain me) {
-            List<Application> allSysApps = new ArrayList<Application>();
+            List<Application> allSysApps = new ArrayList<>();
             SystemApplications sa = me.getSystemApplications();
             if (sa != null) {
                 for (ApplicationName m : sa.getModules()) {
-                    if (m instanceof Application)
+                    if (m instanceof Application) {
                         allSysApps.add((Application) m);
+                    }
                 }
             }
             return Collections.unmodifiableList(allSysApps);
@@ -512,14 +517,17 @@
         }
 
         public static List<Application> getSystemApplicationsReferencedFrom(Domain d, String sn) {
-            if (d == null || sn == null)
+            if (d == null || sn == null) {
                 throw new IllegalArgumentException("Null argument");
+            }
             List<Application> allApps = d.getAllDefinedSystemApplications();
             if (allApps.isEmpty())
+             {
                 return allApps; //if there are no sys-apps, none can reference one :)
+            }
             //allApps now contains ALL the system applications
             Server s = getServerNamed(d, sn);
-            List<Application> referencedApps = new ArrayList<Application>();
+            List<Application> referencedApps = new ArrayList<>();
             List<ApplicationRef> appsReferenced = s.getApplicationRef();
             for (ApplicationRef ref : appsReferenced) {
                 for (Application app : allApps) {
@@ -545,15 +553,17 @@
         public static boolean isNamedSystemApplicationReferencedFrom(Domain d, String appName, String serverName) {
             List<Application> referencedApps = getSystemApplicationsReferencedFrom(d, serverName);
             for (Application app : referencedApps) {
-                if (app.getName().equals(appName))
+                if (app.getName().equals(appName)) {
                     return true;
+                }
             }
             return false;
         }
 
         public static Server getServerNamed(Domain d, String name) {
-            if (d.getServers() == null || name == null)
+            if (d.getServers() == null || name == null) {
                 throw new IllegalArgumentException("no <servers> element");
+            }
             List<Server> servers = d.getServers().getServer();
             for (Server s : servers) {
                 if (name.equals(s.getName().trim())) {
@@ -564,8 +574,9 @@
         }
 
         public static Config getConfigNamed(Domain d, String name) {
-            if (d.getConfigs() == null || name == null)
+            if (d.getConfigs() == null || name == null) {
                 throw new IllegalArgumentException("no <config> element");
+            }
             List<Config> configs = d.getConfigs().getConfig();
             for (Config c : configs) {
                 if (name.equals(c.getName().trim())) {
@@ -608,7 +619,7 @@
                 return false;
             }
 
-            List<String> targets = new ArrayList<String>();
+            List<String> targets = new ArrayList<>();
             if (!target.equals("domain")) {
                 targets.add(target);
             } else {
@@ -639,7 +650,7 @@
         }
 
         public static List<Server> getServersInTarget(Domain me, String target) {
-            List<Server> servers = new ArrayList<Server>();
+            List<Server> servers = new ArrayList<>();
             Server server = me.getServerNamed(target);
             if (server != null) {
                 servers.add(server);
@@ -657,7 +668,7 @@
         }
 
         public static List<String> getTargets(final Domain me, final String tgt) {
-            List<String> targets = new ArrayList<String>();
+            List<String> targets = new ArrayList<>();
             if (!tgt.equals("domain")) {
                 targets.add(tgt);
             } else {
@@ -668,7 +679,7 @@
 
         public static List<ApplicationRef> getApplicationRefsInTarget(Domain me, String tgt, boolean includeInstances) {
             List<String> targets = getTargets(me, tgt);
-            List<ApplicationRef> allAppRefs = new ArrayList<ApplicationRef>();
+            List<ApplicationRef> allAppRefs = new ArrayList<>();
 
             for (String target : targets) {
                 Server server = me.getServerNamed(target);
@@ -731,7 +742,7 @@
         public static boolean isAppEnabledInTarget(Domain me, String appName, String target) {
             Application application = me.getApplications().getApplication(appName);
             if (application != null && Boolean.valueOf(application.getEnabled())) {
-                List<String> targets = new ArrayList<String>();
+                List<String> targets = new ArrayList<>();
                 if (!target.equals("domain")) {
                     targets.add(target);
                 } else {
@@ -748,7 +759,7 @@
         }
 
         public static List<String> getAllTargets(Domain d) {
-            List<String> targets = new ArrayList<String>();
+            List<String> targets = new ArrayList<>();
             // only add non-clustered servers as the cluster
             // targets will be separately added
             for (Server server : d.getServers().getServer()) {
@@ -765,7 +776,7 @@
         }
 
         public static List<String> getAllReferencedTargetsForApplication(Domain me, String appName) {
-            List<String> referencedTargets = new ArrayList<String>();
+            List<String> referencedTargets = new ArrayList<>();
             for (String target : me.getAllTargets()) {
                 if (me.getApplicationRefInTarget(appName, target) != null) {
                     referencedTargets.add(target);
@@ -793,7 +804,7 @@
                 return me.getApplications().getApplications();
             }
 
-            List<Application> apps = new ArrayList<Application>();
+            List<Application> apps = new ArrayList<>();
 
             List<ApplicationRef> applicationRefs = me.getApplicationRefsInTarget(target);
             for (ApplicationRef ref : applicationRefs) {
@@ -827,36 +838,40 @@
             // Clusters and Servers are ReferenceContainers
             Cluster c = getClusterNamed(d, name);
 
-            if (c != null)
+            if (c != null) {
                 return c;
+            }
 
             return getServerNamed(d, name);
         }
 
         public static List<ReferenceContainer> getReferenceContainersOf(Domain d, Config config) {
             // Clusters and Servers are ReferenceContainers
-            List<ReferenceContainer> sub = new LinkedList<ReferenceContainer>();
+            List<ReferenceContainer> sub = new LinkedList<>();
 
             // both the config and its name need to be sanity-checked
             String name = null;
 
-            if (config != null)
+            if (config != null) {
                 name = config.getName();
+            }
 
-            if (!StringUtils.ok(name)) // we choose to make this not an error
+            if (!StringUtils.ok(name)) { // we choose to make this not an error
                 return sub;
+            }
 
             List<ReferenceContainer> all = getAllReferenceContainers(d);
 
             for (ReferenceContainer rc : all) {
-                if (name.equals(rc.getReference()))
+                if (name.equals(rc.getReference())) {
                     sub.add(rc);
+                }
             }
             return sub;
         }
 
         public static List<ReferenceContainer> getAllReferenceContainers(Domain d) {
-            List<ReferenceContainer> ReferenceContainers = new LinkedList<ReferenceContainer>();
+            List<ReferenceContainer> ReferenceContainers = new LinkedList<>();
             ReferenceContainers.addAll(d.getServers().getServer());
             if (d.getClusters() != null) {
                 ReferenceContainers.addAll(d.getClusters().getCluster());
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/HttpService.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/HttpService.java
index d4a6eb8..af5eb5f 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/HttpService.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/HttpService.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,23 +17,33 @@
 
 package com.sun.enterprise.config.serverbeans;
 
-import java.beans.PropertyVetoException;
-import java.util.*;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
 import com.sun.enterprise.config.util.ConfigApiLoggerInfo;
-import org.glassfish.api.admin.config.ConfigExtension;
-import org.jvnet.hk2.config.*;
-import org.jvnet.hk2.config.types.Property;
-import org.jvnet.hk2.config.types.PropertyBag;
-import org.glassfish.api.admin.config.PropertiesDesc;
-import org.glassfish.api.admin.config.PropertyDesc;
-import org.glassfish.config.support.datatypes.NonNegativeInteger;
 
 import jakarta.validation.constraints.NotNull;
 import jakarta.validation.constraints.Pattern;
 
+import java.beans.PropertyVetoException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.glassfish.api.admin.config.ConfigExtension;
+import org.glassfish.api.admin.config.PropertiesDesc;
+import org.glassfish.api.admin.config.PropertyDesc;
+import org.glassfish.config.support.datatypes.NonNegativeInteger;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.ConfigSupport;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.DuckTyped;
+import org.jvnet.hk2.config.Element;
+import org.jvnet.hk2.config.SingleConfigCode;
+import org.jvnet.hk2.config.TransactionFailure;
+import org.jvnet.hk2.config.types.Property;
+import org.jvnet.hk2.config.types.PropertyBag;
+
 @Configured
 public interface HttpService extends ConfigBeanProxy, PropertyBag, ConfigExtension {
 
@@ -81,7 +92,7 @@
     List<String> getNonAdminVirtualServerList();
 
     @Attribute(defaultValue = "false")
-    @Pattern(regexp = "(false|true|on|off)")
+    @Pattern(regexp = "(false|true|on|off)", message = "Valid values: true|false")
     String getAccessLoggingEnabled();
 
     void setAccessLoggingEnabled(String enabled);
@@ -96,7 +107,7 @@
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "false")
-    @Pattern(regexp = "(true|false|on|off)")
+    @Pattern(regexp = "(true|false|on|off)", message = "Valid values: true|false")
     String getSsoEnabled();
 
     /**
@@ -119,7 +130,7 @@
         }
 
         public static List<String> getNonAdminVirtualServerList(HttpService target) {
-            List<String> nonAdminVSList = new ArrayList<String>();
+            List<String> nonAdminVSList = new ArrayList<>();
             for (VirtualServer v : target.getVirtualServer()) {
                 if (!v.getId().equals("__asadmin")) {
                     nonAdminVSList.add(v.getId());
@@ -162,6 +173,7 @@
         }
     }
 
+    @Override
     @PropertiesDesc(props = {
             @PropertyDesc(name = "monitoring-cache-enabled", defaultValue = "true", dataType = Boolean.class, description = "Enables the monitoring cache"),
 
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/MessageSecurityConfig.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/MessageSecurityConfig.java
index 908b8aa..7525eb9 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/MessageSecurityConfig.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/MessageSecurityConfig.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,20 +17,19 @@
 
 package com.sun.enterprise.config.serverbeans;
 
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.Element;
-import org.jvnet.hk2.config.ConfigBeanProxy;
-
-import java.beans.PropertyVetoException;
-import java.io.Serializable;
-import java.util.List;
-
 import jakarta.validation.constraints.NotNull;
 import jakarta.validation.constraints.Pattern;
 
-import org.glassfish.api.admin.RestRedirects;
+import java.beans.PropertyVetoException;
+import java.util.List;
+
 import org.glassfish.api.admin.RestRedirect;
+import org.glassfish.api.admin.RestRedirects;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.Element;
+
 import static org.glassfish.config.support.Constants.NAME_REGEX;
 
 /**
@@ -43,8 +43,10 @@
 }) */
 
 @Configured
-@RestRedirects({ @RestRedirect(opType = RestRedirect.OpType.POST, commandName = "create-message-security-provider"),
-        @RestRedirect(opType = RestRedirect.OpType.DELETE, commandName = "delete-message-security-provider") })
+@RestRedirects({
+    @RestRedirect(opType = RestRedirect.OpType.POST, commandName = "create-message-security-provider"),
+    @RestRedirect(opType = RestRedirect.OpType.DELETE, commandName = "delete-message-security-provider")
+})
 public interface MessageSecurityConfig extends ConfigBeanProxy {
 
     /**
@@ -57,14 +59,14 @@
      */
     @Attribute(key = true)
     @NotNull
-    public String getAuthLayer();
+    String getAuthLayer();
 
     /**
      * Sets the value of the authLayer property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setAuthLayer(String value) throws PropertyVetoException;
+    void setAuthLayer(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the defaultProvider property.
@@ -78,15 +80,15 @@
      * @return possible object is {@link String }
      */
     @Attribute
-    @Pattern(regexp = NAME_REGEX)
-    public String getDefaultProvider();
+    @Pattern(regexp = NAME_REGEX, message = "Pattern: " + NAME_REGEX)
+    String getDefaultProvider();
 
     /**
      * Sets the value of the defaultProvider property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setDefaultProvider(String value) throws PropertyVetoException;
+    void setDefaultProvider(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the defaultClientProvider property.
@@ -97,15 +99,15 @@
      * @return possible object is {@link String }
      */
     @Attribute
-    @Pattern(regexp = NAME_REGEX)
-    public String getDefaultClientProvider();
+    @Pattern(regexp = NAME_REGEX, message = "Pattern: " + NAME_REGEX)
+    String getDefaultClientProvider();
 
     /**
      * Sets the value of the defaultClientProvider property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setDefaultClientProvider(String value) throws PropertyVetoException;
+    void setDefaultClientProvider(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the providerConfig property.
@@ -127,5 +129,5 @@
      * Objects of the following type(s) are allowed in the list {@link ProviderConfig }
      */
     @Element(required = true)
-    public List<ProviderConfig> getProviderConfig();
+    List<ProviderConfig> getProviderConfig();
 }
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ModuleMonitoringLevels.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ModuleMonitoringLevels.java
index 12506c9..e3a96fc 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ModuleMonitoringLevels.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ModuleMonitoringLevels.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,22 +17,20 @@
 
 package com.sun.enterprise.config.serverbeans;
 
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.ConfigBeanProxy;
-import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.Element;
+import jakarta.validation.constraints.Pattern;
 
 import java.beans.PropertyVetoException;
 import java.util.List;
 
 import org.glassfish.api.admin.config.PropertiesDesc;
+import org.glassfish.quality.ToDo;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.Element;
 import org.jvnet.hk2.config.types.Property;
 import org.jvnet.hk2.config.types.PropertyBag;
 
-import org.glassfish.quality.ToDo;
-
-import jakarta.validation.constraints.Pattern;
-
 /**
  *
  */
@@ -43,59 +42,59 @@
 @Configured
 public interface ModuleMonitoringLevels extends ConfigBeanProxy, PropertyBag {
 
+    String MONITORING_LEVELS = "(OFF|LOW|HIGH)";
+    String MONITORING_LEVELS_MSG = "Valid values: " + MONITORING_LEVELS;
+
     /**
      * Gets the value of the threadPool property.
-     *
      * All the thread-pools used by the run time
      *
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "OFF")
-    @Pattern(regexp = "(OFF|LOW|HIGH)")
-    public String getThreadPool();
+    @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+    String getThreadPool();
 
     /**
      * Sets the value of the threadPool property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setThreadPool(String value) throws PropertyVetoException;
+    void setThreadPool(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the orb property.
-     *
      * Specifies the level for connection managers of the orb, which apply to connections to the orb
      *
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "OFF")
-    @Pattern(regexp = "(OFF|LOW|HIGH)")
-    public String getOrb();
+    @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+    String getOrb();
 
     /**
      * Sets the value of the orb property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setOrb(String value) throws PropertyVetoException;
+    void setOrb(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the ejbContainer property.
-     *
      * Various ejbs deployed to the server, ejb-pools, ejb-caches & ejb-methods
      *
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "OFF")
-    @Pattern(regexp = "(OFF|LOW|HIGH)")
-    public String getEjbContainer();
+    @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+    String getEjbContainer();
 
     /**
      * Sets the value of the ejbContainer property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setEjbContainer(String value) throws PropertyVetoException;
+    void setEjbContainer(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the webContainer property.
@@ -103,15 +102,15 @@
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "OFF")
-    @Pattern(regexp = "(OFF|LOW|HIGH)")
-    public String getWebContainer();
+    @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+    String getWebContainer();
 
     /**
      * Sets the value of the webContainer property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setWebContainer(String value) throws PropertyVetoException;
+    void setWebContainer(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the deployment property.
@@ -119,87 +118,83 @@
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "OFF")
-    @Pattern(regexp = "(OFF|LOW|HIGH)")
-    public String getDeployment();
+    @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+    String getDeployment();
 
     /**
      * Sets the value of the webContainer property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setDeployment(String value) throws PropertyVetoException;
+    void setDeployment(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the transactionService property.
-     *
      * Transaction subsystem
      *
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "OFF")
-    @Pattern(regexp = "(OFF|LOW|HIGH)")
-    public String getTransactionService();
+    @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+    String getTransactionService();
 
     /**
      * Sets the value of the transactionService property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setTransactionService(String value) throws PropertyVetoException;
+    void setTransactionService(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the httpService property.
-     *
      * http engine and the http listeners therein.
      *
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "OFF")
-    @Pattern(regexp = "(OFF|LOW|HIGH)")
-    public String getHttpService();
+    @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+    String getHttpService();
 
     /**
      * Sets the value of the httpService property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setHttpService(String value) throws PropertyVetoException;
+    void setHttpService(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the jdbcConnectionPool property.
-     *
      * Monitoring level for all the jdbc-connection-pools used by the runtime.
      *
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "OFF")
-    @Pattern(regexp = "(OFF|LOW|HIGH)")
-    public String getJdbcConnectionPool();
+    @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+    String getJdbcConnectionPool();
 
     /**
      * Sets the value of the jdbcConnectionPool property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setJdbcConnectionPool(String value) throws PropertyVetoException;
+    void setJdbcConnectionPool(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the connectorConnectionPool property.
-     *
      * Monitoring level for all the connector-connection-pools used by runtime.
      *
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "OFF")
-    @Pattern(regexp = "(OFF|LOW|HIGH)")
-    public String getConnectorConnectionPool();
+    @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+    String getConnectorConnectionPool();
 
     /**
      * Sets the value of the connectorConnectionPool property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setConnectorConnectionPool(String value) throws PropertyVetoException;
+    void setConnectorConnectionPool(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the connectorService property.
@@ -207,15 +202,15 @@
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "OFF")
-    @Pattern(regexp = "(OFF|LOW|HIGH)")
-    public String getConnectorService();
+    @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+    String getConnectorService();
 
     /**
      * Sets the value of the connectorService property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setConnectorService(String value) throws PropertyVetoException;
+    void setConnectorService(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the jmsService property.
@@ -223,15 +218,15 @@
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "OFF")
-    @Pattern(regexp = "(OFF|LOW|HIGH)")
-    public String getJmsService();
+    @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+    String getJmsService();
 
     /**
      * Sets the value of the jmsService property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setJmsService(String value) throws PropertyVetoException;
+    void setJmsService(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the jvm property.
@@ -239,15 +234,15 @@
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "OFF")
-    @Pattern(regexp = "(OFF|LOW|HIGH)")
-    public String getJvm();
+    @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+    String getJvm();
 
     /**
      * Sets the value of the jvm property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setJvm(String value) throws PropertyVetoException;
+    void setJvm(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the security property.
@@ -255,15 +250,15 @@
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "OFF")
-    @Pattern(regexp = "(OFF|LOW|HIGH)")
-    public String getSecurity();
+    @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+    String getSecurity();
 
     /**
      * Sets the value of the security property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setSecurity(String value) throws PropertyVetoException;
+    void setSecurity(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the web-service-container property.
@@ -271,15 +266,15 @@
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "OFF")
-    @Pattern(regexp = "(OFF|LOW|HIGH)")
-    public String getWebServicesContainer();
+    @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+    String getWebServicesContainer();
 
     /**
      * Sets the value of the web-service-container property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setWebServicesContainer(String value) throws PropertyVetoException;
+    void setWebServicesContainer(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the jpa property.
@@ -287,15 +282,15 @@
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "OFF")
-    @Pattern(regexp = "(OFF|LOW|HIGH)")
-    public String getJpa();
+    @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+    String getJpa();
 
     /**
      * Sets the value of the jpa property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setJpa(String value) throws PropertyVetoException;
+    void setJpa(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the jax-ra property.
@@ -303,15 +298,15 @@
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "OFF")
-    @Pattern(regexp = "(OFF|LOW|HIGH)")
-    public String getJersey();
+    @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+    String getJersey();
 
     /**
      * Sets the value of the jax-ra property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setJersey(String value) throws PropertyVetoException;
+    void setJersey(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the cloudTenantManager property.
@@ -319,15 +314,15 @@
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "OFF")
-    @Pattern(regexp = "(OFF|LOW|HIGH)")
-    public String getCloudTenantManager();
+    @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+    String getCloudTenantManager();
 
     /**
      * Sets the value of the cloudTenantManager property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setCloudTenantManager(String value) throws PropertyVetoException;
+    void setCloudTenantManager(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the cloud property.
@@ -335,15 +330,15 @@
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "OFF")
-    @Pattern(regexp = "(OFF|LOW|HIGH)")
-    public String getCloud();
+    @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+    String getCloud();
 
     /**
      * Sets the value of the cloud property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setCloud(String value) throws PropertyVetoException;
+    void setCloud(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the cloud Orchestrator property.
@@ -351,15 +346,15 @@
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "OFF")
-    @Pattern(regexp = "(OFF|LOW|HIGH)")
-    public String getCloudOrchestrator();
+    @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+    String getCloudOrchestrator();
 
     /**
      * Sets the value of the cloud Orchestrator property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setCloudOrchestrator(String value) throws PropertyVetoException;
+    void setCloudOrchestrator(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the cloud Elasticity property.
@@ -367,19 +362,15 @@
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "OFF")
-    @Pattern(regexp = "(OFF|LOW|HIGH)")
-    public String getCloudElasticity();
+    @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+    String getCloudElasticity();
 
     /**
      * Sets the value of the cloud elasticity property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setCloudElasticity(String value) throws PropertyVetoException;
-
-    /**
-     * Properties as per {@link PropertyBag}
-     */
+    void setCloudElasticity(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the cloud IMS property.
@@ -387,20 +378,20 @@
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "OFF")
-    @Pattern(regexp = "(OFF|LOW|HIGH)")
-    public String getCloudVirtAssemblyService();
+    @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+    String getCloudVirtAssemblyService();
 
     /**
      * Sets the value of the cloud IMS property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setCloudVirtAssemblyService(String value) throws PropertyVetoException;
+    void setCloudVirtAssemblyService(String value) throws PropertyVetoException;
 
     /**
      * Properties as per {@link PropertyBag}
      */
-
+    @Override
     @ToDo(priority = ToDo.Priority.IMPORTANT, details = "Provide PropertyDesc for legal props")
     @PropertiesDesc(props = {})
     @Element
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Profiler.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Profiler.java
index b6a33ba..83bec43 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Profiler.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Profiler.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,23 +17,22 @@
 
 package com.sun.enterprise.config.serverbeans;
 
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.Element;
-import org.jvnet.hk2.config.ConfigBeanProxy;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
 
 import java.beans.PropertyVetoException;
 import java.util.List;
 
 import org.glassfish.api.admin.config.PropertiesDesc;
-import static org.glassfish.config.support.Constants.NAME_REGEX;
+import org.glassfish.quality.ToDo;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.Element;
 import org.jvnet.hk2.config.types.Property;
 import org.jvnet.hk2.config.types.PropertyBag;
 
-import org.glassfish.quality.ToDo;
-
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Pattern;
+import static org.glassfish.config.support.Constants.NAME_REGEX;
 
 /**
  *
@@ -59,15 +59,15 @@
      */
     @Attribute(key = false) // bizarre case of having a name, but it's not a key; it's a singleton
     @NotNull
-    @Pattern(regexp = NAME_REGEX)
-    public String getName();
+    @Pattern(regexp = NAME_REGEX, message = "Pattern: " + NAME_REGEX)
+    String getName();
 
     /**
      * Sets the value of the name property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setName(String value) throws PropertyVetoException;
+    void setName(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the classpath property.
@@ -75,14 +75,14 @@
      * @return possible object is {@link String }
      */
     @Attribute
-    public String getClasspath();
+    String getClasspath();
 
     /**
      * Sets the value of the classpath property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setClasspath(String value) throws PropertyVetoException;
+    void setClasspath(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the nativeLibraryPath property.
@@ -90,14 +90,14 @@
      * @return possible object is {@link String }
      */
     @Attribute
-    public String getNativeLibraryPath();
+    String getNativeLibraryPath();
 
     /**
      * Sets the value of the nativeLibraryPath property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setNativeLibraryPath(String value) throws PropertyVetoException;
+    void setNativeLibraryPath(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the enabled property.
@@ -105,18 +105,19 @@
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "true", dataType = Boolean.class)
-    public String getEnabled();
+    String getEnabled();
 
     /**
      * Sets the value of the enabled property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setEnabled(String value) throws PropertyVetoException;
+    void setEnabled(String value) throws PropertyVetoException;
 
     /**
      * Properties as per {@link org.jvnet.hk2.config.types.PropertyBag}
      */
+    @Override
     @ToDo(priority = ToDo.Priority.IMPORTANT, details = "Provide PropertyDesc for legal props")
     @PropertiesDesc(props = {})
     @Element
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ProviderConfig.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ProviderConfig.java
index 2d4e93d..d3ace24 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ProviderConfig.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ProviderConfig.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,24 +17,24 @@
 
 package com.sun.enterprise.config.serverbeans;
 
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.Element;
-import org.jvnet.hk2.config.ConfigBeanProxy;
-
-import java.beans.PropertyVetoException;
-import java.util.List;
-
-import org.glassfish.api.admin.config.PropertyDesc;
-import org.glassfish.api.admin.config.PropertiesDesc;
-import static org.glassfish.config.support.Constants.NAME_REGEX;
-import org.jvnet.hk2.config.types.Property;
-import org.jvnet.hk2.config.types.PropertyBag;
+import com.sun.enterprise.config.serverbeans.customvalidators.JavaClassName;
 
 import jakarta.validation.constraints.NotNull;
 import jakarta.validation.constraints.Pattern;
 
-import com.sun.enterprise.config.serverbeans.customvalidators.JavaClassName;
+import java.beans.PropertyVetoException;
+import java.util.List;
+
+import org.glassfish.api.admin.config.PropertiesDesc;
+import org.glassfish.api.admin.config.PropertyDesc;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.Element;
+import org.jvnet.hk2.config.types.Property;
+import org.jvnet.hk2.config.types.PropertyBag;
+
+import static org.glassfish.config.support.Constants.NAME_REGEX;
 
 /**
  * The provider-config element defines the configuration of an authentication provider
@@ -52,120 +53,141 @@
 @Configured
 public interface ProviderConfig extends ConfigBeanProxy, PropertyBag {
 
+    String PROVIDER_TYPES = "(client|server|client-server)";
+
     /**
      * Gets the value of the providerId property.
-     *
      * Identifier used to uniquely identify this provider-config element
      *
      * @return possible object is {@link String }
      */
     @Attribute(key = true)
-    @Pattern(regexp = NAME_REGEX)
+    @Pattern(regexp = NAME_REGEX, message = "Pattern: " + NAME_REGEX)
     @NotNull
-    public String getProviderId();
+    String getProviderId();
 
     /**
      * Sets the value of the providerId property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setProviderId(String value) throws PropertyVetoException;
+    void setProviderId(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the providerType property.
-     *
-     * Defines whether the provider is a client authentication provider or a server authentication provider.
+     * Defines whether the provider is a client authentication provider or a server authentication
+     * provider.
      *
      * @return possible object is {@link String }
      */
     @Attribute
     @NotNull
-    @Pattern(regexp = "(client|server|client-server)")
-    public String getProviderType();
+    @Pattern(regexp = PROVIDER_TYPES, message = "Valid values: " + PROVIDER_TYPES)
+    String getProviderType();
 
     /**
      * Sets the value of the providerType property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setProviderType(String value) throws PropertyVetoException;
+    void setProviderType(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the className property.
-     *
      * Defines the java implementation class of the provider.
-     *
-     * Client authentication providers must implement the com.sun.enterprise.security.jauth.ClientAuthModule interface.
-     *
-     * Server-side providers must implement the com.sun.enterprise.security.jauth.ServerAuthModule interface.
-     *
-     * A provider may implement both interfaces, but it must implement the interface corresponding to its provider type.
+     * Client authentication providers must implement the
+     * com.sun.enterprise.security.jauth.ClientAuthModule interface.
+     * Server-side providers must implement the com.sun.enterprise.security.jauth.ServerAuthModule
+     * interface.
+     * A provider may implement both interfaces, but it must implement the interface corresponding
+     * to its provider type.
      *
      * @return possible object is {@link String }
      */
     @Attribute
     @NotNull
     @JavaClassName
-    public String getClassName();
+    String getClassName();
 
     /**
      * Sets the value of the className property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setClassName(String value) throws PropertyVetoException;
+    void setClassName(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the requestPolicy property.
-     *
-     * Defines the authentication policy requirements associated with request processing performed by the authentication
+     * Defines the authentication policy requirements associated with request processing performed
+     * by the authentication
      * provider
      *
      * @return possible object is {@link RequestPolicy }
      */
     @Element
-    public RequestPolicy getRequestPolicy();
+    RequestPolicy getRequestPolicy();
 
     /**
      * Sets the value of the requestPolicy property.
      *
      * @param value allowed object is {@link RequestPolicy }
      */
-    public void setRequestPolicy(RequestPolicy value) throws PropertyVetoException;
+    void setRequestPolicy(RequestPolicy value) throws PropertyVetoException;
 
     /**
      * Gets the value of the responsePolicy property.
-     *
-     * Defines the authentication policy requirements associated with the response processing performed by the
+     * Defines the authentication policy requirements associated with the response processing
+     * performed by the
      * authentication provider.
      *
      * @return possible object is {@link ResponsePolicy }
      */
     @Element
-    public ResponsePolicy getResponsePolicy();
+    ResponsePolicy getResponsePolicy();
 
     /**
      * Sets the value of the responsePolicy property.
      *
      * @param value allowed object is {@link ResponsePolicy }
      */
-    public void setResponsePolicy(ResponsePolicy value) throws PropertyVetoException;
+    void setResponsePolicy(ResponsePolicy value) throws PropertyVetoException;
 
     /**
      * Properties.
      */
-    @PropertiesDesc(props = {
-            @PropertyDesc(name = "security.config", defaultValue = "${com.sun.aas.instanceRoot}/config/wss-server-config-1.0.xml", description = "Specifies the location of the message security configuration file"),
+    @Override
+    @PropertiesDesc(
+        props = {
+            @PropertyDesc(
+                name = "security.config",
+                defaultValue = "${com.sun.aas.instanceRoot}/config/wss-server-config-1.0.xml",
+                description = "Specifies the location of the message security configuration file"),
 
-            @PropertyDesc(name = "debug", defaultValue = "false", dataType = Boolean.class, description = "Enables dumping of server provider debug messages to the server log"),
+            @PropertyDesc(
+                name = "debug",
+                defaultValue = "false",
+                dataType = Boolean.class,
+                description = "Enables dumping of server provider debug messages to the server log"),
 
-            @PropertyDesc(name = "dynamic.username.password", defaultValue = "false", dataType = Boolean.class, description = "Signals the provider runtime to collect the user name and password from the "
+            @PropertyDesc(
+                name = "dynamic.username.password",
+                defaultValue = "false",
+                dataType = Boolean.class,
+                description = "Signals the provider runtime to collect the user name and password from the "
                     + "CallbackHandler for each request. If false, the user name and password for wsse:UsernameToken(s) is "
                     + "collected once, during module initialization. Applicable only for a ClientAuthModule"),
 
-            @PropertyDesc(name = "encryption.key.alias", defaultValue = "s1as", description = "Specifies the encryption key used by the provider. The key is identified by its keystore alias"),
+            @PropertyDesc(
+                name = "encryption.key.alias",
+                defaultValue = "s1as",
+                description = "Specifies the encryption key used by the provider. The key is identified by its keystore alias"),
 
-            @PropertyDesc(name = "signature.key.alias", defaultValue = "s1as", description = "Specifies the signature key used by the provider. The key is identified by its keystore alias") })
+            @PropertyDesc(
+                name = "signature.key.alias",
+                defaultValue = "s1as",
+                description = "Specifies the signature key used by the provider. The key is identified by its keystore alias")
+            }
+        )
     @Element
     List<Property> getProperty();
 }
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/RequestPolicy.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/RequestPolicy.java
index 874fc34..38b3207 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/RequestPolicy.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/RequestPolicy.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,18 +17,19 @@
 
 package com.sun.enterprise.config.serverbeans;
 
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.ConfigBeanProxy;
-
-import java.beans.PropertyVetoException;
-import java.io.Serializable;
-
 import jakarta.validation.constraints.Pattern;
 
+import java.beans.PropertyVetoException;
+
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+
 /**
- * Used to define the authentication policy requirements associated with the request processing performed by an
- * authentication provider (i.e. when a client provider's ClientAuthModule.initiateRequest() method is called or when a
+ * Used to define the authentication policy requirements associated with the request processing
+ * performed by an
+ * authentication provider (i.e. when a client provider's ClientAuthModule.initiateRequest() method
+ * is called or when a
  * server provider's ServerAuthModule.validateRequest() method is called)
  */
 
@@ -36,46 +38,49 @@
 @Configured
 public interface RequestPolicy extends ConfigBeanProxy {
 
+    String AUTH_RECIPIENT_TIMINGS = "(before-content|after-content)";
+    String AUTH_SOURCES = "(sender|content|username-password)";
+
     /**
      * Gets the value of the authSource property.
-     *
-     * Defines a requirement for message layer sender authentication (e.g. username password) or content authentication
+     * Defines a requirement for message layer sender authentication (e.g. username password) or
+     * content authentication
      * (e.g. digital signature)
      *
      * @return possible object is {@link String }
      */
     @Attribute
-    @Pattern(regexp = "(sender|content|username-password)")
-    public String getAuthSource();
+    @Pattern(regexp = AUTH_SOURCES, message = "Valid values: " + AUTH_SOURCES)
+    String getAuthSource();
 
     /**
      * Sets the value of the authSource property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setAuthSource(String value) throws PropertyVetoException;
+    void setAuthSource(String value) throws PropertyVetoException;
 
     /**
-     * Specifies whether recipient authentication occurs before or after content authentication. Allowed values are
-     * 'before-content' and 'after-content'.
-     *
-     * Defines a requirement for message layer authentication of the reciever of a message to its sender (e.g. by XML
-     * encryption). before-content indicates that recipient authentication (e.g. encryption) is to occur before any content
-     * authentication (e.g. encrypt then sign) with respect to the target of the containing auth-policy. after-content
-     * indicates that recipient authentication (e.g. encryption) is to occur after any content authentication (e.g. sign
+     * Specifies whether recipient authentication occurs before or after content authentication.
+     * Allowed values are 'before-content' and 'after-content'.
+     * Defines a requirement for message layer authentication of the reciever of a message to its
+     * sender (e.g. by XML encryption). before-content indicates that recipient authentication
+     * (e.g. encryption) is to occur before any content authentication (e.g. encrypt then sign) with
+     * respect to the target of the containing auth-policy. after-content indicates that recipient
+     * authentication (e.g. encryption) is to occur after any content authentication (e.g. sign
      * then encrypt) with respect to the target of the containing auth-policy
      *
      * @return possible object is {@link String }
      */
     @Attribute
-    @Pattern(regexp = "(before-content|after-content)")
-    public String getAuthRecipient();
+    @Pattern(regexp = AUTH_RECIPIENT_TIMINGS, message = "Valid values: " + AUTH_RECIPIENT_TIMINGS)
+    String getAuthRecipient();
 
     /**
      * Sets the value of the authRecipient property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setAuthRecipient(String value) throws PropertyVetoException;
+    void setAuthRecipient(String value) throws PropertyVetoException;
 
 }
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Resource.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Resource.java
index e71f755..683e899 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Resource.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Resource.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,14 +17,15 @@
 
 package com.sun.enterprise.config.serverbeans;
 
+import jakarta.validation.constraints.Pattern;
+
+import java.beans.PropertyVetoException;
+
 import org.jvnet.hk2.config.Attribute;
 import org.jvnet.hk2.config.ConfigBeanProxy;
 import org.jvnet.hk2.config.Configured;
 import org.jvnet.hk2.config.DuckTyped;
 
-import jakarta.validation.constraints.Pattern;
-import java.beans.PropertyVetoException;
-
 /**
  * Tag interface for all types of resource.
  *
@@ -32,6 +34,8 @@
 @Configured
 public interface Resource extends ConfigBeanProxy {
 
+    String OBJECT_TYPES = "(system-all|system-all-req|system-admin|system-instance|user)";
+
     /**
      * Gets the value of the objectType property. where object-type defines the type of the resource. It can be: system-all
      * - These are system resources for all instances and DAS system-all-req - These are system-all resources that are
@@ -42,7 +46,7 @@
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "user")
-    @Pattern(regexp = "(system-all|system-all-req|system-admin|system-instance|user)")
+    @Pattern(regexp = OBJECT_TYPES, message = "Valid values: " + OBJECT_TYPES)
     String getObjectType();
 
     /**
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ResourceRef.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ResourceRef.java
index c333b8c..b21745b 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ResourceRef.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ResourceRef.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,21 +17,16 @@
 
 package com.sun.enterprise.config.serverbeans;
 
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.ConfigBeanProxy;
-import org.jvnet.hk2.config.Configured;
-
-import java.beans.PropertyVetoException;
-
 import jakarta.validation.constraints.NotNull;
 import jakarta.validation.constraints.Pattern;
 
-import org.glassfish.api.admin.RestRedirects;
-import org.glassfish.api.admin.RestRedirect;
+import java.beans.PropertyVetoException;
 
-/**
- *
- */
+import org.glassfish.api.admin.RestRedirect;
+import org.glassfish.api.admin.RestRedirects;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
 
 /* @XmlType(name = "") */
 
@@ -39,6 +35,8 @@
         @RestRedirect(opType = RestRedirect.OpType.DELETE, commandName = "delete-resource-ref") })
 public interface ResourceRef extends ConfigBeanProxy {
 
+    String PATTERN_REF = "[^':,][^':,]*";
+
     /**
      * Determines whether the resource is active or ignored.
      *
@@ -55,14 +53,15 @@
     void setEnabled(String value) throws PropertyVetoException;
 
     /**
-     * References the name attribute of a resources, such as an {@link org.glassfish.connectors.config.JdbcResource} or
+     * References the name attribute of a resources, such as an
+     * {@link org.glassfish.connectors.config.JdbcResource} or
      * {@link org.glassfish.connectors.config.JdbcConnectionPool}.
      *
      * @return possible object is {@link String }
      */
     @Attribute(key = true)
     @NotNull
-    @Pattern(regexp = "[^':,][^':,]*")
+    @Pattern(regexp = PATTERN_REF, message = "Pattern: " + PATTERN_REF)
     String getRef();
 
     /**
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ResponsePolicy.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ResponsePolicy.java
index f28877c..7b5a216 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ResponsePolicy.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ResponsePolicy.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,14 +17,13 @@
 
 package com.sun.enterprise.config.serverbeans;
 
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.ConfigBeanProxy;
+import jakarta.validation.constraints.Pattern;
 
 import java.beans.PropertyVetoException;
-import java.io.Serializable;
 
-import jakarta.validation.constraints.Pattern;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
 
 /**
  * Used to define the authentication policy requirements associated with the response processing performed by an
@@ -36,25 +36,27 @@
 @Configured
 public interface ResponsePolicy extends ConfigBeanProxy {
 
+    String AUTH_RECIPIENT_TIMINGS = "(before-content|after-content)";
+    String AUTH_SOURCES = "(sender|content|username-password)";
+
     /**
-     * Specifies the type of required authentication, either "sender" (user name and password) or "content" (digital
-     * signature).
-     *
-     * Defines a requirement for message layer sender authentication (e.g. username password) or content authentication
-     * (e.g. digital signature)
+     * Specifies the type of required authentication, either "sender" (user name and password) or
+     * "content" (digital signature).
+     * Defines a requirement for message layer sender authentication (e.g. username password) or
+     * content authentication (e.g. digital signature)
      *
      * @return possible object is {@link String }
      */
     @Attribute
-    @Pattern(regexp = "(sender|content|username-password)")
-    public String getAuthSource();
+    @Pattern(regexp = AUTH_SOURCES, message = "Valid values: " + AUTH_SOURCES)
+    String getAuthSource();
 
     /**
      * Sets the value of the authSource property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setAuthSource(String value) throws PropertyVetoException;
+    void setAuthSource(String value) throws PropertyVetoException;
 
     /**
      * Specifies whether recipient authentication occurs before or after content authentication. Allowed values are
@@ -70,14 +72,14 @@
      * @return possible object is {@link String }
      */
     @Attribute
-    @Pattern(regexp = "(before-content|after-content)")
-    public String getAuthRecipient();
+    @Pattern(regexp = AUTH_RECIPIENT_TIMINGS, message = "Valid values: " + AUTH_RECIPIENT_TIMINGS)
+    String getAuthRecipient();
 
     /**
      * Sets the value of the authRecipient property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setAuthRecipient(String value) throws PropertyVetoException;
+    void setAuthRecipient(String value) throws PropertyVetoException;
 
 }
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Server.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Server.java
index da76d3c..dc1385a 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Server.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Server.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,60 +17,74 @@
 
 package com.sun.enterprise.config.serverbeans;
 
-import com.sun.enterprise.config.util.ConfigApiLoggerInfo;
-import com.sun.enterprise.config.util.InstanceRegisterInstanceCommandParameters;
-import static com.sun.enterprise.config.util.RegisterInstanceCommandParameters.ParameterNames.*;
 import com.sun.enterprise.config.serverbeans.customvalidators.ConfigRefConstraint;
 import com.sun.enterprise.config.serverbeans.customvalidators.ConfigRefValidator;
-import com.sun.enterprise.config.serverbeans.customvalidators.NotTargetKeyword;
 import com.sun.enterprise.config.serverbeans.customvalidators.NotDuplicateTargetName;
-import com.sun.enterprise.config.util.ServerHelper;
+import com.sun.enterprise.config.serverbeans.customvalidators.NotTargetKeyword;
+import com.sun.enterprise.config.serverbeans.customvalidators.ReferenceConstraint;
+import com.sun.enterprise.config.util.ConfigApiLoggerInfo;
+import com.sun.enterprise.config.util.InstanceRegisterInstanceCommandParameters;
 import com.sun.enterprise.config.util.PortBaseHelper;
 import com.sun.enterprise.config.util.PortManager;
+import com.sun.enterprise.config.util.ServerHelper;
 import com.sun.enterprise.util.LocalStringManagerImpl;
 import com.sun.enterprise.util.io.FileUtils;
 import com.sun.enterprise.util.net.NetUtils;
-import java.io.*;
-import org.glassfish.api.Param;
-import org.glassfish.api.admin.AdminCommandContext;
-import org.glassfish.config.support.*;
-import com.sun.enterprise.config.serverbeans.customvalidators.ReferenceConstraint;
 
-import org.jvnet.hk2.annotations.Service;
-import org.glassfish.hk2.api.PerLookup;
-import org.jvnet.hk2.config.*;
-import org.jvnet.hk2.config.types.Property;
-import org.jvnet.hk2.config.types.PropertyBag;
-import org.glassfish.api.ActionReport;
-import org.glassfish.api.admin.config.Named;
-import org.glassfish.api.admin.config.PropertiesDesc;
-import org.glassfish.api.admin.config.ReferenceContainer;
-import org.glassfish.quality.ToDo;
-import static org.glassfish.config.support.Constants.*;
-
-import java.beans.PropertyVetoException;
-import java.util.List;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 import jakarta.inject.Inject;
 import jakarta.validation.Payload;
 import jakarta.validation.constraints.Min;
 import jakarta.validation.constraints.NotNull;
 import jakarta.validation.constraints.Pattern;
 
-import org.glassfish.api.admin.ServerEnvironment;
+import java.beans.PropertyVetoException;
+import java.io.File;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.glassfish.api.ActionReport;
+import org.glassfish.api.Param;
+import org.glassfish.api.admin.AdminCommandContext;
 import org.glassfish.api.admin.CommandRunner;
+import org.glassfish.api.admin.ServerEnvironment;
+import org.glassfish.api.admin.config.Named;
+import org.glassfish.api.admin.config.PropertiesDesc;
+import org.glassfish.api.admin.config.ReferenceContainer;
 import org.glassfish.api.logging.LogHelper;
+import org.glassfish.config.support.CreationDecorator;
+import org.glassfish.config.support.DeletionDecorator;
+import org.glassfish.hk2.api.PerLookup;
+import org.glassfish.quality.ToDo;
+import org.jvnet.hk2.annotations.Service;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.ConfigSupport;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.Dom;
+import org.jvnet.hk2.config.DuckTyped;
+import org.jvnet.hk2.config.Element;
+import org.jvnet.hk2.config.SingleConfigCode;
+import org.jvnet.hk2.config.Transaction;
+import org.jvnet.hk2.config.TransactionFailure;
+import org.jvnet.hk2.config.types.Property;
+import org.jvnet.hk2.config.types.PropertyBag;
+
+import static com.sun.enterprise.config.util.RegisterInstanceCommandParameters.ParameterNames.OPERAND_NAME;
+import static com.sun.enterprise.config.util.RegisterInstanceCommandParameters.ParameterNames.PARAM_CHECKPORTS;
+import static com.sun.enterprise.config.util.RegisterInstanceCommandParameters.ParameterNames.PARAM_CLUSTER;
+import static com.sun.enterprise.config.util.RegisterInstanceCommandParameters.ParameterNames.PARAM_CONFIG;
+import static com.sun.enterprise.config.util.RegisterInstanceCommandParameters.ParameterNames.PARAM_LBENABLED;
+import static com.sun.enterprise.config.util.RegisterInstanceCommandParameters.ParameterNames.PARAM_NODE;
+import static com.sun.enterprise.config.util.RegisterInstanceCommandParameters.ParameterNames.PARAM_PORTBASE;
+import static org.glassfish.config.support.Constants.NAME_SERVER_REGEX;
 
 /**
- *
- * Java EE Application Server Configuration
- *
- * Each Application Server instance is a Java EE compliant container. One server instance is specially designated as the
- * Administration Server in SE/EE
- *
+ * Jakarta EE Application Server Configuration
+ * Each Application Server instance is a Jakarta EE compliant container.
+ * One server instance is specially designated as the Administration Server in SE/EE
  * User applications cannot be deployed to an Administration Server instance
  */
 @Configured
@@ -77,31 +92,31 @@
 @SuppressWarnings("unused")
 @NotDuplicateTargetName(message = "{server.duplicate.name}", payload = Server.class)
 @ReferenceConstraint(skipDuringCreation = true, payload = Server.class)
-public interface Server extends ConfigBeanProxy, PropertyBag, Named, SystemPropertyBag, ReferenceContainer, RefContainer, Payload {
+public interface Server
+    extends ConfigBeanProxy, PropertyBag, Named, SystemPropertyBag, ReferenceContainer, RefContainer, Payload {
 
     String lbEnabledSystemProperty = "org.glassfish.lb-enabled-default";
 
     @Param(name = OPERAND_NAME, primary = true)
     @Override
-    public void setName(String value) throws PropertyVetoException;
+    void setName(String value) throws PropertyVetoException;
 
     @NotTargetKeyword(message = "{server.reserved.name}", payload = Server.class)
     @Pattern(regexp = NAME_SERVER_REGEX, message = "{server.invalid.name}", payload = Server.class)
     @Override
-    public String getName();
+    String getName();
 
     /**
      * Gets the value of the configRef property.
-     *
-     * Points to a named config. Needed for stand-alone servers. If server instance is part of a cluster, then it points to
-     * the cluster config
+     * Points to a named config. Needed for stand-alone servers.
+     * If server instance is part of a cluster, then it points to the cluster config
      *
      * @return possible object is {@link String }
      */
     @Attribute
     @NotNull
     @NotTargetKeyword(message = "{server.reserved.name}", payload = Server.class)
-    @Pattern(regexp = NAME_SERVER_REGEX)
+    @Pattern(regexp = NAME_SERVER_REGEX, message = "Pattern: " + NAME_SERVER_REGEX)
     @ReferenceConstraint.RemoteKey(message = "{resourceref.invalid.configref}", type = Config.class)
     String getConfigRef();
 
@@ -359,8 +374,9 @@
 
         public static Config getConfig(Server server) {
             try {
-                if (server == null)
+                if (server == null) {
                     return null;
+                }
 
                 Dom serverDom = Dom.unwrap(server);
                 Configs configs = serverDom.getHabitat().getService(Configs.class);
@@ -763,8 +779,9 @@
                 // bnevins September 30, 2010
                 // don't delete the config if it wasn't auto-generated.
                 final String autoGeneratedName = child.getName() + "-config";
-                if (!autoGeneratedName.equals(instanceConfig))
+                if (!autoGeneratedName.equals(instanceConfig)) {
                     return;
+                }
 
                 try {
                     if (config != null) {
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ServerRef.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ServerRef.java
index cd0b236..52cf090 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ServerRef.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ServerRef.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -17,32 +18,35 @@
 package com.sun.enterprise.config.serverbeans;
 
 import com.sun.enterprise.config.serverbeans.customvalidators.ReferenceConstraint;
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.Element;
-import org.jvnet.hk2.config.ConfigBeanProxy;
-import static org.glassfish.config.support.Constants.NAME_SERVER_REGEX;
 
-import java.beans.PropertyVetoException;
 import jakarta.validation.Payload;
 import jakarta.validation.constraints.NotNull;
 import jakarta.validation.constraints.Pattern;
 
-/**
- *
- */
+import java.beans.PropertyVetoException;
 
-/* @XmlType(name = "", propOrder = {
-    "healthChecker"
-}) */
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.Element;
+
+import static org.glassfish.config.support.Constants.NAME_SERVER_REGEX;
+
+/*
+ * @XmlType(name = "", propOrder = {
+ * "healthChecker"
+ * })
+ */
 
 @Configured
 @ReferenceConstraint(skipDuringCreation = true, payload = ServerRef.class)
 public interface ServerRef extends ConfigBeanProxy, Ref, Payload {
 
+    // defines the default value for lb-enabled attribute
+    String LBENABLED_DEFAULT_VALUE = "true";
+
     /**
      * Gets the value of the ref property.
-     *
      * A reference to the name of a server defined elsewhere
      *
      * @return possible object is {@link String }
@@ -52,7 +56,7 @@
     @NotNull
     @Pattern(regexp = NAME_SERVER_REGEX, message = "{server.invalid.name}", payload = ServerRef.class)
     @ReferenceConstraint.RemoteKey(message = "{resourceref.invalid.server-ref}", type = Server.class)
-    public String getRef();
+    String getRef();
 
     /**
      * Sets the value of the ref property.
@@ -60,59 +64,58 @@
      * @param value allowed object is {@link String }
      */
     @Override
-    public void setRef(String value) throws PropertyVetoException;
+    void setRef(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the disableTimeoutInMinutes property.
-     *
-     * The time, in minutes, that it takes this server to reach a quiescent state after having been disabled
+     * The time, in minutes, that it takes this server to reach a quiescent state after having been
+     * disabled
      *
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "30")
-    public String getDisableTimeoutInMinutes();
+    String getDisableTimeoutInMinutes();
 
     /**
      * Sets the value of the disableTimeoutInMinutes property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setDisableTimeoutInMinutes(String value) throws PropertyVetoException;
+    void setDisableTimeoutInMinutes(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the lbEnabled property.
-     *
-     * Causes any and all load-balancers using this server to consider this server available to them. Defaults to
-     * available(true)
+     * Causes any and all load-balancers using this server to consider this server available to
+     * them. Defaults to available(true)
      *
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = LBENABLED_DEFAULT_VALUE, dataType = Boolean.class)
-    public String getLbEnabled();
+    String getLbEnabled();
 
     /**
      * Sets the value of the lbEnabled property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setLbEnabled(String value) throws PropertyVetoException;
+    void setLbEnabled(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the enabled property.
-     *
-     * A boolean flag that causes the server to be enabled to serve end-users, or not. Default is to be enabled (true)
+     * A boolean flag that causes the server to be enabled to serve end-users, or not.
+     * Default is to be enabled (true)
      *
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "true", dataType = Boolean.class)
-    public String getEnabled();
+    String getEnabled();
 
     /**
      * Sets the value of the enabled property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setEnabled(String value) throws PropertyVetoException;
+    void setEnabled(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the healthChecker property.
@@ -120,16 +123,12 @@
      * @return possible object is {@link HealthChecker }
      */
     @Element("health-checker")
-    public HealthChecker getHealthChecker();
+    HealthChecker getHealthChecker();
 
     /**
      * Sets the value of the healthChecker property.
      *
      * @param value allowed object is {@link HealthChecker }
      */
-    public void setHealthChecker(HealthChecker value) throws PropertyVetoException;
-
-    //defines the default value for lb-enabled attribute
-    public String LBENABLED_DEFAULT_VALUE = "true";
-
+    void setHealthChecker(HealthChecker value) throws PropertyVetoException;
 }
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/SystemProperty.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/SystemProperty.java
index 226ae49..651954b 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/SystemProperty.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/SystemProperty.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,17 +17,17 @@
 
 package com.sun.enterprise.config.serverbeans;
 
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.ConfigBeanProxy;
-
-import java.beans.PropertyVetoException;
-
 import jakarta.validation.constraints.NotNull;
 import jakarta.validation.constraints.Pattern;
 
-import org.glassfish.api.admin.RestRedirects;
+import java.beans.PropertyVetoException;
+
 import org.glassfish.api.admin.RestRedirect;
+import org.glassfish.api.admin.RestRedirects;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+
 import static org.glassfish.config.support.Constants.NAME_REGEX;
 
 /**
@@ -38,8 +39,10 @@
 }) */
 
 @Configured
-@RestRedirects({ @RestRedirect(opType = RestRedirect.OpType.POST, commandName = "create-system-properties"),
-        @RestRedirect(opType = RestRedirect.OpType.DELETE, commandName = "delete-system-property") })
+@RestRedirects({
+    @RestRedirect(opType = RestRedirect.OpType.POST, commandName = "create-system-properties"),
+    @RestRedirect(opType = RestRedirect.OpType.DELETE, commandName = "delete-system-property")
+})
 public interface SystemProperty extends ConfigBeanProxy {
 
     /**
@@ -49,15 +52,15 @@
      */
     @Attribute(key = true)
     @NotNull
-    @Pattern(regexp = NAME_REGEX)
-    public String getName();
+    @Pattern(regexp = NAME_REGEX, message = "Pattern: " + NAME_REGEX)
+    String getName();
 
     /**
      * Sets the value of the name property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setName(String value) throws PropertyVetoException;
+    void setName(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the value property.
@@ -66,14 +69,14 @@
      */
     @Attribute
     @NotNull
-    public String getValue();
+    String getValue();
 
     /**
      * Sets the value of the value property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setValue(String value) throws PropertyVetoException;
+    void setValue(String value) throws PropertyVetoException;
 
     /**
      * Gets the value of the description property.
@@ -81,13 +84,13 @@
      * @return possible object is {@link String }
      */
     @Attribute
-    public String getDescription();
+    String getDescription();
 
     /**
      * Sets the value of the description property.
      *
      * @param value allowed object is {@link String }
      */
-    public void setDescription(String value) throws PropertyVetoException;
+    void setDescription(String value) throws PropertyVetoException;
 
 }
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/VirtualServer.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/VirtualServer.java
index 52356ba..2fd876d 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/VirtualServer.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/VirtualServer.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,21 +17,22 @@
 
 package com.sun.enterprise.config.serverbeans;
 
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
+
 import java.beans.PropertyVetoException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 import java.util.TreeSet;
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Pattern;
 
-import org.glassfish.grizzly.config.dom.NetworkConfig;
-import org.glassfish.grizzly.config.dom.NetworkListener;
 import org.glassfish.api.admin.RestRedirect;
 import org.glassfish.api.admin.RestRedirects;
 import org.glassfish.api.admin.config.PropertiesDesc;
 import org.glassfish.api.admin.config.PropertyDesc;
 import org.glassfish.config.support.datatypes.PositiveInteger;
+import org.glassfish.grizzly.config.dom.NetworkConfig;
+import org.glassfish.grizzly.config.dom.NetworkListener;
 import org.jvnet.hk2.config.Attribute;
 import org.jvnet.hk2.config.ConfigBeanProxy;
 import org.jvnet.hk2.config.Configured;
@@ -44,15 +46,23 @@
  *
  * Virtualization in Application Server allows multiple URL domains to be served by the same HTTP server process, which
  * is listening on multiple host addresses If an application is available at two virtual servers, they still share same
- * physical resource pools, such as JDBC connection pools. Sun ONE Application Server allows a list of virtual servers,
- * to be specified along with web-module and j2ee-application elements. This establishes an association between URL
+ * physical resource pools, such as JDBC connection pools. GlassFish allows a list of virtual servers,
+ * to be specified along with web-module and Jakarta EE application elements. This establishes an association between URL
  * domains, represented by the virtual server and the web modules (standalone web modules or web modules inside the ear
  * file)
  */
 @Configured
-@RestRedirects({ @RestRedirect(opType = RestRedirect.OpType.POST, commandName = "create-virtual-server"),
-        @RestRedirect(opType = RestRedirect.OpType.DELETE, commandName = "delete-virtual-server") })
+@RestRedirects({
+    @RestRedirect(opType = RestRedirect.OpType.POST, commandName = "create-virtual-server"),
+    @RestRedirect(opType = RestRedirect.OpType.DELETE, commandName = "delete-virtual-server"
+)})
 public interface VirtualServer extends ConfigBeanProxy, PropertyBag {
+
+    String VALUES_ACCESS_LOG_ENABLED = "(true|on|false|off|inherit)";
+    String VALUES_SSO_ENABLED = "(true|on|false|off|inherit)";
+    String VALUES_SSO_COOKIE_ENABLED = "(true|false|dynamic)";
+    String VALUES_STATE = "(on|off|disabled)";
+
     /**
      * Gets the value of the id property.
      *
@@ -154,7 +164,7 @@
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "on")
-    @Pattern(regexp = "(on|off|disabled)")
+    @Pattern(regexp = VALUES_STATE, message = "Valid values: " + VALUES_STATE)
     String getState();
 
     /**
@@ -202,7 +212,7 @@
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "inherit")
-    @Pattern(regexp = "(true|on|false|off|inherit)")
+    @Pattern(regexp = VALUES_SSO_ENABLED, message = "Valid values: " + VALUES_SSO_ENABLED)
     String getSsoEnabled();
 
     /**
@@ -218,7 +228,7 @@
      * @return possible object is {@link String }
      */
     @Attribute(defaultValue = "inherit")
-    @Pattern(regexp = "(true|on|false|off|inherit)")
+    @Pattern(regexp = VALUES_ACCESS_LOG_ENABLED, message = "Valid values: " + VALUES_ACCESS_LOG_ENABLED)
     String getAccessLoggingEnabled();
 
     /**
@@ -268,7 +278,7 @@
      * "dynamic"
      */
     @Attribute(defaultValue = "dynamic")
-    @Pattern(regexp = "(true|false|dynamic)")
+    @Pattern(regexp = VALUES_SSO_COOKIE_ENABLED, message = "Valid values: " + VALUES_SSO_COOKIE_ENABLED)
     String getSsoCookieSecure();
 
     void setSsoCookieSecure(String value);
@@ -294,7 +304,7 @@
         public static void addNetworkListener(VirtualServer server, String name) throws PropertyVetoException {
             final String listeners = server.getNetworkListeners();
             final String[] strings = listeners == null ? new String[0] : listeners.split(",");
-            final Set<String> set = new TreeSet<String>();
+            final Set<String> set = new TreeSet<>();
             for (String string : strings) {
                 set.add(string.trim());
             }
@@ -305,7 +315,7 @@
         public static void removeNetworkListener(VirtualServer server, String name) throws PropertyVetoException {
             final String listeners = server.getNetworkListeners();
             final String[] strings = listeners == null ? new String[0] : listeners.split(",");
-            final Set<String> set = new TreeSet<String>();
+            final Set<String> set = new TreeSet<>();
             for (String string : strings) {
                 set.add(string.trim());
             }
@@ -327,7 +337,7 @@
             final String listeners = server.getNetworkListeners();
             final String[] strings = listeners == null ? new String[0] : listeners.split(",");
             final NetworkConfig config = server.getParent().getParent(Config.class).getNetworkConfig();
-            List<NetworkListener> list = new ArrayList<NetworkListener>();
+            List<NetworkListener> list = new ArrayList<>();
             for (String s : strings) {
                 final String name = s.trim();
                 final NetworkListener networkListener = config.getNetworkListener(name);
@@ -342,46 +352,90 @@
     /**
      * Properties.
      */
-    @PropertiesDesc(props = {
-            @PropertyDesc(name = "sso-max-inactive-seconds", defaultValue = "300", dataType = PositiveInteger.class, description = "The time after which a user's single sign-on record becomes eligible for purging if "
-                    + "no client activity is received. Since single sign-on applies across several applications on the same virtual server, "
-                    + "access to any of the applications keeps the single sign-on record active. Higher values provide longer "
-                    + "single sign-on persistence for the users at the expense of more memory use on the server"),
-            @PropertyDesc(name = "sso-reap-interval-seconds", defaultValue = "60", dataType = PositiveInteger.class, description = "Interval between purges of expired single sign-on records"),
-            @PropertyDesc(name = "setCacheControl", description = "Comma-separated list of Cache-Control response directives. For a list of valid directives, "
+    @Override
+    @PropertiesDesc(
+        props = {@PropertyDesc(
+            name = "sso-max-inactive-seconds",
+            defaultValue = "300",
+            dataType = PositiveInteger.class,
+            description = "The time after which a user's single sign-on record becomes eligible for purging if "
+                + "no client activity is received. Since single sign-on applies across several applications on the same virtual server, "
+                + "access to any of the applications keeps the single sign-on record active. Higher values provide longer "
+                + "single sign-on persistence for the users at the expense of more memory use on the server"),
+            @PropertyDesc(
+                name = "sso-reap-interval-seconds",
+                defaultValue = "60",
+                dataType = PositiveInteger.class,
+                description = "Interval between purges of expired single sign-on records"),
+            @PropertyDesc(
+                name = "setCacheControl",
+                description = "Comma-separated list of Cache-Control response directives. For a list of valid directives, "
                     + "see section 14.9 of the document at http://www.ietf.org/rfc/rfc2616.txt"),
-            @PropertyDesc(name = "accessLoggingEnabled", defaultValue = "false", dataType = Boolean.class, description = "Enables access logging for this virtual server only"),
-            @PropertyDesc(name = "accessLogBufferSize", defaultValue = "32768", dataType = PositiveInteger.class, description = "Size in bytes of the buffer where access log calls are stored. If the value is "
+            @PropertyDesc(
+                name = "accessLoggingEnabled",
+                defaultValue = "false",
+                dataType = Boolean.class,
+                description = "Enables access logging for this virtual server only"),
+            @PropertyDesc(
+                name = "accessLogBufferSize",
+                defaultValue = "32768",
+                dataType = PositiveInteger.class,
+                description = "Size in bytes of the buffer where access log calls are stored. If the value is "
                     + "less than 5120, a warning message is issued, and the value is set to 5120. To set this "
                     + "property for all virtual servers, set it as a property of the parent http-service"),
-            @PropertyDesc(name = "accessLogWriteInterval", defaultValue = "300", dataType = PositiveInteger.class, description = "Number of seconds before the log is written to the disk. The access log is written when "
+            @PropertyDesc(
+                name = "accessLogWriteInterval",
+                defaultValue = "300",
+                dataType = PositiveInteger.class,
+                description = "Number of seconds before the log is written to the disk. The access log is written when "
                     + "the buffer is full or when the interval expires. If the value is 0, the buffer is always written even if "
                     + "it is not full. This means that each time the server is accessed, the log message is stored directly to the file. "
                     + "To set this property for all virtual servers, set it as a property of the parent http-service"),
-            @PropertyDesc(name = "allowRemoteAddress", description = "Comma-separated list of regular expression patterns that the remote client's IP address is "
+            @PropertyDesc(
+                name = "allowRemoteAddress",
+                description = "Comma-separated list of regular expression patterns that the remote client's IP address is "
                     + "compared to. If this property is specified, the remote address must match for this request to be accepted. "
                     + "If this property is not specified, all requests are accepted unless the remote address matches a 'denyRemoteAddress' pattern"),
-            @PropertyDesc(name = "denyRemoteAddress", description = "Comma-separated list of regular expression patterns that the remote client's "
+            @PropertyDesc(
+                name = "denyRemoteAddress",
+                description = "Comma-separated list of regular expression patterns that the remote client's "
                     + "IP address is compared to. If this property is specified, the remote address must not "
                     + "match for this request to be accepted. If this property is not specified, request "
                     + "acceptance is governed solely by the 'allowRemoteAddress' property"),
-            @PropertyDesc(name = "allowRemoteHost", description = "Comma-separated list of regular expression patterns that the remote client's "
+            @PropertyDesc(
+                name = "allowRemoteHost",
+                description = "Comma-separated list of regular expression patterns that the remote client's "
                     + "hostname (as returned by java.net.Socket.getInetAddress().getHostName()) is compared to. "
                     + "If this property is specified, the remote hostname must match for the request to be accepted. "
                     + "If this property is not specified, all requests are accepted unless the remote hostname matches a 'denyRemoteHost' pattern"),
-            @PropertyDesc(name = "denyRemoteHost", description = "Specifies a comma-separated list of regular expression patterns that the remote client's "
+            @PropertyDesc(
+                name = "denyRemoteHost",
+                description = "Specifies a comma-separated list of regular expression patterns that the remote client's "
                     + "hostname (as returned by java.net.Socket.getInetAddress().getHostName()) is compared to. "
                     + "If this property is specified, the remote hostname must not match for this request to be accepted. "
                     + "If this property is not specified, request acceptance is governed solely by the 'allowRemoteHost' property"),
-            @PropertyDesc(name = "authRealm", description = "Specifies the name attribute of an “auth-realm�? on page 23 element, which overrides "
+            @PropertyDesc(
+                name = "authRealm",
+                description = "Specifies the name attribute of an “auth-realm“ on page 23 element, which overrides "
                     + "the server instance's default realm for stand-alone web applications deployed to this virtual server. "
                     + "A realm defined in a stand-alone web application's web.xml file overrides the virtual server's realm"),
-            @PropertyDesc(name = "securePagesWithPragma", defaultValue = "true", dataType = Boolean.class, description = "Set this property to false to ensure that for all web applications on this virtual server "
+            @PropertyDesc(
+                name = "securePagesWithPragma",
+                defaultValue = "true",
+                dataType = Boolean.class,
+                description = "Set this property to false to ensure that for all web applications on this virtual server "
                     + "file downloads using SSL work properly in Internet Explorer. You can set this property for a specific web application."),
-            @PropertyDesc(name = "contextXmlDefault", description = "The location, relative to domain-dir, of the context.xml file for this virtual server, if one is used"),
-            @PropertyDesc(name = "allowLinking", defaultValue = "false", dataType = Boolean.class, description = "If true, resources that are symbolic links in web applications on this virtual server are served. "
+            @PropertyDesc(
+                name = "contextXmlDefault",
+                description = "The location, relative to domain-dir, of the context.xml file for this virtual server, if one is used"),
+            @PropertyDesc(
+                name = "allowLinking",
+                defaultValue = "false",
+                dataType = Boolean.class,
+                description = "If true, resources that are symbolic links in web applications on this virtual server are served. "
                     + "The value of this property in the sun-web.xml file takes precedence if defined. "
                     + "Caution: setting this property to true on Windows systems exposes JSP source code."),
+
             /**
              * Specifies an alternate document root (docroot), where n is a positive integer that allows specification of more than
              * one. Alternate docroots allow web applications to serve requests for certain resources from outside their own
diff --git a/nucleus/admin/rest/rest-client/src/main/java/org/glassfish/admin/rest/client/ClientWrapper.java b/nucleus/admin/rest/rest-client/src/main/java/org/glassfish/admin/rest/client/ClientWrapper.java
index d8ca29e..5f5689c 100644
--- a/nucleus/admin/rest/rest-client/src/main/java/org/glassfish/admin/rest/client/ClientWrapper.java
+++ b/nucleus/admin/rest/rest-client/src/main/java/org/glassfish/admin/rest/client/ClientWrapper.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,12 +17,8 @@
 
 package org.glassfish.admin.rest.client;
 
-import java.io.IOException;
-import java.net.URI;
-import java.util.HashMap;
-import java.util.Map;
-
 import jakarta.ws.rs.client.Client;
+import jakarta.ws.rs.client.ClientBuilder;
 import jakarta.ws.rs.client.ClientRequestContext;
 import jakarta.ws.rs.client.ClientRequestFilter;
 import jakarta.ws.rs.client.Invocation.Builder;
@@ -30,10 +27,15 @@
 import jakarta.ws.rs.core.Link;
 import jakarta.ws.rs.core.UriBuilder;
 
+import java.io.Closeable;
+import java.io.IOException;
+import java.net.URI;
+import java.util.HashMap;
+import java.util.Map;
+
 import javax.net.ssl.HostnameVerifier;
 import javax.net.ssl.SSLContext;
 
-import org.glassfish.jersey.client.JerseyClientBuilder;
 import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
 import org.glassfish.jersey.client.filter.CsrfProtectionFilter;
 import org.glassfish.jersey.jettison.JettisonFeature;
@@ -45,7 +47,7 @@
  *
  * @author jdlee
  */
-public class ClientWrapper implements Client {
+public class ClientWrapper implements Client, Closeable {
     protected Client realClient;
 
     public ClientWrapper() {
@@ -63,11 +65,11 @@
     }
 
     public ClientWrapper(final Map<String, String> headers, String userName, String password) {
-        realClient = JerseyClientBuilder.newClient();
+        realClient = ClientBuilder.newClient();
         realClient.register(new MultiPartFeature());
         realClient.register(new JettisonFeature());
         realClient.register(new CsrfProtectionFilter());
-        if ((userName != null) && (password != null)) {
+        if (userName != null && password != null) {
             realClient.register(HttpAuthenticationFeature.basic(userName, password));
         }
         realClient.register(new ClientRequestFilter() {
diff --git a/nucleus/admin/rest/rest-client/src/main/java/org/glassfish/admin/rest/client/utils/MarshallingUtils.java b/nucleus/admin/rest/rest-client/src/main/java/org/glassfish/admin/rest/client/utils/MarshallingUtils.java
index 09af0d9..1cc1515 100644
--- a/nucleus/admin/rest/rest-client/src/main/java/org/glassfish/admin/rest/client/utils/MarshallingUtils.java
+++ b/nucleus/admin/rest/rest-client/src/main/java/org/glassfish/admin/rest/client/utils/MarshallingUtils.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -39,7 +40,6 @@
 import org.glassfish.api.logging.LogHelper;
 
 /**
- *
  * @author jasonlee
  */
 public class MarshallingUtils {
@@ -47,7 +47,7 @@
         List<Map<String, String>> properties = null;
         json = json.trim();
         if (json.startsWith("{")) {
-            properties = new ArrayList<Map<String, String>>();
+            properties = new ArrayList<>();
             properties.add(processJsonMap(json));
         } else if (json.startsWith("[")) {
             try {
@@ -63,7 +63,7 @@
     }
 
     public static List<Map<String, String>> getPropertiesFromXml(String xml) {
-        List<Map<String, String>> list = new ArrayList<Map<String, String>>();
+        List<Map<String, String>> list = new ArrayList<>();
         InputStream input = null;
         try {
             XMLInputFactory inputFactory = XMLInputFactory.newInstance();
@@ -157,13 +157,13 @@
     }
 
     public static Map buildMapFromDocument(String text) {
-        Map map = null;
-        if ((text == null) || text.isEmpty()) {
+        if (text == null || text.isEmpty()) {
             return new HashMap();
         }
 
         text = text.trim();
 
+        Map map = null;
         if (text.startsWith("{")) {
             map = processJsonMap(text);
         } else if (text.startsWith("<")) {
@@ -176,15 +176,15 @@
                 while (parser.hasNext()) {
                     int event = parser.next();
                     switch (event) {
-                    case XMLStreamConstants.START_ELEMENT: {
-                        if ("map".equals(parser.getLocalName())) {
-                            map = processXmlMap(parser);
+                        case XMLStreamConstants.START_ELEMENT: {
+                            if ("map".equals(parser.getLocalName())) {
+                                map = processXmlMap(parser);
+                            }
+                            break;
                         }
-                        break;
-                    }
-                    default: {
-                        // No-op
-                    }
+                        default: {
+                            // No-op
+                        }
                     }
                 }
             } catch (UnsupportedEncodingException ex) {
@@ -204,7 +204,7 @@
             }
         } else {
             System.out.println(text);
-            throw new RuntimeException("An unknown document type was provided:  " + text); //.substring(0, 10));
+            throw new RuntimeException("An unknown document type was provided:  " + text);
         }
 
         return map;
@@ -212,21 +212,20 @@
 
     /**************************************************************************/
     private static Map processJsonMap(String json) {
-        Map map;
         try {
-            map = processJsonObject(new JSONObject(json));
+            return processJsonObject(new JSONObject(json));
         } catch (JSONException e) {
-            map = new HashMap();
+            // FIXME: Really swallow exception?
+            return new HashMap<>();
         }
-        return map;
     }
 
-    private static Map processJsonObject(JSONObject jo) {
-        Map<String, Object> map = new HashMap<String, Object>();
+    private static Map<String, Object> processJsonObject(JSONObject jo) {
+        Map<String, Object> map = new HashMap<>();
         try {
-            Iterator i = jo.keys();
+            Iterator<String> i = jo.keys();
             while (i.hasNext()) {
-                String key = (String) i.next();
+                String key = i.next();
                 Object value = jo.get(key);
                 if (value instanceof JSONArray) {
                     map.put(key, processJsonArray((JSONArray) value));
@@ -270,7 +269,7 @@
 
     private static Map processXmlMap(XMLStreamReader parser) throws XMLStreamException {
         boolean endOfMap = false;
-        Map<String, Object> entry = new HashMap<String, Object>();
+        Map<String, Object> entry = new HashMap<>();
         String key = null;
         String element = null;
         while (!endOfMap) {
diff --git a/nucleus/admin/rest/rest-service/pom.xml b/nucleus/admin/rest/rest-service/pom.xml
index 70acd95..7af5906 100644
--- a/nucleus/admin/rest/rest-service/pom.xml
+++ b/nucleus/admin/rest/rest-service/pom.xml
@@ -33,6 +33,7 @@
     <description>Rest Interface for GlassFish Management and Monitoring</description>
 
     <dependencies>
+
         <dependency>
             <groupId>org.glassfish.hk2</groupId>
             <artifactId>hk2</artifactId>
@@ -145,19 +146,6 @@
 
     <build>
         <plugins>
-            <plugin><!-- The services directory must be processed after compilation,
-                     it would be used in compilation otherwise and the build would fail  -->
-                <artifactId>maven-resources-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>default-resources</id>
-                        <phase>process-classes</phase>
-                        <goals>
-                            <goal>resources</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
             <!-- Test classes from this module are used elsewhere -->
             <plugin>
                 <artifactId>maven-jar-plugin</artifactId>
diff --git a/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/Constants.java b/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/Constants.java
index 677786b..956252f 100644
--- a/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/Constants.java
+++ b/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/Constants.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2009, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -24,41 +25,41 @@
  * @author Rajeshwar Paitl
  */
 public interface Constants {
-    public static final String INDENT = "  ";
-    public static final String JAVA_STRING_TYPE = "java.lang.String";
-    public static final String JAVA_BOOLEAN_TYPE = "java.lang.Boolean";
-    public static final String JAVA_INT_TYPE = "java.lang.Integer";
-    public static final String JAVA_PROPERTIES_TYPE = "java.util.Properties";
-    public static final String XSD_STRING_TYPE = "string";
-    public static final String XSD_BOOLEAN_TYPE = "boolean";
-    public static final String XSD_INT_TYPE = "int";
-    public static final String XSD_PROPERTIES_TYPE = "string"; //?
-    public static final String TYPE = "type";
-    public static final String KEY = "key";
-    public static final String OPTIONAL = "optional";
-    public static final String DEFAULT_VALUE = "defaultValue";
-    public static final String ACCEPTABLE_VALUES = "acceptableValues";
-    public static final String DEPRECATED = "deprecated";
+    String INDENT = "  ";
+    String JAVA_STRING_TYPE = "java.lang.String";
+    String JAVA_BOOLEAN_TYPE = "java.lang.Boolean";
+    String JAVA_INT_TYPE = "java.lang.Integer";
+    String JAVA_PROPERTIES_TYPE = "java.util.Properties";
+    String XSD_STRING_TYPE = "string";
+    String XSD_BOOLEAN_TYPE = "boolean";
+    String XSD_INT_TYPE = "int";
+    String XSD_PROPERTIES_TYPE = "string"; //?
+    String TYPE = "type";
+    String KEY = "key";
+    String OPTIONAL = "optional";
+    String DEFAULT_VALUE = "defaultValue";
+    String ACCEPTABLE_VALUES = "acceptableValues";
+    String DEPRECATED = "deprecated";
 
-    public static final String VAR_PARENT = "$parent";
-    public static final String VAR_GRANDPARENT = "$grandparent";
+    String VAR_PARENT = "$parent";
+    String VAR_GRANDPARENT = "$grandparent";
 
-    public static final String ENCODING = "UTF-8";
+    String ENCODING = "UTF-8";
 
-    public static final String CLIENT_JAVA_PACKAGE = "org.glassfish.admin.rest.client";
-    public static final String CLIENT_JAVA_PACKAGE_DIR = CLIENT_JAVA_PACKAGE.replace(".", System.getProperty("file.separator"));
+    String CLIENT_JAVA_PACKAGE = "org.glassfish.admin.rest.client";
+    String CLIENT_JAVA_PACKAGE_DIR = CLIENT_JAVA_PACKAGE.replace(".", System.getProperty("file.separator"));
 
-    public static final String CLIENT_PYTHON_PACKAGE = "glassfih.rest";
-    public static final String CLIENT_PYTHON_PACKAGE_DIR = CLIENT_PYTHON_PACKAGE.replace(".", System.getProperty("file.separator"));
+    String CLIENT_PYTHON_PACKAGE = "glassfih.rest";
+    String CLIENT_PYTHON_PACKAGE_DIR = CLIENT_PYTHON_PACKAGE.replace(".", System.getProperty("file.separator"));
 
-    public static final String REQ_ATTR_SUBJECT = "SUBJECT";
+    String REQ_ATTR_SUBJECT = "SUBJECT";
 
-    public static final String HEADER_LEGACY_FORMAT = "X-GlassFish-3";
+    String HEADER_LEGACY_FORMAT = "X-GlassFish-3";
 
-    public static final String MEDIA_TYPE = "application";
-    public static final String MEDIA_SUB_TYPE = "vnd.oracle.glassfish";
-    public static final String MEDIA_TYPE_BASE = MEDIA_TYPE + "/" + MEDIA_SUB_TYPE;
-    public static final String MEDIA_TYPE_JSON = MEDIA_TYPE_BASE + "+json";
-    public static final MediaType MEDIA_TYPE_JSON_TYPE = new MediaType(MEDIA_TYPE, MEDIA_SUB_TYPE + "+json");
-    public static final String MEDIA_TYPE_SSE = MEDIA_TYPE_BASE + "+sse";
+    String MEDIA_TYPE = "application";
+    String MEDIA_SUB_TYPE = "vnd.oracle.glassfish";
+    String MEDIA_TYPE_BASE = MEDIA_TYPE + "/" + MEDIA_SUB_TYPE;
+    String MEDIA_TYPE_JSON = MEDIA_TYPE_BASE + "+json";
+    MediaType MEDIA_TYPE_JSON_TYPE = new MediaType(MEDIA_TYPE, MEDIA_SUB_TYPE + "+json");
+    String MEDIA_TYPE_SSE = MEDIA_TYPE_BASE + "+sse";
 }
diff --git a/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/annotation/processor/RestModelExtensionProcessor.java b/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/annotation/processor/RestModelExtensionProcessor.java
index 89ab470..64a332c 100644
--- a/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/annotation/processor/RestModelExtensionProcessor.java
+++ b/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/annotation/processor/RestModelExtensionProcessor.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -23,9 +24,9 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+
 import javax.annotation.processing.AbstractProcessor;
 import javax.annotation.processing.Filer;
-import javax.annotation.processing.Messager;
 import javax.annotation.processing.RoundEnvironment;
 import javax.annotation.processing.SupportedAnnotationTypes;
 import javax.lang.model.SourceVersion;
@@ -33,57 +34,49 @@
 import javax.lang.model.element.TypeElement;
 import javax.tools.Diagnostic.Kind;
 import javax.tools.FileObject;
-import javax.tools.StandardLocation;
+
 import org.glassfish.admin.rest.composite.RestModelExtension;
 
-/**
- * Hello world!
- *
- */
+import static javax.tools.StandardLocation.CLASS_OUTPUT;
+
+
 @SupportedAnnotationTypes("org.glassfish.admin.rest.composite.RestModelExtension")
 public class RestModelExtensionProcessor extends AbstractProcessor {
     @Override
-    public boolean process(Set<? extends TypeElement> elements, RoundEnvironment env) {
-        Messager messager = processingEnv.getMessager();
-        BufferedWriter bw = null;
+    public boolean process(final Set<? extends TypeElement> elements, final RoundEnvironment env) {
         try {
-            Map<String, List<String>> classes = new HashMap<String, List<String>>();
-
-            for (TypeElement te : elements) {
-                for (Element e : env.getElementsAnnotatedWith(te)) {
-                    final RestModelExtension annotation = e.getAnnotation(RestModelExtension.class);
+            final Map<String, List<String>> classes = new HashMap<>();
+            for (final TypeElement typeElement : elements) {
+                for (final Element element : env.getElementsAnnotatedWith(typeElement)) {
+                    final RestModelExtension annotation = element.getAnnotation(RestModelExtension.class);
                     final String parent = annotation.parent();
                     List<String> list = classes.get(parent);
                     if (list == null) {
-                        list = new ArrayList<String>();
+                        list = new ArrayList<>();
                         classes.put(parent, list);
                     }
-                    list.add(e.toString());
+                    list.add(element.toString());
                 }
             }
-
-            if (!classes.isEmpty()) {
-                final Filer filer = processingEnv.getFiler();
-                FileObject fo = filer.createResource(StandardLocation.CLASS_OUTPUT, "", "META-INF/restmodelextensions");
-                bw = new BufferedWriter(fo.openWriter());
+            if (classes.isEmpty()) {
+                return true;
+            }
+            final Filer filer = processingEnv.getFiler();
+            final FileObject file = filer.createResource(CLASS_OUTPUT, "", "META-INF/restmodelextensions");
+            try (BufferedWriter bw = new BufferedWriter(file.openWriter())) {
                 // parent model:model extension
-                for (Map.Entry<String, List<String>> entry : classes.entrySet()) {
+                for (final Map.Entry<String, List<String>> entry : classes.entrySet()) {
                     final String key = entry.getKey();
-                    for (String ext : entry.getValue()) {
-                        bw.write(key + ":" + ext + "\n");
+                    for (final String ext : entry.getValue()) {
+                        bw.write(key);
+                        bw.write(":");
+                        bw.write(ext);
+                        bw.write('\n');
                     }
                 }
-                bw.close();
             }
-        } catch (IOException ex) {
-            messager.printMessage(Kind.ERROR, ex.getLocalizedMessage());
-            if (bw != null) {
-                try {
-                    bw.close();
-                } catch (Exception e) {
-
-                }
-            }
+        } catch (final IOException ex) {
+            processingEnv.getMessager().printMessage(Kind.ERROR, ex.getLocalizedMessage());
         }
 
         return true;
diff --git a/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/clientutils/.gitkeep_empty_dir b/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/clientutils/.gitkeep_empty_dir
deleted file mode 100644
index e69de29..0000000
--- a/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/clientutils/.gitkeep_empty_dir
+++ /dev/null
diff --git a/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/readers/JsonPropertyListReader.java b/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/readers/JsonPropertyListReader.java
index 76c0da9..95d3225 100644
--- a/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/readers/JsonPropertyListReader.java
+++ b/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/readers/JsonPropertyListReader.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,15 +17,6 @@
 
 package org.glassfish.admin.rest.readers;
 
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.util.List;
-import java.util.Map;
 import jakarta.ws.rs.Consumes;
 import jakarta.ws.rs.WebApplicationException;
 import jakarta.ws.rs.core.MediaType;
@@ -32,6 +24,16 @@
 import jakarta.ws.rs.core.Response;
 import jakarta.ws.rs.ext.MessageBodyReader;
 import jakarta.ws.rs.ext.Provider;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.List;
+import java.util.Map;
+
 import org.glassfish.admin.rest.client.utils.MarshallingUtils;
 import org.glassfish.admin.rest.utils.Util;
 
@@ -51,17 +53,14 @@
     @Override
     public List<Map<String, String>> readFrom(Class<List<Map<String, String>>> type, Type genericType, Annotation[] annotations,
             MediaType mediaType, MultivaluedMap<String, String> headers, InputStream in) throws IOException {
-        try {
+        try (BufferedReader reader = new BufferedReader(new InputStreamReader(in))) {
             StringBuilder sb = new StringBuilder();
-            BufferedReader reader = new BufferedReader(new InputStreamReader(in));
             String line = reader.readLine();
             while (line != null) {
                 sb.append(line);
                 line = reader.readLine();
             }
-
             return MarshallingUtils.getPropertiesFromJson(sb.toString());
-
         } catch (Exception exception) {
             throw new WebApplicationException(exception, Response.Status.INTERNAL_SERVER_ERROR);
         }
diff --git a/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/readers/XmlPropertyListReader.java b/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/readers/XmlPropertyListReader.java
index 3f75fc2..d921aa3 100644
--- a/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/readers/XmlPropertyListReader.java
+++ b/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/readers/XmlPropertyListReader.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -50,17 +51,14 @@
     @Override
     public List<Map<String, String>> readFrom(Class<List<Map<String, String>>> type, Type genericType, Annotation[] annotations,
             MediaType mediaType, MultivaluedMap<String, String> headers, InputStream in) throws IOException {
-        try {
+        try (BufferedReader reader = new BufferedReader(new InputStreamReader(in))) {
             StringBuilder sb = new StringBuilder();
-            BufferedReader reader = new BufferedReader(new InputStreamReader(in));
             String line = reader.readLine();
             while (line != null) {
                 sb.append(line);
                 line = reader.readLine();
             }
-
             return MarshallingUtils.getPropertiesFromXml(sb.toString());
-
         } catch (Exception exception) {
             throw new WebApplicationException(exception, Response.Status.INTERNAL_SERVER_ERROR);
         }
diff --git a/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/resources/MonitoringResource.java b/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/resources/MonitoringResource.java
index a81134b..bd7b6bc 100644
--- a/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/resources/MonitoringResource.java
+++ b/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/resources/MonitoringResource.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2009, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,42 +17,44 @@
 
 package org.glassfish.admin.rest.resources;
 
-import org.glassfish.admin.rest.utils.Util;
-import org.glassfish.admin.rest.utils.ProxyImpl;
+import com.sun.enterprise.config.serverbeans.Domain;
+import com.sun.enterprise.config.serverbeans.Server;
 
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.PathParam;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.core.Context;
+import jakarta.ws.rs.core.MediaType;
 import jakarta.ws.rs.core.PathSegment;
 import jakarta.ws.rs.core.Response;
 import jakarta.ws.rs.core.UriBuilder;
 import jakarta.ws.rs.core.UriInfo;
-import jakarta.ws.rs.core.Context;
-import static jakarta.ws.rs.core.Response.Status.*;
+
 import java.net.URL;
-import java.util.Properties;
-import java.util.TreeMap;
-import jakarta.ws.rs.Consumes;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
-
-import jakarta.ws.rs.GET;
-import jakarta.ws.rs.core.MediaType;
-import jakarta.ws.rs.Path;
-import jakarta.ws.rs.Produces;
-import jakarta.ws.rs.PathParam;
-
-import com.sun.enterprise.config.serverbeans.Domain;
-import com.sun.enterprise.config.serverbeans.Server;
+import java.util.Properties;
+import java.util.TreeMap;
 
 import org.glassfish.admin.rest.adapter.LocatorBridge;
 import org.glassfish.admin.rest.results.ActionReportResult;
+import org.glassfish.admin.rest.utils.ProxyImpl;
+import org.glassfish.admin.rest.utils.Util;
 import org.glassfish.admin.rest.utils.xml.RestActionReporter;
 import org.glassfish.external.statistics.Statistic;
 import org.glassfish.external.statistics.Stats;
-
-import org.glassfish.flashlight.datatree.TreeNode;
 import org.glassfish.flashlight.MonitoringRuntimeDataRegistry;
+import org.glassfish.flashlight.datatree.TreeNode;
 
-import static org.glassfish.admin.rest.provider.ProviderUtil.*;
+import static jakarta.ws.rs.core.Response.Status.FORBIDDEN;
+import static jakarta.ws.rs.core.Response.Status.NOT_FOUND;
+import static jakarta.ws.rs.core.Response.Status.OK;
+import static org.glassfish.admin.rest.provider.ProviderUtil.getElementLink;
+import static org.glassfish.admin.rest.provider.ProviderUtil.getStatistic;
+import static org.glassfish.admin.rest.provider.ProviderUtil.jsonValue;
 
 /**
  * @author rajeshwar patil
@@ -88,28 +91,57 @@
         pathSegments = pathSegments.subList(1, pathSegments.size());
         if (!pathSegments.isEmpty()) {
             PathSegment lastSegment = pathSegments.get(pathSegments.size() - 1);
-            if (lastSegment.getPath().isEmpty()) { // if there is a trailing '/' (like monitoring/domain/), a spurious pathSegment is added. Discard it.
+            if (lastSegment.getPath().isEmpty()) {
+                // if there is a trailing '/' (like monitoring/domain/), a spurious pathSegment is added. Discard it.
                 pathSegments = pathSegments.subList(0, pathSegments.size() - 1);
             }
         }
 
-        if (!pathSegments.isEmpty()) {
+        if (pathSegments.isEmpty()) {
+            // Called for /monitoring/domain/
+            List<TreeNode> list = new ArrayList<>();
+            if (rootNode != null) {
+                //Add currentInstance to response
+                list.add(rootNode);
+            }
+            constructEntity(list, ar);
+
+            if (isRunningOnDAS) {
+                // Add links to instances from the cluster
+                Domain domain = habitat.getRemoteLocator().getService(Domain.class);
+                Map<String, String> links = (Map<String, String>) ar.getExtraProperties().get("childResources");
+                for (Server s : domain.getServers().getServer()) {
+                    if (!"server".equals(s.getName())) {
+                        // add all non 'server' instances
+                        links.put(s.getName(), getElementLink(uriInfo, s.getName()));
+                    }
+                }
+            }
+            responseBuilder.entity(new ActionReportResult(ar));
+        } else {
             String firstPathElement = pathSegments.get(0).getPath();
-            if (firstPathElement.equals(currentInstanceName)) { // Query for current instance. Execute it
+            if (firstPathElement.equals(currentInstanceName)) {
+                // Query for current instance. Execute it
                 //iterate over pathsegments and build a dotted name to look up in monitoring registry
                 StringBuilder pathInMonitoringRegistry = new StringBuilder();
                 for (PathSegment pathSegment : pathSegments.subList(1, pathSegments.size())) {
                     if (pathInMonitoringRegistry.length() > 0) {
                         pathInMonitoringRegistry.append('.');
                     }
-                    pathInMonitoringRegistry.append(pathSegment.getPath().replaceAll("\\.", "\\\\.")); // Need to escape '.' before passing it to monitoring code
+                    // Need to escape '.' before passing it to monitoring code
+                    pathInMonitoringRegistry.append(pathSegment.getPath().replaceAll("\\.", "\\\\."));
                 }
 
                 TreeNode resultNode = pathInMonitoringRegistry.length() > 0 && rootNode != null
                         ? rootNode.getNode(pathInMonitoringRegistry.toString())
                         : rootNode;
-                if (resultNode != null) {
-                    List<TreeNode> list = new ArrayList<TreeNode>();
+                if (resultNode == null) {
+                    //No monitoring data, so nothing to list
+                    responseBuilder.status(NOT_FOUND);
+                    ar.setFailure();
+                    responseBuilder.entity(new ActionReportResult(ar));
+                } else {
+                    List<TreeNode> list = new ArrayList<>();
                     if (resultNode.hasChildNodes()) {
                         list.addAll(resultNode.getEnabledChildNodes());
                     } else {
@@ -117,16 +149,13 @@
                     }
                     constructEntity(list, ar);
                     responseBuilder.entity(new ActionReportResult(ar));
-                } else {
-                    //No monitoring data, so nothing to list
-                    responseBuilder.status(NOT_FOUND);
-                    ar.setFailure();
-                    responseBuilder.entity(new ActionReportResult(ar));
                 }
 
             } else { //firstPathElement != currentInstanceName => A proxy request
                 if (isRunningOnDAS) { //Attempt to forward to instance if running on Das
                     //TODO validate that firstPathElement corresponds to a valid server name
+                    // FIXME: As of 03.04.2022 Utils.getJerseyClient here throws exception:
+                    // java.lang.ClassNotFoundException: Provider for jakarta.ws.rs.client.ClientBuilder cannot be found
                     Properties proxiedResponse = new MonitoringProxyImpl().proxyRequest(uriInfo, Util.getJerseyClient(),
                             habitat.getRemoteLocator());
                     ar.setExtraProperties(proxiedResponse);
@@ -135,31 +164,14 @@
                     return Response.status(FORBIDDEN).build();
                 }
             }
-        } else { // Called for /monitoring/domain/
-            List<TreeNode> list = new ArrayList<TreeNode>();
-            if (rootNode != null) {
-                list.add(rootNode); //Add currentInstance to response
-            }
-            constructEntity(list, ar);
-
-            if (isRunningOnDAS) { // Add links to instances from the cluster
-                Domain domain = habitat.getRemoteLocator().getService(Domain.class);
-                Map<String, String> links = (Map<String, String>) ar.getExtraProperties().get("childResources");
-                for (Server s : domain.getServers().getServer()) {
-                    if (!s.getName().equals("server")) {// add all non 'server' instances
-                        links.put(s.getName(), getElementLink(uriInfo, s.getName()));
-                    }
-                }
-            }
-            responseBuilder.entity(new ActionReportResult(ar));
         }
 
         return responseBuilder.build();
     }
 
     private void constructEntity(List<TreeNode> nodeList, RestActionReporter ar) {
-        Map<String, Object> entity = new TreeMap<String, Object>();
-        Map<String, String> links = new TreeMap<String, String>();
+        Map<String, Object> entity = new TreeMap<>();
+        Map<String, String> links = new TreeMap<>();
 
         for (TreeNode node : nodeList) {
             //process only the leaf nodes, if any
@@ -174,7 +186,7 @@
                             Statistic statisticObject = (Statistic) value;
                             entity.put(node.getName(), getStatistic(statisticObject));
                         } else if (value instanceof Stats) {
-                            Map<String, Map> subMap = new TreeMap<String, Map>();
+                            Map<String, Map> subMap = new TreeMap<>();
                             for (Statistic statistic : ((Stats) value).getStatistics()) {
                                 subMap.put(statistic.getName(), getStatistic(statistic));
                             }
diff --git a/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/resources/TemplateCommandPostResource.java b/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/resources/TemplateCommandPostResource.java
index 62950c1..dbfe1ff 100644
--- a/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/resources/TemplateCommandPostResource.java
+++ b/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/resources/TemplateCommandPostResource.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -43,13 +44,9 @@
 import org.glassfish.jersey.media.multipart.FormDataMultiPart;
 import org.glassfish.jersey.media.sse.SseFeature;
 
-import static org.glassfish.admin.rest.resources.TemplateExecCommand.localStrings;
-
 /**
- *
  * @author ludovic champenois ludo@dev.java.net Code moved from generated classes to here. Gen code inherits from this
  * template class that contains the logic for mapped commands RS Resources
- *
  */
 @Produces({ "text/html", MediaType.APPLICATION_JSON + ";qs=0.5", MediaType.APPLICATION_XML + ";qs=0.5" })
 public class TemplateCommandPostResource extends TemplateExecCommand {
@@ -175,20 +172,18 @@
             formData = new FormDataMultiPart();
         }
         try {
-            /* data passed to the generic command running
-             *
-             * */
-
+            // data passed to the generic command running
             Map<String, List<FormDataBodyPart>> m1 = formData.getFields();
 
             Set<String> ss = m1.keySet();
             for (String fieldName : ss) {
                 for (FormDataBodyPart bodyPart : formData.getFields(fieldName)) {
 
-                    if (bodyPart.getContentDisposition().getFileName() != null) {//we have a file
+                    if (bodyPart.getContentDisposition().getFileName() == null) {
+                        data.add(fieldName, bodyPart.getValue());
+                    } else {
                         //save it and mark it as delete on exit.
                         InputStream fileStream = bodyPart.getValueAs(InputStream.class);
-                        String mimeType = bodyPart.getMediaType().toString();
 
                         //Use just the filename without complete path. File creation
                         //in case of remote deployment failing because fo this.
@@ -201,12 +196,9 @@
                             }
                         }
 
-                        File f = Util.saveFile(fileName, mimeType, fileStream);
-                        f.deleteOnExit();
+                        File f = Util.saveTemporaryFile(fileName, fileStream);
                         //put only the local path of the file in the same field.
                         data.add(fieldName, f.getAbsolutePath());
-                    } else {
-                        data.add(fieldName, bodyPart.getValue());
                     }
                 }
             }
diff --git a/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/resources/TemplateListOfResource.java b/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/resources/TemplateListOfResource.java
index 778c9cc..b244125 100644
--- a/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/resources/TemplateListOfResource.java
+++ b/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/resources/TemplateListOfResource.java
@@ -16,27 +16,9 @@
 
 package org.glassfish.admin.rest.resources;
 
-import java.lang.reflect.Method;
-import org.glassfish.config.support.Create;
-import java.net.HttpURLConnection;
 import com.sun.enterprise.util.LocalStringManagerImpl;
-import org.glassfish.admin.rest.utils.ResourceUtil;
-import org.glassfish.admin.rest.utils.Util;
-import org.glassfish.admin.rest.provider.MethodMetaData;
-import org.glassfish.admin.rest.results.ActionReportResult;
-import org.glassfish.admin.rest.results.OptionsResult;
-import org.glassfish.admin.rest.utils.xml.RestActionReporter;
-import org.glassfish.api.ActionReport;
-import org.glassfish.api.admin.RestRedirect;
-import org.jvnet.hk2.config.ConfigBeanProxy;
-import org.jvnet.hk2.config.ConfigModel;
-import org.jvnet.hk2.config.Dom;
-import org.jvnet.hk2.config.DomDocument;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
+import jakarta.validation.ConstraintViolationException;
 import jakarta.ws.rs.Consumes;
 import jakarta.ws.rs.DefaultValue;
 import jakarta.ws.rs.GET;
@@ -49,10 +31,33 @@
 import jakarta.ws.rs.core.MediaType;
 import jakarta.ws.rs.core.Response;
 
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.glassfish.admin.rest.provider.MethodMetaData;
+import org.glassfish.admin.rest.results.ActionReportResult;
+import org.glassfish.admin.rest.results.OptionsResult;
+import org.glassfish.admin.rest.utils.ResourceUtil;
+import org.glassfish.admin.rest.utils.Util;
+import org.glassfish.admin.rest.utils.xml.RestActionReporter;
+import org.glassfish.api.ActionReport;
+import org.glassfish.api.admin.RestRedirect;
+import org.glassfish.config.support.Create;
 import org.glassfish.hk2.api.MultiException;
 import org.glassfish.hk2.api.ServiceLocator;
 import org.glassfish.jersey.media.multipart.FormDataMultiPart;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.ConfigModel;
+import org.jvnet.hk2.config.Dom;
+import org.jvnet.hk2.config.DomDocument;
+import org.jvnet.hk2.config.TransactionFailure;
 
+import static org.glassfish.admin.rest.utils.ResourceUtil.getActionReportResult;
 import static org.glassfish.admin.rest.utils.Util.decode;
 import static org.glassfish.admin.rest.utils.Util.getName;
 
@@ -61,13 +66,15 @@
  * @author Rajeshwar Patil
  */
 public abstract class TemplateListOfResource extends AbstractResource {
+    private static final Logger LOG = Logger.getLogger(TemplateListOfResource.class.getName());
+    private static final LocalStringManagerImpl localStrings = new LocalStringManagerImpl(TemplateListOfResource.class);
+
     @Context
     protected ServiceLocator injector;
 
     protected List<Dom> entity;
     protected Dom parent;
     protected String tagName;
-    public final static LocalStringManagerImpl localStrings = new LocalStringManagerImpl(TemplateListOfResource.class);
 
     @GET
     @Produces({ "text/html", MediaType.APPLICATION_JSON + ";qs=0.5", MediaType.APPLICATION_XML + ";qs=0.5" })
@@ -81,13 +88,13 @@
     @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.APPLICATION_FORM_URLENCODED })
     public Response createResource(HashMap<String, String> data) {
         if (data == null) {
-            data = new HashMap<String, String>();
+            data = new HashMap<>();
         }
         try {
             if (data.containsKey("error")) {
                 String errorMessage = localStrings.getLocalString("rest.request.parsing.error",
                         "Unable to parse the input entity. Please check the syntax.");
-                ActionReportResult arr = ResourceUtil.getActionReportResult(ActionReport.ExitCode.FAILURE, errorMessage, requestHeaders,
+                ActionReportResult arr = getActionReportResult(ActionReport.ExitCode.FAILURE, errorMessage, requestHeaders,
                         uriInfo);
                 return Response.status(400).entity(arr).build();
             }
@@ -98,42 +105,39 @@
             String commandName = getPostCommand();
             String resourceToCreate = uriInfo.getAbsolutePath() + "/";
 
-            if (null != commandName) {
-                ResourceUtil.adjustParameters(data); //adjusting for DEFAULT is required only while executing a CLI command
-                if (data.containsKey("name")) {
-                    resourceToCreate += data.get("name");
-                } else {
-                    resourceToCreate += data.get("DEFAULT");
-                }
-                RestActionReporter actionReport = ResourceUtil.runCommand(commandName, data, getSubject());
-
-                ActionReport.ExitCode exitCode = actionReport.getActionExitCode();
-                if (exitCode != ActionReport.ExitCode.FAILURE) {
-                    String successMessage = localStrings.getLocalString("rest.resource.create.message", "\"{0}\" created successfully.",
-                            resourceToCreate);
-                    ActionReportResult arr = ResourceUtil.getActionReportResult(actionReport, successMessage, requestHeaders, uriInfo);
-                    return Response.ok(arr).build();
-                }
-
-                String errorMessage = getErrorMessage(data, actionReport);
-                ActionReportResult arr = ResourceUtil.getActionReportResult(actionReport, errorMessage, requestHeaders, uriInfo);
+            if (commandName == null) {
+                ActionReportResult arr = getActionReportResult(ActionReport.ExitCode.FAILURE,
+                    "No CRUD Create possible.", requestHeaders, uriInfo);
                 return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(arr).build();
-            } else {
-                ActionReportResult arr = ResourceUtil.getActionReportResult(ActionReport.ExitCode.FAILURE, "No CRUD Create possible.",
-                        requestHeaders, uriInfo);
-                return Response.status(HttpURLConnection.HTTP_INTERNAL_ERROR).entity(arr).build();
             }
+            ResourceUtil.adjustParameters(data);
+            if (data.containsKey("name")) {
+                resourceToCreate += data.get("name");
+            } else {
+                resourceToCreate += data.get("DEFAULT");
+            }
+            RestActionReporter actionReport = ResourceUtil.runCommand(commandName, data, getSubject());
+
+            ActionReport.ExitCode exitCode = actionReport.getActionExitCode();
+            if (exitCode == ActionReport.ExitCode.FAILURE) {
+                String errorMessage = actionReport.getMessage();
+                LOG.log(Level.SEVERE, errorMessage, actionReport.getFailureCause());
+                ActionReportResult result = getActionReportResult(actionReport, errorMessage, requestHeaders, uriInfo);
+                return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(result).build();
+            }
+            String successMessage = localStrings.getLocalString("rest.resource.create.message",
+                "\"{0}\" created successfully.", resourceToCreate);
+            ActionReportResult arr = getActionReportResult(actionReport, successMessage, requestHeaders, uriInfo);
+            return Response.ok(arr).build();
         } catch (Exception e) {
-            throw new WebApplicationException(e, Response.Status.INTERNAL_SERVER_ERROR);
+            throw handleException(e);
         }
     }
 
     @POST
     @Consumes(MediaType.MULTIPART_FORM_DATA)
     public Response post(FormDataMultiPart formData) {
-        /* data passed to the generic command running
-         *
-         * */
+        // data passed to the generic command running
         HashMap<String, String> data = TemplateRestResource.createDataBasedOnForm(formData);
         return createResource(data, data.get("name")); //execute the deploy command with a copy of the file locally
 
@@ -196,7 +200,7 @@
             try {
                 cbp = (Class<? extends ConfigBeanProxy>) parent.model.classLoaderHolder.loadClass(parent.model.targetTypeName);
             } catch (MultiException e) {
-                return null;//
+                return null;
             }
             Create create = null;
             for (Method m : cbp.getMethods()) {
@@ -243,7 +247,7 @@
     protected ActionReportResult buildActionReportResult() {
         if (entity == null) {//wrong resource
             String errorMessage = localStrings.getLocalString("rest.resource.erromessage.noentity", "Resource not found.");
-            return ResourceUtil.getActionReportResult(ActionReport.ExitCode.FAILURE, errorMessage, requestHeaders, uriInfo);
+            return getActionReportResult(ActionReport.ExitCode.FAILURE, errorMessage, requestHeaders, uriInfo);
         }
         RestActionReporter ar = new RestActionReporter();
         final String typeKey = (decode(getName(uriInfo.getPath(), '/')));
@@ -271,7 +275,7 @@
                 String errorMessage = localStrings.getLocalString("rest.request.parsing.error",
                         "Unable to parse the input entity. Please check the syntax.");
                 return Response.status(400)
-                        .entity(ResourceUtil.getActionReportResult(ActionReport.ExitCode.FAILURE, errorMessage, requestHeaders, uriInfo))
+                        .entity(getActionReportResult(ActionReport.ExitCode.FAILURE, errorMessage, requestHeaders, uriInfo))
                         .build();
             }
 
@@ -304,26 +308,26 @@
                 if (exitCode != ActionReport.ExitCode.FAILURE) {
                     String successMessage = localStrings.getLocalString("rest.resource.create.message", "\"{0}\" created successfully.",
                             new Object[] { resourceToCreate });
-                    return Response.ok().entity(ResourceUtil.getActionReportResult(actionReport, successMessage, requestHeaders, uriInfo))
+                    return Response.ok().entity(getActionReportResult(actionReport, successMessage, requestHeaders, uriInfo))
                             .build();
                 }
 
-                String errorMessage = getErrorMessage(data, actionReport);
-                return Response.status(400).entity(ResourceUtil.getActionReportResult(actionReport, errorMessage, requestHeaders, uriInfo))
-                        .build();
+                String errorMessage = actionReport.getMessage();
+                return Response.status(400)
+                    .entity(getActionReportResult(actionReport, errorMessage, requestHeaders, uriInfo)).build();
             }
-            String message = localStrings.getLocalString("rest.resource.post.forbidden", "POST on \"{0}\" is forbidden.",
-                    new Object[] { resourceToCreate });
+            String message = localStrings.getLocalString("rest.resource.post.forbidden",
+                "POST on \"{0}\" is forbidden.", new Object[] {resourceToCreate});
             return Response.status(403)
-                    .entity(ResourceUtil.getActionReportResult(ActionReport.ExitCode.FAILURE, message, requestHeaders, uriInfo)).build();
+                .entity(getActionReportResult(ActionReport.ExitCode.FAILURE, message, requestHeaders, uriInfo)).build();
 
         } catch (Exception e) {
-            throw new WebApplicationException(e, Response.Status.INTERNAL_SERVER_ERROR);
+            throw new WebApplicationException(e);
         }
     }
 
     private Map<String, MethodMetaData> getMethodMetaData() {
-        Map<String, MethodMetaData> map = new TreeMap<String, MethodMetaData>();
+        Map<String, MethodMetaData> map = new TreeMap<>();
         //GET meta data
         map.put("GET", new MethodMetaData());
 
@@ -340,7 +344,15 @@
         return map;
     }
 
-    private String getErrorMessage(HashMap<String, String> data, ActionReport ar) {
-        return ar.getMessage();
+    private WebApplicationException handleException(Exception e) {
+        // note: WeApplicationExceptions are not logged otherwise.
+        LOG.log(Level.SEVERE, "Create resource call failed", e);
+        if (e instanceof TransactionFailure) {
+            TransactionFailure failure = (TransactionFailure) e;
+            if (failure.getCause() instanceof ConstraintViolationException) {
+                return new WebApplicationException(failure, Response.Status.BAD_REQUEST);
+            }
+        }
+        return new WebApplicationException(e);
     }
 }
diff --git a/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/resources/TemplateRestResource.java b/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/resources/TemplateRestResource.java
index 9dba63e..34e526e 100644
--- a/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/resources/TemplateRestResource.java
+++ b/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/resources/TemplateRestResource.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2009, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -86,7 +87,7 @@
     protected ConfigModel childModel; //good model even if the child entity is null
     protected String childID; // id of the current child if part of a list, might be null
     public final static LocalStringManagerImpl localStrings = new LocalStringManagerImpl(TemplateRestResource.class);
-    final private static List<String> attributesToSkip = new ArrayList<String>() {
+    final private static List<String> attributesToSkip = new ArrayList<>() {
 
         {
             add("parent");
@@ -118,7 +119,7 @@
             throw new WebApplicationException(Response.Status.NOT_FOUND);
         }
 
-        return getAttributes((ConfigBean) getEntity());
+        return getAttributes(getEntity());
     }
 
     @POST
@@ -183,7 +184,7 @@
      */
     protected RestActionReporter doCreateOrUpdate(HashMap<String, String> data) {
         if (data == null) {
-            data = new HashMap<String, String>();
+            data = new HashMap<>();
         }
         try {
             //data.remove("submit");
@@ -226,7 +227,7 @@
 
     protected ExitCode doDelete(HashMap<String, String> data) {
         if (data == null) {
-            data = new HashMap<String, String>();
+            data = new HashMap<>();
         }
         if (entity == null) {//wrong resource
             //            return Response.status(404).entity(ResourceUtil.getActionReportResult(ActionReport.ExitCode.FAILURE, errorMessage, requestHeaders, uriInfo)).build();
@@ -372,7 +373,7 @@
      * local location on the server side (ie. just the path)
      */
     public static HashMap<String, String> createDataBasedOnForm(FormDataMultiPart formData) {
-        HashMap<String, String> data = new HashMap<String, String>();
+        HashMap<String, String> data = new HashMap<>();
         try {
             //data passed to the generic command running
             Map<String, List<FormDataBodyPart>> m1 = formData.getFields();
@@ -380,10 +381,11 @@
             Set<String> ss = m1.keySet();
             for (String fieldName : ss) {
                 for (FormDataBodyPart bodyPart : formData.getFields(fieldName)) {
-                    if (bodyPart.getContentDisposition().getFileName() != null) {//we have a file
+                    if (bodyPart.getContentDisposition().getFileName() == null) {
+                        data.put(fieldName, bodyPart.getValue());
+                    } else {
                         //save it and mark it as delete on exit.
                         InputStream fileStream = bodyPart.getValueAs(InputStream.class);
-                        String mimeType = bodyPart.getMediaType().toString();
 
                         //Use just the filename without complete path. File creation
                         //in case of remote deployment failing because fo this.
@@ -396,13 +398,9 @@
                             }
                         }
 
-                        File f = Util.saveFile(fileName, mimeType, fileStream);
-                        f.deleteOnExit();
+                        File f = Util.saveTemporaryFile(fileName, fileStream);
                         //put only the local path of the file in the same field.
                         data.put(fieldName, f.getAbsolutePath());
-
-                    } else {
-                        data.put(fieldName, bodyPart.getValue());
                     }
                 }
             }
@@ -448,7 +446,7 @@
 
                 String keyvalue = c.attribute(keyAttributeName.toLowerCase(Locale.US));
                 if (keyvalue.equals(childID)) {
-                    setEntity((ConfigBean) c);
+                    setEntity(c);
                 }
             }
         }
@@ -565,7 +563,7 @@
 
     //******************************************************************************************************************
     private Map<String, String> getAttributes(Dom entity) {
-        Map<String, String> result = new TreeMap<String, String>();
+        Map<String, String> result = new TreeMap<>();
         Set<String> attributeNames = entity.model.getAttributeNames();
         for (String attributeName : attributeNames) {
             result.put(eleminateHypen(attributeName), entity.attribute(attributeName));
@@ -575,7 +573,7 @@
     }
 
     private Map<String, MethodMetaData> getMethodMetaData() {
-        Map<String, MethodMetaData> map = new TreeMap<String, MethodMetaData>();
+        Map<String, MethodMetaData> map = new TreeMap<>();
         //GET meta data
         map.put("GET", new MethodMetaData());
 
diff --git a/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/utils/Util.java b/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/utils/Util.java
index 8d8fd65..f876697 100644
--- a/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/utils/Util.java
+++ b/nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/utils/Util.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2009, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -44,8 +45,6 @@
 import jakarta.ws.rs.core.HttpHeaders;
 import org.glassfish.admin.rest.Constants;
 import org.glassfish.admin.rest.RestLogging;
-import org.glassfish.admin.rest.model.ResponseBody;
-
 import org.glassfish.admin.rest.utils.xml.RestActionReporter;
 import org.glassfish.admin.restconnector.RestConfig;
 import org.glassfish.api.ActionReport.MessagePart;
@@ -330,7 +329,7 @@
     }
 
     public static Map<String, String> getCurrentValues(String basePath, ServiceLocator habitat, Subject subject) {
-        Map<String, String> values = new HashMap<String, String>();
+        Map<String, String> values = new HashMap<>();
         final String path = (basePath.endsWith(".")) ? basePath.substring(0, basePath.length() - 1) : basePath;
         RestActionReporter gr = ResourceUtil.runCommand("get", new ParameterMap() {
             {
@@ -442,7 +441,6 @@
             String sep = "";
             for (CommandModel.ParamModel model : params) {
                 Param param = model.getParam();
-                boolean include = true;
                 if (param.optional() && !includeOptional) {
                     continue;
                 }
@@ -467,38 +465,38 @@
         return sb.toString();
     }
 
-    public static File saveFile(String fileName, String mimeType, InputStream fileStream) {
-        BufferedOutputStream out = null;
-        File f = null;
+    public static File saveTemporaryFile(String fileName, InputStream fileStream) {
+        File file;
         try {
-            if (fileName.contains(".")) {
-                //String prefix = fileName.substring(0, fileName.indexOf("."));
-                // String suffix = fileName.substring(fileName.indexOf("."), fileName.length());
-                //if (prefix.length() < 3) {
-                //    prefix = "glassfish" + prefix;
-                //}
-                f = new File(new File(System.getProperty("java.io.tmpdir")), fileName);
-            }
-
-            out = new BufferedOutputStream(new FileOutputStream(f));
+            String[] parts = getNameAndSuffix(fileName);
+            file = File.createTempFile(parts[0], parts[1]);
+        } catch (IOException e) {
+            throw new IllegalStateException("Could not create a temp file for " + fileName, e);
+        }
+        try (BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(file))) {
             byte[] buffer = new byte[32 * 1024];
             int bytesRead = 0;
             while ((bytesRead = fileStream.read(buffer)) != -1) {
                 out.write(buffer, 0, bytesRead);
             }
-            return f;
-        } catch (IOException ex) {
-            RestLogging.restLogger.log(Level.SEVERE, RestLogging.IO_EXCEPTION, ex.getMessage());
-        } finally {
-            try {
-                if (out != null) {
-                    out.close();
-                }
-            } catch (IOException ex) {
-                RestLogging.restLogger.log(Level.SEVERE, RestLogging.IO_EXCEPTION, ex.getMessage());
-            }
+            return file;
+        } catch (IOException e) {
+            throw new IllegalStateException("Could not write to a temp file " + file, e);
         }
-        return null;
+    }
+
+
+    private static String[] getNameAndSuffix(String fileName) {
+        if (fileName == null) {
+            return new String[2];
+        }
+        int dotPosition = fileName.lastIndexOf('.');
+        if (dotPosition < 1) {
+            // on Linux: files with dots as the first char mean hidden files.
+            // or the dot wasn't found at all
+            return new String[] {fileName, null};
+        }
+        return new String[] {fileName.substring(0, dotPosition), fileName.substring(dotPosition)};
     }
 
     public static boolean isGenericType(Type type) {
diff --git a/nucleus/cluster/admin/src/main/java/com/sun/enterprise/v3/admin/cluster/DeleteNodeConfigCommand.java b/nucleus/cluster/admin/src/main/java/com/sun/enterprise/v3/admin/cluster/DeleteNodeConfigCommand.java
index 425ce46..8358051 100644
--- a/nucleus/cluster/admin/src/main/java/com/sun/enterprise/v3/admin/cluster/DeleteNodeConfigCommand.java
+++ b/nucleus/cluster/admin/src/main/java/com/sun/enterprise/v3/admin/cluster/DeleteNodeConfigCommand.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,28 +17,34 @@
 
 package com.sun.enterprise.v3.admin.cluster;
 
-import com.sun.enterprise.config.serverbeans.*;
-import com.sun.enterprise.util.SystemPropertyConstants;
-import com.sun.enterprise.util.StringUtils;
+import com.sun.enterprise.config.serverbeans.Node;
+import com.sun.enterprise.config.serverbeans.Nodes;
+
+import jakarta.inject.Inject;
+
+import java.util.logging.Logger;
+
 import org.glassfish.api.ActionReport;
 import org.glassfish.api.I18n;
 import org.glassfish.api.Param;
-import org.glassfish.api.admin.*;
+import org.glassfish.api.admin.AdminCommand;
+import org.glassfish.api.admin.AdminCommandContext;
+import org.glassfish.api.admin.CommandRunner;
 import org.glassfish.api.admin.CommandRunner.CommandInvocation;
-import jakarta.inject.Inject;
-
+import org.glassfish.api.admin.ExecuteOn;
+import org.glassfish.api.admin.ParameterMap;
+import org.glassfish.api.admin.RestEndpoint;
+import org.glassfish.api.admin.RestEndpoints;
+import org.glassfish.api.admin.RuntimeType;
 import org.glassfish.hk2.api.IterableProvider;
 import org.glassfish.hk2.api.PerLookup;
 import org.glassfish.hk2.api.ServiceLocator;
-
 import org.jvnet.hk2.annotations.Service;
-import org.jvnet.hk2.component.*;
-import java.util.logging.Logger;
 
 
 /**
  * Remote AdminCommand to create a config node.  This command is run only on DAS.
- *  Register the config node on DAS
+ * Register the config node on DAS
  *
  * @author Carla Mott
  */
diff --git a/nucleus/common/common-util/osgi.bundle b/nucleus/common/common-util/osgi.bundle
index cda35f5..3f03166 100644
--- a/nucleus/common/common-util/osgi.bundle
+++ b/nucleus/common/common-util/osgi.bundle
@@ -46,10 +46,11 @@
                         com.sun.enterprise.util.zip; \
                         com.sun.logging; \
                         org.glassfish.admin.payload; \
-                        org.glassfish.common.util.admin; \
                         org.glassfish.common.util; \
-                        org.glassfish.quality; \
+                        org.glassfish.common.util.admin; \
+                        org.glassfish.common.util.io; \
                         org.glassfish.common.util.timer; \
+                        org.glassfish.quality; \
                         org.glassfish.security.common; \
                         com.sun.logging.enterprise.system.core; \
                         org.glassfish.server; version=${project.osgi.version}
diff --git a/nucleus/common/common-util/src/main/java/org/glassfish/common/util/io/EmptyInputStream.java b/nucleus/common/common-util/src/main/java/org/glassfish/common/util/io/EmptyInputStream.java
new file mode 100644
index 0000000..7289af9
--- /dev/null
+++ b/nucleus/common/common-util/src/main/java/org/glassfish/common/util/io/EmptyInputStream.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2022 Eclipse Foundation and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.common.util.io;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * Input stream which doesn't contain anything.
+ *
+ * @author David Matejcek
+ */
+public class EmptyInputStream extends InputStream {
+
+    @Override
+    public int read() throws IOException {
+        return -1;
+    }
+
+
+    @Override
+    public int available() throws IOException {
+        return 0;
+    }
+
+
+    @Override
+    public int read(final byte[] b) throws IOException {
+        return -1;
+    }
+
+
+    @Override
+    public int read(final byte[] b, final int off, final int len) throws IOException {
+        return -1;
+    }
+}
diff --git a/nucleus/common/common-util/src/main/java/org/glassfish/common/util/io/EmptyOutputStream.java b/nucleus/common/common-util/src/main/java/org/glassfish/common/util/io/EmptyOutputStream.java
new file mode 100644
index 0000000..5f3e07e
--- /dev/null
+++ b/nucleus/common/common-util/src/main/java/org/glassfish/common/util/io/EmptyOutputStream.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2022 Eclipse Foundation and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.common.util.io;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+
+/**
+ * Ignores all input, so is always empty.
+ *
+ * @author David Matejcek
+ */
+public class EmptyOutputStream extends OutputStream {
+
+    @Override
+    public void write(int b) throws IOException {
+        return;
+    }
+
+
+    @Override
+    public void write(byte[] b) throws IOException {
+        return;
+    }
+
+
+    @Override
+    public void write(byte[] b, int off, int len) throws IOException {
+        return;
+    }
+}
diff --git a/nucleus/core/kernel/src/main/java/com/sun/enterprise/v3/admin/GetHabitatInfo.java b/nucleus/core/kernel/src/main/java/com/sun/enterprise/v3/admin/GetHabitatInfo.java
index 3e4415d..6f69959 100644
--- a/nucleus/core/kernel/src/main/java/com/sun/enterprise/v3/admin/GetHabitatInfo.java
+++ b/nucleus/core/kernel/src/main/java/com/sun/enterprise/v3/admin/GetHabitatInfo.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2008, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,8 +17,17 @@
 
 package com.sun.enterprise.v3.admin;
 
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import com.sun.enterprise.config.serverbeans.Domain;
+import com.sun.enterprise.config.serverbeans.customvalidators.JavaClassName;
+import com.sun.enterprise.module.ModulesRegistry;
+import com.sun.enterprise.universal.collections.ManifestUtils;
+import com.sun.enterprise.v3.common.PropsFileActionReporter;
+
+import jakarta.inject.Inject;
+import jakarta.validation.ConstraintValidator;
+import jakarta.validation.ConstraintValidatorContext;
+import jakarta.validation.Payload;
+import jakarta.validation.constraints.Pattern;
 
 import java.io.ByteArrayOutputStream;
 import java.io.PrintStream;
@@ -27,18 +37,11 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import jakarta.inject.Inject;
-import jakarta.validation.ConstraintValidator;
-import jakarta.validation.ConstraintValidatorContext;
-import jakarta.validation.Payload;
-import jakarta.validation.constraints.Pattern;
-
+import java.util.concurrent.atomic.AtomicInteger;
 import org.glassfish.api.ActionReport;
 import org.glassfish.api.ActionReport.ExitCode;
 import org.glassfish.api.Param;
+import org.glassfish.api.admin.AccessRequired;
 import org.glassfish.api.admin.AdminCommand;
 import org.glassfish.api.admin.AdminCommandContext;
 import org.glassfish.api.admin.RestEndpoint;
@@ -50,12 +53,8 @@
 import org.glassfish.hk2.utilities.BuilderHelper;
 import org.jvnet.hk2.annotations.Service;
 
-import com.sun.enterprise.config.serverbeans.Domain;
-import com.sun.enterprise.config.serverbeans.customvalidators.JavaClassName;
-import com.sun.enterprise.module.ModulesRegistry;
-import com.sun.enterprise.universal.collections.ManifestUtils;
-import com.sun.enterprise.v3.common.PropsFileActionReporter;
-import org.glassfish.api.admin.AccessRequired;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
 /**
  * Dumps a sorted list of all registered Contract's in the Habitat
@@ -86,7 +85,7 @@
     @Param(primary = true, optional = true)
     String contract;
 
-    @Pattern(regexp="true|false")
+    @Pattern(regexp="true|false", message = "Valid values: true|false")
     @Param(optional = true)
     String started = "false";
 
@@ -97,8 +96,7 @@
             dumpContracts(sb);
             dumpModules(sb);
             dumpTypes(sb);
-        }
-        else {
+        } else {
             dumpInhabitantsImplementingContractPattern(contract, sb);
         }
 
@@ -114,29 +112,17 @@
     }
 
     private void dumpContracts(StringBuilder sb) {
-        // Probably not very efficient but it is not a factor for this rarely-used
-        // user-called command...
-
         sb.append("\n*********** Sorted List of all Registered Contracts in the Habitat **************\n");
         List<ActiveDescriptor<?>> allDescriptors = serviceLocator.getDescriptors(BuilderHelper.allFilter());
-
-        SortedSet<String> allContracts = new TreeSet<String>();
-        for (ActiveDescriptor<?> aDescriptor : allDescriptors) {
-            allContracts.addAll(aDescriptor.getAdvertisedContracts());
-        }
-
-        // now the contracts are sorted...
-
-        Iterator<String> it = allContracts.iterator();
-        for (int i = 1; it.hasNext(); i++) {
-            sb.append("Contract-" + i + ": " + it.next() + "\n");
-        }
+        AtomicInteger counter = new AtomicInteger(0);
+        allDescriptors.stream().flatMap(desc -> desc.getAdvertisedContracts().stream()).sorted().forEach(contract -> sb
+            .append("Contract-").append(counter.incrementAndGet()).append(": ").append(contract).append('\n'));
     }
 
     private void dumpInhabitantsImplementingContractPattern(String pattern, StringBuilder sb) {
         sb.append("\n*********** List of all services for contract named like " + contract + " **************\n");
         List<ActiveDescriptor<?>> allDescriptors = serviceLocator.getDescriptors(BuilderHelper.allFilter());
-        HashSet<String> allContracts = new HashSet<String>();
+        HashSet<String> allContracts = new HashSet<>();
         for (ActiveDescriptor<?> aDescriptor : allDescriptors) {
             allContracts.addAll(aDescriptor.getAdvertisedContracts());
         }
@@ -144,17 +130,17 @@
         Iterator<String> it = allContracts.iterator();
         while (it.hasNext()) {
             String cn = it.next();
-            if (cn.toLowerCase(Locale.ENGLISH).indexOf(pattern.toLowerCase(Locale.ENGLISH)) < 0)
+            if (cn.toLowerCase(Locale.ENGLISH).indexOf(pattern.toLowerCase(Locale.ENGLISH)) < 0) {
                 continue;
-            sb.append("\n-----------------------------\n");
+            }
+            sb.append("-----------------------------\n");
             for ( ActiveDescriptor<?> descriptor : serviceLocator.getDescriptors(BuilderHelper.createContractFilter(cn))) {
                 sb.append("Inhabitant-Metadata: " + descriptor.getMetadata());
                 sb.append("\n");
                 boolean isStarted = Boolean.parseBoolean(started);
                 if (isStarted) {
-                        ServiceHandle<?> handle = serviceLocator.getServiceHandle(descriptor);
-
-                    sb.append((handle.isActive() ? " started" : " not started"));
+                    ServiceHandle<?> handle = serviceLocator.getServiceHandle(descriptor);
+                    sb.append(handle.isActive() ? " started" : " not started");
                 }
             }
         }
@@ -163,40 +149,20 @@
     private void dumpTypes(StringBuilder sb) {
         sb.append("\n\n*********** Sorted List of all Types in the Habitat **************\n\n");
         List<ActiveDescriptor<?>> allDescriptors = serviceLocator.getDescriptors(BuilderHelper.allFilter());
-        HashSet<String> allTypes = new HashSet<String>();
-        for (ActiveDescriptor<?> aDescriptor : allDescriptors) {
-            allTypes.add(aDescriptor.getImplementation());
-        }
-
-        Iterator<String> it = allTypes.iterator();
-
-        if (it == null)  //PP (paranoid programmer)
-            return;
-
-        SortedSet<String> types = new TreeSet<String>();
-
-        while (it.hasNext()) {
-            types.add(it.next());
-        }
-
-        // now the types are sorted...
-
-        it = types.iterator();
-
-        for (int i = 1; it.hasNext(); i++) {
-            sb.append("Type-" + i + ": " + it.next() + "\n");
-        }
+        AtomicInteger counter = new AtomicInteger(0);
+        allDescriptors.stream().map(ActiveDescriptor::getImplementation).sorted().forEach(
+            impl -> sb.append("Type-").append(counter.incrementAndGet()).append(": ").append(impl).append('\n'));
     }
 
     private void dumpModules(StringBuilder sb) {
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         modulesRegistry.dumpState(new PrintStream(baos));
         sb.append("\n\n*********** List of all Registered Modules **************\n\n");
-        sb.append(baos.toString());
+        sb.append(baos);
     }
-    /*
-     * NOTE: this valdation is here just to test the AdminCommand validation
-     * implementation.
+
+    /**
+     * NOTE: this valdation is here just to test the AdminCommand validation implementation.
      */
     @Retention(RUNTIME)
     @Target({TYPE})
@@ -216,8 +182,9 @@
         @Override
         public boolean isValid(final GetHabitatInfo bean,
             final ConstraintValidatorContext constraintValidatorContext) {
-            if (bean.contract.equals("test") && bean.started.equals("true"))
+            if ("test".equals(bean.contract) && "true".equals(bean.started)) {
                 return false;
+            }
             return true;
         }
     }
diff --git a/nucleus/deployment/common/src/main/resources/com/sun/logging/enterprise/system/tools/deployment/LogStrings.properties b/nucleus/deployment/common/src/main/resources/com/sun/logging/enterprise/system/tools/deployment/LogStrings.properties
index b0f6b45..4fd76aa 100644
--- a/nucleus/deployment/common/src/main/resources/com/sun/logging/enterprise/system/tools/deployment/LogStrings.properties
+++ b/nucleus/deployment/common/src/main/resources/com/sun/logging/enterprise/system/tools/deployment/LogStrings.properties
@@ -114,17 +114,6 @@
 DPL8011.diag.check.1=Ensure that the application can be deployed using CLI
 DPL8011.diag.check.2=Ensure that there autodeploy config info is set properly and the server is up and running
 
-
-
-
-enterprise.deployment.backend.invalidDescriptorFailure=DPL8015: Invalid Deployment Descriptors in {0} \nLine {1} Column {2} -- {3}
-DPL8015.diag.cause.1=Failed to find the resource specified in the deployment descriptor
-DPL8015.diag.cause.2=May be because of wrong specification in the descriptor
-DPL8015.diag.check.1=Ensure that the resource specified is present
-DPL8015.diag.check.2=Ensure that there is no typo in the resource specified in the descriptor
-
-
-
 enterprise.deployment.backend.ejbRefTypeMismatch=DPL8017: Ejb-ref type mismatch for ejb reference {0}.  Reference declares type {1} but target ejb {2} has {3} interface of type {4}.
 DPL8017.diag.cause.1=Possible type mismatch in ejb-ref/ejb-local-ref/@EJB
 DPL8017.diag.cause.2=May be because of wrong specification in the descriptor
diff --git a/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/Http.java b/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/Http.java
index 6278b83..6b68d3f 100644
--- a/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/Http.java
+++ b/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/Http.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2009, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -113,7 +114,7 @@
     void setCompressableMimeType(String type);
 
     @Attribute(defaultValue = COMPRESSION, dataType = String.class)
-    @Pattern(regexp = COMPRESSION_PATTERN)
+    @Pattern(regexp = COMPRESSION_PATTERN, message = "Pattern: " + COMPRESSION_PATTERN)
     String getCompression();
 
     void setCompression(String compression);
@@ -470,6 +471,7 @@
 
     void setHttp2Enabled(boolean http2Enabled);
 
+    @Override
     @DuckTyped
     Protocol getParent();
 
diff --git a/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/NetworkListener.java b/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/NetworkListener.java
index 5847047..c661fd1 100644
--- a/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/NetworkListener.java
+++ b/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/NetworkListener.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2009, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,13 +17,13 @@
 
 package org.glassfish.grizzly.config.dom;
 
+import jakarta.validation.constraints.Pattern;
+
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
-import jakarta.validation.constraints.Pattern;
-
 import org.jvnet.hk2.config.Attribute;
 import org.jvnet.hk2.config.ConfigBeanProxy;
 import org.jvnet.hk2.config.Configured;
@@ -39,7 +40,7 @@
     boolean JK_ENABLED = false;
     String DEFAULT_ADDRESS = "0.0.0.0";
     String DEFAULT_CONFIGURATION_FILE = "${com.sun.aas.instanceRoot}/config/glassfish-jk.properties";
-    String TYPE_PATTERN = "(standard|proxy)";
+    String LISTENER_TYPES = "(standard|proxy)";
     String DEFAULT_TYPE = "standard";
 
 
@@ -85,7 +86,7 @@
      * Network-listener name, which could be used as reference
      */
     @Attribute(required = true, dataType = String.class, defaultValue = DEFAULT_TYPE)
-    @Pattern(regexp = TYPE_PATTERN)
+    @Pattern(regexp = LISTENER_TYPES, message = "Valid values: " + LISTENER_TYPES)
     String getType();
 
     void setType(String type);
@@ -138,6 +139,7 @@
     @DuckTyped
     Transport findTransport();
 
+    @Override
     @DuckTyped
     NetworkListeners getParent();
 
@@ -204,7 +206,7 @@
                 final ConfigBeanProxy parent = listener.getParent().getParent().getParent();
                 final Dom proxy = Dom.unwrap(parent).element("thread-pools");
                 final List<Dom> domList = proxy.nodeElements("thread-pool");
-                list = new ArrayList<ThreadPool>(domList.size());
+                list = new ArrayList<>(domList.size());
                 for (Dom dom : domList) {
                     list.add(dom.<ThreadPool>createProxy());
                 }
diff --git a/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/ProtocolChain.java b/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/ProtocolChain.java
index 1672f06..9f4c8cd 100644
--- a/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/ProtocolChain.java
+++ b/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/ProtocolChain.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2009, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -46,7 +47,7 @@
      * Protocol chain type. Could be STATEFUL or STATELESS
      */
     @Attribute(defaultValue = TYPE)
-    @Pattern(regexp = TYPE_PATTERN)
+    @Pattern(regexp = TYPE_PATTERN, message = "Valid values: " + TYPE_PATTERN)
     String getType();
 
     void setType(String value);
@@ -59,6 +60,7 @@
 
     void setProtocolFilter(List<ProtocolFilter> list);
 
+    @Override
     @DuckTyped
     Protocol getParent();
 
diff --git a/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/Ssl.java b/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/Ssl.java
index e74b3f6..a1054cc 100644
--- a/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/Ssl.java
+++ b/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/Ssl.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2009, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -57,8 +58,8 @@
     void setCertNickname(String value);
 
     /**
-     * Determines whether SSL3 client authentication is performed on every request, independent of ACL-based access
-     * control.
+     * Determines whether SSL3 client authentication is performed on every request,
+     * independent of ACL-based access control.
      */
     @Attribute(defaultValue = "" + CLIENT_AUTH_ENABLED, dataType = Boolean.class)
     String getClientAuthEnabled();
@@ -66,11 +67,11 @@
     void setClientAuthEnabled(String value);
 
     /**
-     * Determines if if the engine will request (want) or require (need) client authentication. Valid values:  want,
-     * need, or left blank
+     * Determines if if the engine will request (want) or require (need) client authentication.
+     * Valid values: want, need, or left blank
      */
     @Attribute(dataType = String.class, defaultValue = "")
-    @Pattern(regexp = CLIENT_AUTH_PATTERN)
+    @Pattern(regexp = CLIENT_AUTH_PATTERN, message = "Valid values: " + CLIENT_AUTH_PATTERN)
     String getClientAuth();
 
     void setClientAuth(String value);
@@ -89,7 +90,7 @@
      * type of the keystore file
      */
     @Attribute(dataType = String.class)
-    @Pattern(regexp = STORE_TYPE_PATTERN)
+    @Pattern(regexp = STORE_TYPE_PATTERN, message = "Valid values: " + STORE_TYPE_PATTERN)
     String getKeyStoreType();
 
     void setKeyStoreType(String type);
@@ -126,7 +127,7 @@
      * ciphers are assumed to be enabled. NOT Used in PE
      */
     @Attribute
-    @Pattern(regexp = SSL2_CIPHERS_PATTERN)
+    @Pattern(regexp = SSL2_CIPHERS_PATTERN, message = "Valid values: " + SSL2_CIPHERS_PATTERN)
     String getSsl2Ciphers();
 
     void setSsl2Ciphers(String value);
@@ -221,7 +222,7 @@
      * type of the truststore file
      */
     @Attribute(dataType = String.class)
-    @Pattern(regexp = STORE_TYPE_PATTERN)
+    @Pattern(regexp = STORE_TYPE_PATTERN, message = "Valid values: " + STORE_TYPE_PATTERN)
     String getTrustStoreType();
 
     void setTrustStoreType(String type);
diff --git a/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/Transport.java b/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/Transport.java
index a13648b..4df3edd 100644
--- a/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/Transport.java
+++ b/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/Transport.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2009, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -33,6 +34,7 @@
 @Configured
 public interface Transport extends ConfigBeanProxy, PropertyBag {
 
+    String BYTE_BUFFER_TYPES = "heap|direct";
     boolean DISPLAY_CONFIGURATION = false;
     boolean ENABLE_SNOOP = false;
     boolean TCP_NO_DELAY = true;
@@ -89,7 +91,11 @@
      * Type of ByteBuffer, which will be used with transport. Possible values are: HEAP and DIRECT
      */
     @Attribute(defaultValue = BYTE_BUFFER_TYPE, dataType = String.class)
-    @Pattern(regexp = "heap|direct", flags = Pattern.Flag.CASE_INSENSITIVE)
+    @Pattern(
+        regexp = BYTE_BUFFER_TYPES,
+        message = "Valid values: " + BYTE_BUFFER_TYPES,
+        flags = Pattern.Flag.CASE_INSENSITIVE
+    )
     String getByteBufferType();
 
     void setByteBufferType(String value);
@@ -208,6 +214,7 @@
     @DuckTyped
     List<NetworkListener> findNetworkListeners();
 
+    @Override
     @DuckTyped
     Transports getParent();
 
@@ -215,7 +222,7 @@
         static public List<NetworkListener> findNetworkListeners(Transport transport) {
             NetworkListeners networkListeners =
                     transport.getParent().getParent().getNetworkListeners();
-            List<NetworkListener> refs = new ArrayList<NetworkListener>();
+            List<NetworkListener> refs = new ArrayList<>();
             for (NetworkListener listener : networkListeners.getNetworkListener()) {
                 if (listener.getTransport().equals(transport.getName())) {
                     refs.add(listener);
diff --git a/nucleus/hk2/config-generator/pom.xml b/nucleus/hk2/config-generator/pom.xml
index 46b8bfe..d1aa740 100644
--- a/nucleus/hk2/config-generator/pom.xml
+++ b/nucleus/hk2/config-generator/pom.xml
@@ -53,7 +53,6 @@
         <dependency>
             <groupId>org.glassfish.hk2</groupId>
             <artifactId>hk2-utils</artifactId>
-            <version>${hk2.version}</version>
         </dependency>
         <dependency>
             <groupId>org.glassfish.main.hk2</groupId>
@@ -79,5 +78,14 @@
             <groupId>jakarta.annotation</groupId>
             <artifactId>jakarta.annotation-api</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>org.junit.jupiter</groupId>
+            <artifactId>junit-jupiter-engine</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.hamcrest</groupId>
+            <artifactId>hamcrest</artifactId>
+        </dependency>
     </dependencies>
 </project>
diff --git a/nucleus/hk2/config-generator/src/test/java/com/sun/enterprise/tools/classmodel/UtilitiesTest.java b/nucleus/hk2/config-generator/src/test/java/com/sun/enterprise/tools/classmodel/UtilitiesTest.java
index 2e819fd..3bf2cd5 100644
--- a/nucleus/hk2/config-generator/src/test/java/com/sun/enterprise/tools/classmodel/UtilitiesTest.java
+++ b/nucleus/hk2/config-generator/src/test/java/com/sun/enterprise/tools/classmodel/UtilitiesTest.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2007, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,9 +17,9 @@
 
 package com.sun.enterprise.tools.classmodel;
 
-import static org.junit.Assert.*;
+import org.junit.jupiter.api.Test;
 
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 
 public class UtilitiesTest {
diff --git a/nucleus/hk2/hk2-config/src/main/java/org/jvnet/hk2/config/WriteableView.java b/nucleus/hk2/hk2-config/src/main/java/org/jvnet/hk2/config/WriteableView.java
index 4b09ea1..cb10c38 100644
--- a/nucleus/hk2/hk2-config/src/main/java/org/jvnet/hk2/config/WriteableView.java
+++ b/nucleus/hk2/hk2-config/src/main/java/org/jvnet/hk2/config/WriteableView.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2007, 2020 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -16,23 +17,43 @@
 
 package org.jvnet.hk2.config;
 
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Proxy;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
+import jakarta.validation.ConstraintViolation;
+import jakarta.validation.ConstraintViolationException;
+import jakarta.validation.ElementKind;
+import jakarta.validation.Path;
+import jakarta.validation.TraversableResolver;
+import jakarta.validation.Validation;
+import jakarta.validation.Validator;
+import jakarta.validation.ValidatorContext;
+import jakarta.validation.ValidatorFactory;
+import jakarta.validation.metadata.ConstraintDescriptor;
+
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyVetoException;
 import java.lang.annotation.ElementType;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Proxy;
+import java.lang.reflect.Type;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.text.MessageFormat;
-import java.util.*;
-import java.util.concurrent.locks.Lock;
+import java.util.AbstractList;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.ResourceBundle;
+import java.util.Set;
+import java.util.StringTokenizer;
 
-import jakarta.validation.*;
-import jakarta.validation.metadata.ConstraintDescriptor;
-
+import org.hibernate.validator.HibernateValidator;
+import org.jvnet.hk2.config.ConfigModel.AttributeLeaf;
 import org.jvnet.hk2.config.ConfigModel.Property;
 
 /**
@@ -42,17 +63,19 @@
  * @author Jerome Dochez
  */
 public class WriteableView implements InvocationHandler, Transactor, ConfigView {
+
     private static final TraversableResolver TRAVERSABLE_RESOLVER = new TraversableResolver() {
-        public boolean isReachable(Object traversableObject,
-                Path.Node traversableProperty, Class<?> rootBeanType,
-                Path pathToTraversableObject, ElementType elementType) {
-                    return true;
+
+        @Override
+        public boolean isReachable(Object traversableObject, Path.Node traversableProperty, Class<?> rootBeanType,
+            Path pathToTraversableObject, ElementType elementType) {
+            return true;
         }
 
-        public boolean isCascadable(Object traversableObject,
-                Path.Node traversableProperty, Class<?> rootBeanType,
-                Path pathToTraversableObject, ElementType elementType) {
-                    return true;
+        @Override
+        public boolean isCascadable(Object traversableObject, Path.Node traversableProperty, Class<?> rootBeanType,
+            Path pathToTraversableObject, ElementType elementType) {
+            return true;
         }
 
     };
@@ -60,22 +83,22 @@
     private final static Validator beanValidator;
 
     static {
-        ClassLoader cl = System.getSecurityManager()==null?Thread.currentThread().getContextClassLoader():
-            AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
-               @Override
-               public ClassLoader run() {
-                   return Thread.currentThread().getContextClassLoader();
-               }
+        ClassLoader cl = System.getSecurityManager() == null
+            ? Thread.currentThread().getContextClassLoader()
+            : AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+
+                @Override
+                public ClassLoader run() {
+                    return Thread.currentThread().getContextClassLoader();
+                }
             });
 
        try {
-           Thread.currentThread().setContextClassLoader(org.hibernate.validator.HibernateValidator.class.getClassLoader());
-
+           Thread.currentThread().setContextClassLoader(HibernateValidator.class.getClassLoader());
            ValidatorFactory validatorFactory = Validation.buildDefaultValidatorFactory();
            ValidatorContext validatorContext = validatorFactory.usingContext();
            validatorContext.messageInterpolator(new MessageInterpolatorImpl());
-           beanValidator = validatorContext.traversableResolver(
-                       TRAVERSABLE_RESOLVER).getValidator();
+           beanValidator = validatorContext.traversableResolver(TRAVERSABLE_RESOLVER).getValidator();
        } finally {
            Thread.currentThread().setContextClassLoader(cl);
        }
@@ -97,85 +120,80 @@
     public WriteableView(ConfigBeanProxy readView) {
         this.bean = (ConfigBean) ((ConfigView) Proxy.getInvocationHandler(readView)).getMasterView();
         this.defaultView = bean.createProxy();
-        changedAttributes = new HashMap<String, PropertyChangeEvent>();
-        changedCollections = new HashMap<String, ProtectedList>();
+        changedAttributes = new HashMap<>();
+        changedCollections = new HashMap<>();
     }
 
+    @Override
     public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
-
-        if (method.getName().equals("hashCode"))
+        if (method.getName().equals("hashCode")) {
             return super.hashCode();
+        }
 
-        if (method.getName().equals("equals"))
+        if (method.getName().equals("equals")) {
             return super.equals(args[0]);
+        }
 
-        if(method.getAnnotation(DuckTyped.class)!=null) {
+        if (method.getAnnotation(DuckTyped.class) != null) {
             return bean.invokeDuckMethod(method,proxy,args);
         }
 
         ConfigModel.Property property = bean.model.toProperty(method);
+        if (property == null) {
+            throw new IllegalArgumentException("No corresponding property found for method: " + method);
+        }
 
-        if(property==null)
-             throw new IllegalArgumentException(
-                "No corresponding property found for method: "+method);
-
-        if(args==null || args.length==0) {
+        if (args == null || args.length == 0) {
             // getter, maybe one of our changed properties
             if (changedAttributes.containsKey(property.xmlName())) {
                 // serve masked changes.
                 Object changedValue = changedAttributes.get(property.xmlName()).getNewValue();
                 if (changedValue instanceof Dom) {
                     return ((Dom) changedValue).createProxy();
-                } else {
-                    return changedValue;
                 }
-            } else {
-                // pass through.
-                return getter(property, method.getGenericReturnType());
+                return changedValue;
             }
-        } else {
-            setter(property, args[0], method.getGenericParameterTypes()[0]);
-            return null;
+            // pass through.
+            return getter(property, method.getGenericReturnType());
         }
-    }
-
-    public String getPropertyValue(String propertyName) {
-
-        ConfigModel.Property prop = this.getProperty(propertyName);
-        if (prop!=null) {
-            if (changedAttributes.containsKey(prop.xmlName())) {
-                // serve masked changes.
-                return (String) changedAttributes.get(prop.xmlName()).getNewValue();
-            } else {
-                return (String) getter(prop, String.class);
-            }
-        }
+        setter(property, args[0], method.getGenericParameterTypes()[0]);
         return null;
     }
 
-    public synchronized Object getter(ConfigModel.Property property, java.lang.reflect.Type t) {
+    public String getPropertyValue(String propertyName) {
+        ConfigModel.Property prop = this.getProperty(propertyName);
+        if (prop == null) {
+            return null;
+        }
+        if (changedAttributes.containsKey(prop.xmlName())) {
+            // serve masked changes.
+            return (String) changedAttributes.get(prop.xmlName()).getNewValue();
+        }
+        return (String) getter(prop, String.class);
+    }
+
+    public synchronized Object getter(ConfigModel.Property property, Type t) {
         Object value =  bean._getter(property, t);
         if (value instanceof List) {
             if (!changedCollections.containsKey(property.xmlName())) {
                 // wrap collections so we can record events on that collection mutation.
                 changedCollections.put(property.xmlName(),
-                        new ProtectedList(List.class.cast(value), defaultView, property.xmlName()));
+                    new ProtectedList(List.class.cast(value), defaultView, property.xmlName()));
             }
             return changedCollections.get(property.xmlName());
         }
         return value;
     }
 
-    public synchronized void setter(ConfigModel.Property property,
-        Object newValue, java.lang.reflect.Type t)  {
-
+    public synchronized void setter(ConfigModel.Property property, Object newValue, Type t) {
         // are we still in a transaction
-        if (currentTx==null) {
+        if (currentTx == null) {
             throw new IllegalStateException("Not part of a transaction");
         }
         try {
-            if (newValue != null)
+            if (newValue != null) {
                 handleValidation(property, newValue);
+            }
         } catch(Exception v) {
             bean.getLock().unlock();
             throw new RuntimeException(v);
@@ -211,14 +229,14 @@
                 // Resources
                 List<Dom> siblings = parent != null
                         ? parent.domNodeByTypeElements(thisview.getProxyType())
-                        : new ArrayList<Dom>();
+                        : new ArrayList<>();
 
                 // Iterate through each sibling element and see if anyone has
                 // same key. If true throw an exception after unlocking this
                 // element
                 for (Dom sibling : siblings) {
                     String siblingKey = sibling.getKey();
-                    if (newValue.equals(siblingKey)) {
+                    if (siblingKey.equals(newValue)) {
                         bean.getLock().unlock();
                         throw new IllegalArgumentException(
                             "Keys cannot be duplicate. Old value of this key " +
@@ -231,14 +249,13 @@
         // setter
         Object oldValue = bean.getter(property, t);
         if (newValue instanceof ConfigBeanProxy) {
-            ConfigView bean = (ConfigView)
-                Proxy.getInvocationHandler((ConfigBeanProxy) newValue);
-            newValue = bean.getMasterView();
+            ConfigView view = (ConfigView) Proxy.getInvocationHandler(newValue);
+            newValue = view.getMasterView();
         }
         PropertyChangeEvent evt = new PropertyChangeEvent(
             defaultView,property.xmlName(), oldValue, newValue);
         try {
-            for (ConfigBeanInterceptor interceptor : bean.getOptionalFeatures()) {
+            for (ConfigBeanInterceptor<?> interceptor : bean.getOptionalFeatures()) {
                 interceptor.beforeChange(evt);
             }
         } catch(PropertyVetoException e) {
@@ -246,7 +263,7 @@
         }
 
         changedAttributes.put(property.xmlName(), evt);
-        for (ConfigBeanInterceptor interceptor : bean.getOptionalFeatures()) {
+        for (ConfigBeanInterceptor<?> interceptor : bean.getOptionalFeatures()) {
             interceptor.afterChange(evt, System.currentTimeMillis());
         }
     }
@@ -266,8 +283,9 @@
      * @return true if the enlisting with the passed transaction was accepted,
      *         false otherwise
      */
+    @Override
     public synchronized boolean join(Transaction t) {
-        if (currentTx==null) {
+        if (currentTx == null) {
             currentTx = t;
             t.addParticipant(this);
             return true;
@@ -282,50 +300,49 @@
      *          one passed during the join(Transaction t) call.
      * @return true if the trsaction commiting would be successful
      */
+    @Override
     public synchronized boolean canCommit(Transaction t) throws TransactionFailure {
-        if (!isDeleted) { // HK2-127: validate only if not marked for deletion
-
-            Set constraintViolations =
-                beanValidator.validate(this.getProxy(this.getProxyType()));
-
+        // HK2-127: validate only if not marked for deletion
+        if (!isDeleted) {
+            Set<ConstraintViolation<ConfigBeanProxy>> constraintViolations = beanValidator
+                .validate(this.getProxy(this.getProxyType()));
             try {
                 handleValidationException(constraintViolations);
-            } catch (ConstraintViolationException constraintViolationException) {
-                throw new TransactionFailure(constraintViolationException.getMessage(), constraintViolationException);
+            } catch (ConstraintViolationException e) {
+                throw new TransactionFailure(e.getMessage(), e);
             }
         }
-
-        return currentTx==t;
+        return currentTx == t;
     }
 
-    private void handleValidationException(Set constraintViolations) throws ConstraintViolationException {
 
-        if (constraintViolations != null && !constraintViolations.isEmpty()) {
-            Iterator<ConstraintViolation<ConfigBeanProxy>> it = constraintViolations.iterator();
-
-            StringBuilder sb = new StringBuilder();
-            sb.append(MessageFormat.format(i18n.getString("bean.validation.failure"), this.<ConfigBeanProxy>getProxyType().getSimpleName()));
-            String violationMsg = i18n.getString("bean.validation.constraintViolation");
-            while (it.hasNext()) {
-                ConstraintViolation cv = it.next();
-                sb.append(" ");
-                sb.append(MessageFormat.format(violationMsg, cv.getMessage(), cv.getPropertyPath()));
-                if (it.hasNext()) {
-                    sb.append(i18n.getString("bean.validation.separator"));
-                }
-            }
-            bean.getLock().unlock();
-            throw new ConstraintViolationException(sb.toString(), constraintViolations);
+    private void handleValidationException(Set<ConstraintViolation<ConfigBeanProxy>> violations)
+        throws ConstraintViolationException {
+        if (violations == null || violations.isEmpty()) {
+            return;
         }
+        Iterator<ConstraintViolation<ConfigBeanProxy>> it = violations.iterator();
+        StringBuilder sb = new StringBuilder();
+        sb.append(MessageFormat.format(i18n.getString("bean.validation.failure"), getProxyType().getSimpleName()));
+        String violationMsg = i18n.getString("bean.validation.constraintViolation");
+        while (it.hasNext()) {
+            ConstraintViolation<ConfigBeanProxy> violation = it.next();
+            sb.append(" ");
+            sb.append(MessageFormat.format(violationMsg, violation.getMessage(), violation.getPropertyPath()));
+            if (it.hasNext()) {
+                sb.append(i18n.getString("bean.validation.separator"));
+            }
+        }
+        bean.getLock().unlock();
+        throw new ConstraintViolationException(sb.toString(), violations);
     }
 
     /** remove @ or <> eg "@foo" => "foo" or "<foo>" => "foo" */
-    public static String stripMarkers(final String s ) {
-        if ( s.startsWith("@") ) {
+    public static String stripMarkers(final String s) {
+        if (s.startsWith("@")) {
             return s.substring(1);
-        }
-        else if ( s.startsWith("<") ) {
-            return s.substring(1, s.length()-1);
+        } else if (s.startsWith("<")) {
+            return s.substring(1, s.length() - 1);
         }
         return s;
     }
@@ -334,34 +351,33 @@
      * Commit this Transaction.
      *
      * @param t the transaction commiting.
-     * @throws TransactionFailure
-     *          if the transaction commit failed
+     * @throws TransactionFailure if the transaction commit failed
      */
+    @Override
     public synchronized List<PropertyChangeEvent> commit(Transaction t) throws TransactionFailure {
-        if (currentTx==t) {
-            currentTx=null;
+        if (currentTx == t) {
+            currentTx = null;
         }
 
         // a key attribute must be non-null and have length >= 1
         final ConfigBean master = getMasterView();
         final String keyStr = master.model.key;
-        if ( keyStr != null) {
+        if (keyStr != null) {
             final String key = stripMarkers(keyStr);
             final String value = getPropertyValue(key);
-            if ( value == null ) {
-                throw new TransactionFailure( "Key value cannot be null: " + key );
+            if (value == null) {
+                throw new TransactionFailure("Key value cannot be null: " + key);
             }
-            if ( value.length() == 0 ) {
-                throw new TransactionFailure( "Key value cannot be empty string: " + key );
+            if (value.length() == 0) {
+                throw new TransactionFailure("Key value cannot be empty string: " + key);
             }
         }
 
-
         try {
-            List<PropertyChangeEvent> appliedChanges = new ArrayList<PropertyChangeEvent>();
+            List<PropertyChangeEvent> appliedChanges = new ArrayList<>();
             for (PropertyChangeEvent event : changedAttributes.values()) {
                 ConfigModel.Property property = bean.model.findIgnoreCase(event.getPropertyName());
-                ConfigBeanInterceptor interceptor  = bean.getOptionalFeature(ConfigBeanInterceptor.class);
+                ConfigBeanInterceptor<?> interceptor  = bean.getOptionalFeature(ConfigBeanInterceptor.class);
                 try {
                     if (interceptor!=null) {
                         interceptor.beforeChange(event);
@@ -370,24 +386,24 @@
                     throw new TransactionFailure(e.getMessage(), e);
                 }
                 property.set(bean, event.getNewValue());
-                if (interceptor!=null) {
+                if (interceptor != null) {
                     interceptor.afterChange(event, System.currentTimeMillis());
                 }
                 appliedChanges.add(event);
             }
-            for (ProtectedList entry :  changedCollections.values())  {
+            for (ProtectedList entry : changedCollections.values())  {
                 List<Object> originalList = entry.readOnly;
                 for (PropertyChangeEvent event : entry.changeEvents) {
-                    if (event.getOldValue()==null) {
+                    if (event.getOldValue() == null) {
                         originalList.add(event.getNewValue());
                     } else {
                         final Object toBeRemovedObj = event.getOldValue();
-                        if ( toBeRemovedObj instanceof ConfigBeanProxy ) {
-                            final Dom toBeRemoved = Dom.unwrap((ConfigBeanProxy)toBeRemovedObj);
-                            for (int index=0;index<originalList.size();index++) {
+                        if (toBeRemovedObj instanceof ConfigBeanProxy) {
+                            final Dom toBeRemoved = Dom.unwrap((ConfigBeanProxy) toBeRemovedObj);
+                            for (int index = 0; index < originalList.size(); index++) {
                                 Object element = originalList.get(index);
                                 Dom dom = Dom.unwrap((ConfigBeanProxy) element);
-                                if (dom==toBeRemoved) {
+                                if (dom == toBeRemoved) {
                                     Object newValue = event.getNewValue();
                                     if (newValue == null) {
                                         originalList.remove(index);
@@ -396,18 +412,17 @@
                                     }
                                 }
                             }
-                        }
-                        else if ( toBeRemovedObj instanceof String ) {
-                            final String toBeRemoved = (String)toBeRemovedObj;
-                            for (int index=0;index<originalList.size();index++) {
-                                final String item = (String)originalList.get(index);
+                        } else if (toBeRemovedObj instanceof String) {
+                            final String toBeRemoved = (String) toBeRemovedObj;
+                            for (int index = 0; index < originalList.size(); index++) {
+                                final String item = (String) originalList.get(index);
                                 if (item.equals(toBeRemoved)) {
                                     originalList.remove(index);
                                 }
                             }
-                        }
-                        else {
-                              throw new IllegalArgumentException();
+                        } else {
+                            throw new IllegalArgumentException(
+                                "Invalid value for key: " + event.getPropertyName() + ": " + event.getNewValue());
                         }
                     }
                     appliedChanges.add(event);
@@ -416,9 +431,9 @@
             changedAttributes.clear();
             changedCollections.clear();
             return appliedChanges;
-        } catch(TransactionFailure e) {
+        } catch (TransactionFailure e) {
             throw e;
-        } catch(Exception e) {
+        } catch (Exception e) {
             throw new TransactionFailure(e.getMessage(), e);
         } finally {
             bean.getLock().unlock();
@@ -431,8 +446,9 @@
      *
      * @param t the aborting transaction
      */
+    @Override
     public synchronized void abort(Transaction t) {
-        currentTx=null;
+        currentTx = null;
         bean.getLock().unlock();
         changedAttributes.clear();
 
@@ -447,30 +463,33 @@
      * @return the propertly constructed configuration object
      * @throws TransactionFailure if the allocation failed
      */
-
     public <T extends ConfigBeanProxy> T allocateProxy(Class<T> type) throws TransactionFailure {
-        if (currentTx==null) {
+        if (currentTx == null) {
             throw new TransactionFailure("Not part of a transaction", null);
         }
         ConfigBean newBean = bean.allocate(type);
-        WriteableView writeableView = bean.getHabitat().<ConfigSupport>getService(ConfigSupport.class).getWriteableView(newBean.getProxy(type), newBean);
+        bean.getHabitat().<ConfigSupport> getService(ConfigSupport.class);
+        WriteableView writeableView = ConfigSupport.getWriteableView(newBean.getProxy(type), newBean);
         writeableView.join(currentTx);
-
         return writeableView.getProxy(type);
    }
 
+    @Override
     public ConfigBean getMasterView() {
         return bean;
     }
 
+    @Override
     public void setMasterView(ConfigView view) {
 
     }
 
+    @Override
     public <T extends ConfigBeanProxy> Class<T> getProxyType() {
         return bean.getProxyType();
     }
 
+    @Override
     @SuppressWarnings("unchecked")
     public <T extends ConfigBeanProxy> T getProxy(final Class<T> type) {
         final ConfigBean sourceBean = getMasterView();
@@ -478,55 +497,56 @@
             throw new IllegalArgumentException("This config bean interface is " + sourceBean.model.targetTypeName
                     + " not "  + type.getName());
         }
-        Class[] interfacesClasses = { type };
         ClassLoader cl;
-        if (System.getSecurityManager()!=null) {
+        if (System.getSecurityManager() == null) {
+            cl = type.getClassLoader();
+        } else {
             cl = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+
                 @Override
                 public ClassLoader run() {
                     return type.getClassLoader();
                 }
             });
-        } else {
-            cl = type.getClassLoader();
         }
+        Class[] interfacesClasses = {type};
         return (T) Proxy.newProxyInstance(cl, interfacesClasses, this);
     }
 
     boolean removeNestedElements(Object object) {
-        InvocationHandler h = Proxy.getInvocationHandler(object);
-        if (!(h instanceof WriteableView)) { // h instanceof ConfigView
-            ConfigBean bean = (ConfigBean) ((ConfigView) h).getMasterView();
-            h = bean.getWriteableView();
-            if (h == null) {
+        InvocationHandler handler = Proxy.getInvocationHandler(object);
+        if (!(handler instanceof WriteableView)) {
+            ConfigBean masterView = (ConfigBean) ((ConfigView) handler).getMasterView();
+            handler = masterView.getWriteableView();
+            if (handler == null) {
                 ConfigBeanProxy writable;
                 try {
                     writable = currentTx.enroll((ConfigBeanProxy) object);
                 } catch (TransactionFailure e) {
-                    throw new RuntimeException(e); // something is seriously wrong
+                    // something is seriously wrong
+                    throw new IllegalStateException(e);
                 }
-                h = Proxy.getInvocationHandler(writable);
+                handler = Proxy.getInvocationHandler(writable);
             } else {
                 // it's possible to set leaf multiple times,
                 // so oldValue was already processed
                 return false;
             }
         }
-        WriteableView writableView = (WriteableView) h;
+        WriteableView writableView = (WriteableView) handler;
         synchronized (writableView) {
             writableView.isDeleted = true;
         }
         boolean removed = false;
         for (Property property : writableView.bean.model.elements.values()) {
             if (property.isCollection()) {
-                Object nested = writableView.getter(property,
-                        parameterizedType);
+                Object nested = writableView.getter(property, parameterizedType);
                 ProtectedList list = (ProtectedList) nested;
                 if (list.size() > 0) {
                     list.clear();
                     removed = true;
                 }
-            } else if (!property.isLeaf()) { // Element
+            } else if (!property.isLeaf()) {
                 Object oldValue = writableView.getter(property, ConfigBeanProxy.class);
                 if (oldValue != null) {
                     writableView.setter(property, null, Dom.class);
@@ -538,381 +558,384 @@
         return removed;
     }
 
-/**
- * A Protected List is a @Link java.util.List implementation which mutable
- * operations are constrained by the owner of the list.
- *
- * @author Jerome Dochez
- */
-private class ProtectedList extends AbstractList {
+    private final class WriteableViewConstraintViolation implements ConstraintViolation<ConfigBeanProxy> {
 
-    final ConfigBeanProxy readView;
-    final List<Object> readOnly;
-    final String id;
-    final List<PropertyChangeEvent> changeEvents = new ArrayList<PropertyChangeEvent>();
-    final List proxied;
+        private final AttributeLeaf leaf;
+        private final String value;
 
-    ProtectedList(List<Object> readOnly, ConfigBeanProxy parent, String id) {
-        proxied = Collections.synchronizedList(new ArrayList<Object>(readOnly));
-        this.readView = parent;
-        this.readOnly = readOnly;
-        this.id = id;
+        private WriteableViewConstraintViolation(AttributeLeaf leaf, String value) {
+            this.leaf = leaf;
+            this.value = value;
+        }
+
+        @Override
+        public String getMessage() {
+            return i18n.getString(getMessageTemplate()) + leaf.dataType;
+        }
+
+        @Override
+        public String getMessageTemplate() {
+            return "bean.validation.dataType.failure";
+        }
+
+        @Override
+        public ConfigBeanProxy getRootBean() {
+            return (ConfigBeanProxy) WriteableView.this;
+        }
+
+        @Override
+        public Class<ConfigBeanProxy> getRootBeanClass() {
+            return WriteableView.this.getProxyType();
+        }
+
+        @Override
+        public Object getLeafBean() {
+            return null;
+        }
+
+        @Override
+        public Object[] getExecutableParameters() {
+            return null;
+        }
+
+        @Override
+        public Object getExecutableReturnValue() {
+            return null;
+        }
+
+        @Override
+        public Path getPropertyPath() {
+            final Set<Path.Node> nodes = new HashSet<>();
+            nodes.add(new Path.Node() {
+                @Override
+                public String getName() {
+                    return leaf.xmlName;
+                }
+
+                @Override
+                public boolean isInIterable() {
+                    return false;
+                }
+
+                @Override
+                public Integer getIndex() {
+                    return null;
+                }
+
+                @Override
+                public Object getKey() {
+                    return null;
+                }
+
+                @Override
+                public ElementKind getKind() {
+                    return null;
+                }
+
+                @Override
+                public <T extends Path.Node> T as(Class<T> tClass) {
+                    return null;
+                }
+            });
+            return new Path() {
+                @Override
+                public Iterator<Node> iterator() {
+                    return nodes.iterator();
+                }
+
+                @Override
+                public String toString() {
+                   return nodes.iterator().next().getName();
+                }
+            };
+        }
+
+        @Override
+        public Object getInvalidValue() {
+            return value;
+        }
+
+        @Override
+        public ConstraintDescriptor<?> getConstraintDescriptor() {
+            return null;
+        }
+
+        @Override
+        public Object unwrap(Class type) {
+            return null;
+        }
     }
 
     /**
-     * Returns the number of elements in this collection.  If the collection
-     * contains more than <tt>Integer.MAX_VALUE</tt> elements, returns
-     * <tt>Integer.MAX_VALUE</tt>.
+     * A Protected List is a @Link java.util.List implementation which mutable
+     * operations are constrained by the owner of the list.
      *
-     * @return the number of elements in this collection.
+     * @author Jerome Dochez
      */
-    public int size() {
-        return proxied.size();
-    }
+    private class ProtectedList extends AbstractList<Object> {
 
-    /**
-     * Returns the element at the specified position in this list.
-     *
-     * @param index index of element to return.
-     * @return the element at the specified position in this list.
-     * @throws IndexOutOfBoundsException if the given index is out of range
-     *                                   (<tt>index &lt; 0 || index &gt;= size()</tt>).
-     */
-    public Object get(int index) {
-        return proxied.get(index);
-    }
+        final ConfigBeanProxy readView;
+        final List<Object> readOnly;
+        final String id;
+        final List<PropertyChangeEvent> changeEvents = new ArrayList<>();
+        final List<Object> proxied;
 
-    @Override
-    public synchronized boolean add(Object object) {
-        Object param = object;
-        Object handler = null;
-        try {
-            handler = Proxy.getInvocationHandler(object);
-        } catch(IllegalArgumentException e) {
-            // ignore, this is a leaf
+        ProtectedList(List<Object> readOnly, ConfigBeanProxy parent, String id) {
+            proxied = Collections.synchronizedList(new ArrayList<>(readOnly));
+            this.readView = parent;
+            this.readOnly = readOnly;
+            this.id = id;
         }
-        if (handler!=null && handler instanceof WriteableView) {
-            ConfigBean master = ((WriteableView) handler).getMasterView();
-            String key = master.model.key;
-            if (key!=null) {
-                // remove leading @
-                key = key.substring(1);
-                // check that we are not adding a duplicate key element
-                String keyValue = ((WriteableView) handler).getPropertyValue(key);
-                for (Object o : proxied) {
-                    // the proxied object can be a read-only or a writeable view, we need
-                    // to be careful
-                    // ToDo : we need to encasulate this test.
-                    String value = null;
-                    if (Proxy.getInvocationHandler(o) instanceof WriteableView) {
-                        ConfigBean masterView = ((WriteableView) handler).getMasterView();
-                        String masterViewKey = masterView.model.key;
-                        if(masterViewKey != null && key.equals(masterViewKey.substring(1))){
-                            value = ((WriteableView) Proxy.getInvocationHandler(o)).getPropertyValue(key);
+
+        /**
+         * Returns the number of elements in this collection.  If the collection
+         * contains more than <tt>Integer.MAX_VALUE</tt> elements, returns
+         * <tt>Integer.MAX_VALUE</tt>.
+         *
+         * @return the number of elements in this collection.
+         */
+        @Override
+        public int size() {
+            return proxied.size();
+        }
+
+        /**
+         * Returns the element at the specified position in this list.
+         *
+         * @param index index of element to return.
+         * @return the element at the specified position in this list.
+         * @throws IndexOutOfBoundsException if the given index is out of range
+         *                                   (<tt>index &lt; 0 || index &gt;= size()</tt>).
+         */
+        @Override
+        public Object get(int index) {
+            return proxied.get(index);
+        }
+
+        @Override
+        public synchronized boolean add(Object object) {
+            Object param = object;
+            Object handler = null;
+            try {
+                handler = Proxy.getInvocationHandler(object);
+            } catch (IllegalArgumentException e) {
+                // ignore, this is a leaf
+            }
+            if (handler != null && handler instanceof WriteableView) {
+                ConfigBean master = ((WriteableView) handler).getMasterView();
+                String key = master.model.key;
+                if (key != null) {
+                    // remove leading @
+                    key = key.substring(1);
+                    // check that we are not adding a duplicate key element
+                    String keyValue = ((WriteableView) handler).getPropertyValue(key);
+                    for (Object o : proxied) {
+                        // the proxied object can be a read-only or a writeable view, we need
+                        // to be careful
+                        // ToDo : we need to encasulate this test.
+                        String value = null;
+                        if (Proxy.getInvocationHandler(o) instanceof WriteableView) {
+                            ConfigBean masterView = ((WriteableView) handler).getMasterView();
+                            String masterViewKey = masterView.model.key;
+                            if (masterViewKey != null && key.equals(masterViewKey.substring(1))) {
+                                value = ((WriteableView) Proxy.getInvocationHandler(o)).getPropertyValue(key);
+                            }
+                        } else {
+                            Dom cbo = Dom.unwrap((ConfigBeanProxy) o);
+                            String cboKey = cbo.model.key;
+                            if (cboKey != null && key.equals(cboKey.substring(1))) {
+                                value = cbo.attribute(key);
+                            }
                         }
-                    }  else {
-                        Dom cbo = Dom.unwrap((ConfigBeanProxy) o);
-                        String cboKey = cbo.model.key;
-                        if(cboKey != null && key.equals(cboKey.substring(1))){
-                            value = cbo.attribute(key);
+                        if (keyValue != null && value != null && keyValue.equals(value)) {
+                            Dom parent = Dom.unwrap(readView);
+                            throw new IllegalArgumentException("A " + master.getProxyType().getSimpleName()
+                                + " with the same key \"" + keyValue + "\" already exists in "
+                                + parent.getProxyType().getSimpleName() + " " + parent.getKey());
+
                         }
                     }
-                    if (keyValue!=null && value != null && keyValue.equals(value)) {
-                        Dom parent = Dom.unwrap(readView);
-                        throw new IllegalArgumentException("A " + master.getProxyType().getSimpleName() +
-                                " with the same key \"" + keyValue + "\" already exists in " +
-                                parent.getProxyType().getSimpleName() + " " + parent.getKey()) ;
+                }
+                param = ((WriteableView) handler).getMasterView()
+                    .createProxy((Class<ConfigBeanProxy>) master.getImplementationClass());
 
-                    }
+            }
+            PropertyChangeEvent evt = new PropertyChangeEvent(defaultView, id, null, param);
+            changeEvents.add(evt);
+
+            boolean added = proxied.add(object);
+
+            try {
+                for (ConfigBeanInterceptor interceptor : bean.getOptionalFeatures()) {
+                    interceptor.beforeChange(evt);
+                }
+            } catch (PropertyVetoException e) {
+                throw new RuntimeException(e);
+            }
+
+            return added;
+        }
+
+        @Override
+        public synchronized void clear() {
+            // make a temporary list, iterating while removing doesn't work
+            final List<Object> allItems = new ArrayList<>(proxied);
+            for (Object item : allItems) {
+                remove(item);
+            }
+        }
+
+        @Override
+        public synchronized boolean retainAll(final Collection<?> keepers) {
+            final List<Object> toRemoveList = new ArrayList<>();
+            for (Object iffy : proxied) {
+                if (!keepers.contains(iffy)) {
+                    toRemoveList.add(iffy);
                 }
             }
-            param = ((WriteableView) handler).getMasterView().createProxy(
-                    (Class<ConfigBeanProxy>) master.getImplementationClass());
-
-        }
-        PropertyChangeEvent evt = new PropertyChangeEvent(defaultView, id, null, param);
-        changeEvents.add(evt);
-
-        boolean added =  proxied.add(object);
-
-        try {
-            for (ConfigBeanInterceptor interceptor : bean.getOptionalFeatures()) {
-                interceptor.beforeChange(evt);
-            }
-        } catch(PropertyVetoException e) {
-            throw new RuntimeException(e);
+            return removeAll(toRemoveList);
         }
 
-        return added;
-    }
-
-    @Override
-    public synchronized void clear() {
-        // make a temporary list, iterating while removing doesn't work
-        final List allItems = new ArrayList( proxied );
-        for( final Object item : allItems ) {
-            remove( item );
-        }
-    }
-
-    @Override
-    public synchronized boolean retainAll( final Collection keepers ) {
-        final List toRemoveList = new ArrayList();
-        for( final Object iffy : proxied ) {
-            if ( ! keepers.contains(iffy) ) {
-                toRemoveList.add(iffy);
-            }
-        }
-        final boolean changed = removeAll(toRemoveList);
-
-        return changed;
-    }
-
-    @Override
-    public synchronized boolean removeAll( final Collection goners ) {
-        boolean listChanged = false;
-        for( final Object goner : goners ) {
-            if ( remove(goner) ) {
-                listChanged = true;
-            }
-        }
-
-        return listChanged;
-    }
-
-    @Override
-    public synchronized boolean remove(Object object) {
-        PropertyChangeEvent evt = new PropertyChangeEvent(defaultView, id, object, null);
-        boolean removed = false;
-
-        try {
-            ConfigView handler = ((ConfigView) Proxy.getInvocationHandler(object)).getMasterView();
-            for (int index = 0 ; index<proxied.size() && !removed; index++) {
-                Object target = proxied.get(index);
-                try {
-                    ConfigView targetHandler = ((ConfigView) Proxy.getInvocationHandler(target)).getMasterView();
-                    if (targetHandler==handler) {
-                        removed = (proxied.remove(index)!=null);
-                    }
-                } catch(IllegalArgumentException ex) {
-                    // ignore
+        @Override
+        public synchronized boolean removeAll(final Collection<?> goners) {
+            boolean listChanged = false;
+            for (Object goner : goners) {
+                if (remove(goner)) {
+                    listChanged = true;
                 }
             }
-        } catch(IllegalArgumentException e) {
-            // ignore, this is a leaf
-            removed = proxied.remove(object);
-
+            return listChanged;
         }
 
-        try {
-            for (ConfigBeanInterceptor interceptor : bean.getOptionalFeatures()) {
-                interceptor.beforeChange(evt);
+        @Override
+        public synchronized boolean remove(Object object) {
+            PropertyChangeEvent evt = new PropertyChangeEvent(defaultView, id, object, null);
+            boolean removed = false;
+            try {
+                ConfigView handler = ((ConfigView) Proxy.getInvocationHandler(object)).getMasterView();
+                for (int index = 0; index < proxied.size() && !removed; index++) {
+                    Object target = proxied.get(index);
+                    try {
+                        ConfigView targetHandler = ((ConfigView) Proxy.getInvocationHandler(target)).getMasterView();
+                        if (targetHandler == handler) {
+                            removed = (proxied.remove(index) != null);
+                        }
+                    } catch (IllegalArgumentException ex) {
+                        // ignore
+                    }
+                }
+            } catch (IllegalArgumentException e) {
+                // ignore, this is a leaf
+                removed = proxied.remove(object);
+
             }
-        } catch(PropertyVetoException e) {
-            throw new RuntimeException(e);
-        }
 
-        changeEvents.add(evt);
-
-        return removed;
-    }
-
-    public Object set(int index, Object object) {
-        Object replaced = proxied.set(index, object);
-        PropertyChangeEvent evt = new PropertyChangeEvent(defaultView, id, replaced, object);
-        try {
-            for (ConfigBeanInterceptor interceptor : bean.getOptionalFeatures()) {
-                interceptor.beforeChange(evt);
+            try {
+                for (ConfigBeanInterceptor<?> interceptor : bean.getOptionalFeatures()) {
+                    interceptor.beforeChange(evt);
+                }
+            } catch (PropertyVetoException e) {
+                throw new RuntimeException(e);
             }
-        } catch(PropertyVetoException e) {
-            throw new RuntimeException(e);
+
+            changeEvents.add(evt);
+
+            return removed;
         }
-        changeEvents.add(evt);
-        return replaced;
-    }}
+
+        @Override
+        public Object set(int index, Object object) {
+            Object replaced = proxied.set(index, object);
+            PropertyChangeEvent evt = new PropertyChangeEvent(defaultView, id, replaced, object);
+            try {
+                for (ConfigBeanInterceptor<?> interceptor : bean.getOptionalFeatures()) {
+                    interceptor.beforeChange(evt);
+                }
+            } catch (PropertyVetoException e) {
+                throw new RuntimeException(e);
+            }
+            changeEvents.add(evt);
+            return replaced;
+        }}
 
     private String toCamelCase(String xmlName) {
-        StringTokenizer st =  new StringTokenizer(xmlName, "-");
-        StringBuffer camelCaseName = null;
-        if (st.hasMoreTokens()) {
-            camelCaseName = new StringBuffer(st.nextToken());
+        if (xmlName == null) {
+            return null;
         }
-        StringBuffer sb = null;
+        StringTokenizer st = new StringTokenizer(xmlName, "-");
+        StringBuilder camelCaseName = new StringBuilder();
+        camelCaseName.append(st.nextToken());
         while (st.hasMoreTokens()) {
-            sb = new StringBuffer(st.nextToken());
+            StringBuilder sb = new StringBuilder(st.nextToken());
             char startChar = sb.charAt(0);
-            sb.setCharAt(0,Character.toUpperCase(startChar));
+            sb.setCharAt(0, Character.toUpperCase(startChar));
             camelCaseName.append(sb);
         }
-        return (camelCaseName == null) ? null : camelCaseName.toString();
+        return camelCaseName.toString();
     }
 
     private void handleValidation(ConfigModel.Property property, Object value)
-    throws ConstraintViolationException {
+        throws ConstraintViolationException {
 
         // First check for dataType constraints -- as was done for v3 Prelude
         // These validations could be transformed into BV custom annotations
         // such as AssertBoolean, AssertInteger etc. But since GUI and other
         // config clients such as AMX need dataType key in @Attribute it's been
         // decided to validate using existing annotation information
-        Set<ConstraintViolation<?>> constraintViolations = new HashSet<ConstraintViolation<?>>();
+        Set<ConstraintViolation<ConfigBeanProxy>> constraintViolations = new HashSet<>();
         if (property instanceof ConfigModel.AttributeLeaf) {
             ConfigModel.AttributeLeaf al = (ConfigModel.AttributeLeaf)property;
             if (!al.isReference()) {
-                ConstraintViolation cv = validateDataType(al, value.toString());
-                if (cv!=null) {
+                ConstraintViolation<ConfigBeanProxy> cv = validateDataType(al, value.toString());
+                if (cv != null) {
                     constraintViolations.add(cv);
                 }
             }
         }
 
-        constraintViolations.addAll(
-            beanValidator.validateValue(
-                bean.getProxyType(), toCamelCase(property.xmlName()), value));
+        constraintViolations
+            .addAll(beanValidator.validateValue(bean.getProxyType(), toCamelCase(property.xmlName()), value));
 
         handleValidationException(constraintViolations);
     }
 
-    private ConstraintViolation validateDataType(final ConfigModel.AttributeLeaf al, final String value)
-    {
-        if (value.startsWith("${") && value.endsWith("}"))
-          return null;
 
-        boolean isValid = String.class.getName().equals(al.dataType);
-        if ("int".equals(al.dataType) ||
-            "java.lang.Integer".equals(al.dataType))
+    private ConstraintViolation<ConfigBeanProxy> validateDataType(final AttributeLeaf leaf, final String value) {
+        if (value.startsWith("${") && value.endsWith("}")) {
+            return null;
+        }
+        boolean isValid = String.class.getName().equals(leaf.dataType);
+        if ("int".equals(leaf.dataType) || "java.lang.Integer".equals(leaf.dataType)) {
             isValid = representsInteger(value);
-        else if ("long".equals(al.dataType) ||
-                "java.lang.Long".equals(al.dataType))
+        } else if ("long".equals(leaf.dataType) || "java.lang.Long".equals(leaf.dataType)) {
             isValid = representsLong(value);
-        else if ("boolean".equals(al.dataType) ||
-                 "java.lang.Boolean".endsWith(al.dataType))
+        } else if ("boolean".equals(leaf.dataType) || "java.lang.Boolean".endsWith(leaf.dataType)) {
             isValid = representsBoolean(value);
-        else if ("char".equals(al.dataType) ||
-                 "java.lang.Character".equals(al.dataType))
+        } else if ("char".equals(leaf.dataType) || "java.lang.Character".equals(leaf.dataType)) {
             isValid = representsChar(value);
+        }
         if (!isValid) {
-            return new ConstraintViolation() {
-                @Override
-                public String getMessage() {
-                    return i18n.getString("bean.validation.dataType.failure") + al.dataType;
-                }
-
-                @Override
-                public String getMessageTemplate() {
-                    return null;
-                }
-
-                @Override
-                public Object getRootBean() {
-                    return WriteableView.this;
-                }
-
-                @Override
-                public Class getRootBeanClass() {
-                    return WriteableView.this.getProxyType();
-                }
-
-                @Override
-                public Object getLeafBean() {
-                    return null;
-                }
-
-                @Override
-                public Object[] getExecutableParameters() {
-                    return null;
-                }
-
-                @Override
-                public Object getExecutableReturnValue() {
-                    return null;
-                }
-
-                @Override
-                public Path getPropertyPath() {
-                    final Set<Path.Node> nodes = new HashSet<Path.Node>();
-                    nodes.add(new Path.Node() {
-                        @Override
-                        public String getName() {
-                            return al.xmlName;
-                        }
-
-                        @Override
-                        public boolean isInIterable() {
-                            return false;
-                        }
-
-                        @Override
-                        public Integer getIndex() {
-                            return null;
-                        }
-
-                        @Override
-                        public Object getKey() {
-                            return null;
-                        }
-
-                        @Override
-                        public ElementKind getKind() {
-                            return null;
-                        }
-
-                        @Override
-                        public <T extends Path.Node> T as(Class<T> tClass) {
-                            return null;
-                        }
-                    });
-                    return new jakarta.validation.Path() {
-                        @Override
-                        public Iterator<Node> iterator() {
-                            return nodes.iterator();
-                        }
-
-                        @Override
-                        public String toString() {
-                           return nodes.iterator().next().getName();
-                        }
-                    };
-                }
-
-                @Override
-                public Object getInvalidValue() {
-                    return value;
-                }
-
-                @Override
-                public ConstraintDescriptor<?> getConstraintDescriptor() {
-                    return null;
-                }
-
-                @Override
-                public Object unwrap(Class type) {
-                    return null;
-                }
-
-
-            };
-        };
+            return new WriteableViewConstraintViolation(leaf, value);
+        }
         return null;
     }
 
     private boolean representsBoolean(String value) {
-        boolean isBoolean =
-           "true".equalsIgnoreCase(value) || "false".equalsIgnoreCase(value);
-        return (isBoolean);
+        return "true".equalsIgnoreCase(value) || "false".equalsIgnoreCase(value);
     }
 
     private boolean representsChar(String value) {
-            if (value.length() == 1)
-                return true;
-            return false;
+        if (value.length() == 1) {
+            return true;
+        }
+        return false;
     }
 
     private boolean representsInteger(String value) {
         try {
             Integer.parseInt(value);
             return true;
-        } catch(NumberFormatException ne) {
+        } catch (NumberFormatException ne) {
             return false;
         }
     }
@@ -922,12 +945,12 @@
         try {
             Long.parseLong(value);
             return true;
-        } catch(NumberFormatException ne) {
+        } catch (NumberFormatException ne) {
             return false;
         }
     }
 
-    private final static ParameterizedType parameterizedType = new ParameterizedType() {
+    private static final ParameterizedType parameterizedType = new ParameterizedType() {
 
         @Override
         public Type[] getActualTypeArguments() {
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 2830c98..15491a7 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
@@ -18,13 +18,14 @@
 package org.glassfish.osgi.cli.interactive;
 
 import com.sun.enterprise.admin.cli.ArgumentTokenizer;
+import com.sun.enterprise.admin.cli.ArgumentTokenizer.ArgumentException;
 import com.sun.enterprise.admin.cli.CLICommand;
 import com.sun.enterprise.admin.cli.CLIUtil;
 import com.sun.enterprise.admin.cli.Environment;
 import com.sun.enterprise.admin.cli.MultimodeCommand;
 import com.sun.enterprise.admin.cli.ProgramOptions;
 import com.sun.enterprise.admin.cli.remote.RemoteCLICommand;
-import com.sun.enterprise.admin.util.CommandModelData;
+import com.sun.enterprise.admin.util.CommandModelData.ParamModelData;
 import com.sun.enterprise.universal.i18n.LocalStringsImpl;
 
 import jakarta.inject.Inject;
@@ -33,26 +34,28 @@
 import java.io.FileDescriptor;
 import java.io.FileInputStream;
 import java.io.IOException;
-import java.io.OutputStream;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Set;
+import java.util.logging.Level;
 
 import org.glassfish.api.I18n;
 import org.glassfish.api.Param;
 import org.glassfish.api.admin.CommandException;
 import org.glassfish.api.admin.CommandModel.ParamModel;
 import org.glassfish.api.admin.CommandValidationException;
-import org.glassfish.api.admin.InvalidCommandException;
+import org.glassfish.common.util.io.EmptyOutputStream;
 import org.glassfish.hk2.api.ActiveDescriptor;
 import org.glassfish.hk2.api.DynamicConfiguration;
 import org.glassfish.hk2.api.DynamicConfigurationService;
+import org.glassfish.hk2.api.MultiException;
 import org.glassfish.hk2.api.PerLookup;
 import org.glassfish.hk2.api.ServiceLocator;
-import org.glassfish.hk2.utilities.BuilderHelper;
 import org.jline.reader.Completer;
+import org.jline.reader.EndOfFileException;
 import org.jline.reader.LineReader;
 import org.jline.reader.LineReaderBuilder;
 import org.jline.reader.impl.completer.NullCompleter;
@@ -61,6 +64,9 @@
 import org.jline.terminal.TerminalBuilder;
 import org.jvnet.hk2.annotations.Service;
 
+import static org.glassfish.hk2.utilities.BuilderHelper.createConstantDescriptor;
+import static org.glassfish.hk2.utilities.BuilderHelper.createContractFilter;
+
 /**
  * A simple local asadmin sub-command to establish an interactive osgi shell.
  *
@@ -76,12 +82,12 @@
 @PerLookup
 public class LocalOSGiShellCommand extends CLICommand {
 
-    protected static final String REMOTE_COMMAND = "osgi";
-    protected static final String SESSIONID_OPTION = "--session-id";
-    protected static final String SESSION_OPTION = "--session";
-    protected static final String SESSION_OPTION_EXECUTE = "execute";
-    protected static final String SESSION_OPTION_START = "new";
-    protected static final String SESSION_OPTION_STOP = "stop";
+    private static final String REMOTE_COMMAND = "osgi";
+    private static final String SESSIONID_OPTION = "--session-id";
+    private static final String SESSION_OPTION = "--session";
+    private static final String SESSION_OPTION_EXECUTE = "execute";
+    private static final String SESSION_OPTION_START = "new";
+    private static final String SESSION_OPTION_STOP = "stop";
     private static final LocalStringsImpl STRINGS = new LocalStringsImpl(MultimodeCommand.class);
 
     @Inject
@@ -104,58 +110,22 @@
     private String shellType;
 
 
-    protected String[] enhanceForTarget(String[] args) {
-        if (instance == null) {
-            return null;
+    @Override
+    public void postConstruct() {
+        super.postConstruct();
+        try {
+            cmd = new RemoteCLICommand(REMOTE_COMMAND, locator.<ProgramOptions> getService(ProgramOptions.class),
+                locator.<Environment> getService(Environment.class));
+        } catch (MultiException | CommandException e) {
+            logger.log(Level.SEVERE, "postConstruct failed!", e);
         }
-        String[] targetArgs = new String[args.length + 2];
-        targetArgs[1] = "--instance";
-        targetArgs[2] = instance;
-        System.arraycopy(args, 0, targetArgs, 0, 1);
-        System.arraycopy(args, 1, targetArgs, 3, args.length - 1);
-        return targetArgs;
     }
 
-    protected String[] prepareArguments(String sessionId, String[] args) {
-        if (sessionId == null) {
-            String[] osgiArgs = new String[args.length + 1];
-            osgiArgs[0] = REMOTE_COMMAND;
-            System.arraycopy(args, 0, osgiArgs, 1, args.length);
-            args = osgiArgs;
-        } else {
-            // attach command to remote session...
-            String[] sessionArgs = new String[args.length + 5];
-            sessionArgs[0] = REMOTE_COMMAND;
-            sessionArgs[1] = SESSION_OPTION;
-            sessionArgs[2] = SESSION_OPTION_EXECUTE;
-            sessionArgs[3] = SESSIONID_OPTION;
-            sessionArgs[4] = sessionId;
-            System.arraycopy(args, 0, sessionArgs, 5, args.length);
-            args = sessionArgs;
-        }
-        return args;
-    }
-
-    protected String startSession() throws CommandException {
-        if (!"gogo".equals(shellType)) {
-            return null;
-        }
-        String[] args = {REMOTE_COMMAND, SESSION_OPTION, SESSION_OPTION_START};
-        return cmd.executeAndReturnOutput(enhanceForTarget(args)).trim();
-    }
-
-    protected int stopSession(String sessionId) throws CommandException {
-        if (sessionId == null) {
-            return 0;
-        }
-        String[] args = {REMOTE_COMMAND, SESSION_OPTION, SESSION_OPTION_STOP, SESSIONID_OPTION, sessionId};
-        return cmd.execute(enhanceForTarget(args));
-    }
 
     /**
      * The validate method validates that the type and quantity of
      * parameters and operands matches the requirements for this
-     * command.  The validate method supplies missing options from
+     * command. The validate method supplies missing options from
      * the environment.
      */
     @Override
@@ -174,9 +144,8 @@
     protected Collection<ParamModel> usageOptions() {
         Collection<ParamModel> opts = commandModel.getParameters();
         Set<ParamModel> uopts = new LinkedHashSet<>();
-        ParamModel p = new CommandModelData.ParamModelData("printprompt",
-                boolean.class, true,
-                Boolean.toString(programOpts.isInteractive()));
+        String interactive = Boolean.toString(programOpts.isInteractive());
+        ParamModel p = new ParamModelData("printprompt", boolean.class, true, interactive);
         for (ParamModel pm : opts) {
             if (pm.getName().equals("printprompt")) {
                 uopts.add(p);
@@ -192,49 +161,48 @@
         if (cmd == null) {
             throw new CommandException("Remote command 'osgi' is not available.");
         }
-        programOpts.setEcho(echo);       // restore echo flag, saved in validate
-            if (encoding != null) {
-                // see Configuration.getEncoding()...
-                System.setProperty("input.encoding", encoding);
-            }
-            final String[] args = enhanceForTarget(new String[] {REMOTE_COMMAND, "asadmin-osgi-shell"});
-            shellType = cmd.executeAndReturnOutput(args).trim();
+        programOpts.setEcho(echo);
+        // restore echo flag, saved in validate
+        if (encoding != null) {
+            // see Configuration.getEncoding()...
+            System.setProperty("input.encoding", encoding);
+        }
+        final String[] args = enhanceForTarget(new String[] {REMOTE_COMMAND, "asadmin-osgi-shell"});
+        logger.log(Level.FINEST, "executeCommand: args {0}", Arrays.toString(args));
+        shellType = cmd.executeAndReturnOutput(args).trim();
         try (Terminal terminal = createTerminal()) {
-            LineReader reader = LineReaderBuilder.builder().completer(getCommandCompleter()).appName(REMOTE_COMMAND).terminal(terminal).build();
+            LineReader reader = LineReaderBuilder.builder().completer(getCommandCompleter()).appName(REMOTE_COMMAND)
+                .terminal(terminal).build();
             return executeCommands(reader);
         } catch (IOException e) {
             throw new CommandException(e);
         }
     }
 
+    private String[] enhanceForTarget(String[] args) {
+        if (instance == null) {
+            return args;
+        }
+        String[] targetArgs = new String[args.length + 2];
+        targetArgs[1] = "--instance";
+        targetArgs[2] = instance;
+        System.arraycopy(args, 0, targetArgs, 0, 1);
+        System.arraycopy(args, 1, targetArgs, 3, args.length - 1);
+        return targetArgs;
+    }
+
 
     private Terminal createTerminal() throws IOException, CommandException {
         if (file == null) {
             System.out.println(STRINGS.get("multimodeIntro"));
-            return TerminalBuilder.builder().streams(new FileInputStream(FileDescriptor.in), System.out).build();
+            FileInputStream inputStream = new FileInputStream(FileDescriptor.in);
+            return TerminalBuilder.builder().streams(inputStream, System.out).build();
         }
         if (!file.canRead()) {
             throw new CommandException("File: " + file + " can not be read");
         }
 
-        OutputStream out = new OutputStream() {
-
-            @Override
-            public void write(int b) throws IOException {
-                return;
-            }
-
-            @Override
-            public void write(byte[] b) throws IOException {
-                return;
-            }
-
-            @Override
-            public void write(byte[] b, int off, int len) throws IOException {
-                return;
-            }
-        };
-        return TerminalBuilder.builder().streams(new FileInputStream(file), out).build();
+        return TerminalBuilder.builder().streams(new FileInputStream(file), new EmptyOutputStream()).build();
     }
 
 
@@ -244,7 +212,7 @@
      * @return The command completer
      */
     private Completer getCommandCompleter() {
-        if("gogo".equals(shellType)) {
+        if ("gogo".equals(shellType)) {
             return new StringsCompleter(
                     "bundlelevel",
                     "cd",
@@ -285,7 +253,7 @@
                     "repos",
                     "source"
                     );
-        } else if("felix".equals(shellType)) {
+        } else if ("felix".equals(shellType)) {
             return new StringsCompleter(
                     "exit",
                     "quit",
@@ -336,49 +304,44 @@
         String sessionId = startSession();
 
         try {
-            for (;;) {
-                if (isPromptPrinted()) {
-                    line = reader.readLine(shellType + "$ ");
-                } else {
-                    line = reader.readLine();
+            while (true) {
+                try {
+                    if (isPromptPrinted()) {
+                        line = reader.readLine(shellType + "$ ");
+                    } else {
+                        line = reader.readLine();
+                    }
+                } catch (EndOfFileException e) {
+                    break;
                 }
 
-                if (line == null) {
+                if (line == null || line.isBlank()) {
                     if (isPromptPrinted()) {
                         System.out.println();
                     }
                     break;
                 }
 
-                if (line.trim().startsWith("#")) // ignore comment lines
-                {
+                if (line.trim().startsWith("#")) {
+                    // ignore comment lines
                     continue;
                 }
 
-                String[] args = null;
+                final String[] args;
                 try {
                     args = getArgs(line);
-                } catch (ArgumentTokenizer.ArgumentException ex) {
-                    logger.info(ex.getMessage());
+                } catch (ArgumentException ex) {
+                    logger.severe(ex.getMessage());
                     continue;
                 }
 
-                if (args.length == 0) {
-                    continue;
-                }
-
-                String command = args[0];
-                if (command.trim().length() == 0) {
-                    continue;
-                }
-
+                final String command = args[0];
                 // handle built-in exit and quit commands
-                // XXX - care about their arguments?
-                if (command.equals("exit") || command.equals("quit")) {
+                if ("exit".equals(command) || "quit".equals(command)) {
                     break;
                 }
 
-                ProgramOptions po = null;
+                final String[] arguments = enhanceForTarget(prepareArguments(sessionId, args));
                 try {
                     /*
                      * Every command gets its own copy of program options
@@ -386,28 +349,21 @@
                      * command line options don't effect other commands.
                      * But all commands share the same environment.
                      */
-                    po = new ProgramOptions(env);
+                    final ProgramOptions programOptions = new ProgramOptions(env);
                     // copy over AsadminMain info
-                    po.setClassPath(programOpts.getClassPath());
-                    po.setClassName(programOpts.getClassName());
+                    programOptions.setClassPath(programOpts.getClassPath());
+                    programOptions.setClassName(programOpts.getClassName());
                     // remove the old one and replace it
-                    atomicReplace(locator, po);
+                    atomicReplace(locator, programOptions);
 
-                    args = prepareArguments(sessionId, args);
-
-                    args = enhanceForTarget(args);
-
-                    String output = cmd.executeAndReturnOutput(args).trim();
-                    if(output != null && output.length() > 0) {
+                    String output = cmd.executeAndReturnOutput(arguments).trim();
+                    if (output != null && !output.isEmpty()) {
                         logger.info(output);
                     }
                 } catch (CommandValidationException cve) {
                     logger.severe(cve.getMessage());
                     logger.severe(cmd.getUsage());
                     rc = ERROR;
-                } catch (InvalidCommandException ice) {
-                    // find closest match with local or remote commands
-                    logger.severe(ice.getMessage());
                 } catch (CommandException ce) {
                     logger.severe(ce.getMessage());
                     rc = ERROR;
@@ -416,8 +372,7 @@
                     // XXX - is this necessary?
                     atomicReplace(locator, programOpts);
                 }
-
-                CLIUtil.writeCommandToDebugLog(name, env, args, rc);
+                CLIUtil.writeCommandToDebugLog(name, env, arguments, rc);
             }
         } finally {
             // what if something breaks on the wire?
@@ -426,24 +381,64 @@
         return rc;
     }
 
+
+    private String[] prepareArguments(String sessionId, String[] args) {
+        if (sessionId == null) {
+            String[] osgiArgs = args == null ? new String[1] : new String[args.length + 1];
+            osgiArgs[0] = REMOTE_COMMAND;
+            if (args != null && args.length > 0) {
+                System.arraycopy(args, 0, osgiArgs, 1, args.length);
+            }
+            return osgiArgs;
+        }
+        // attach command to remote session...
+        String[] sessionArgs = args == null ? new String[5] : new String[args.length + 5];
+        sessionArgs[0] = REMOTE_COMMAND;
+        sessionArgs[1] = SESSION_OPTION;
+        sessionArgs[2] = SESSION_OPTION_EXECUTE;
+        sessionArgs[3] = SESSIONID_OPTION;
+        sessionArgs[4] = sessionId;
+        if (args != null && args.length > 0) {
+            System.arraycopy(args, 0, sessionArgs, 5, args.length);
+        }
+        return sessionArgs;
+    }
+
+
+    private String startSession() throws CommandException {
+        if (!"gogo".equals(shellType)) {
+            return null;
+        }
+        String[] args = {REMOTE_COMMAND, SESSION_OPTION, SESSION_OPTION_START};
+        return cmd.executeAndReturnOutput(enhanceForTarget(args)).trim();
+    }
+
+
+    private int stopSession(String sessionId) throws CommandException {
+        if (sessionId == null) {
+            return 0;
+        }
+        String[] args = {REMOTE_COMMAND, SESSION_OPTION, SESSION_OPTION_STOP, SESSIONID_OPTION, sessionId};
+        return cmd.execute(enhanceForTarget(args));
+    }
+
+
     private boolean isPromptPrinted() {
         return file == null;
     }
 
+
     private static void atomicReplace(ServiceLocator locator, ProgramOptions options) {
         DynamicConfigurationService dcs = locator.getService(DynamicConfigurationService.class);
         DynamicConfiguration config = dcs.createDynamicConfiguration();
-
-        config.addUnbindFilter(BuilderHelper.createContractFilter(ProgramOptions.class.getName()));
-        ActiveDescriptor<ProgramOptions> desc = BuilderHelper.createConstantDescriptor(
-                options, null, ProgramOptions.class);
+        config.addUnbindFilter(createContractFilter(ProgramOptions.class.getName()));
+        ActiveDescriptor<ProgramOptions> desc = createConstantDescriptor(options, null, ProgramOptions.class);
         config.addActiveDescriptor(desc);
-
         config.commit();
     }
 
 
-    private String[] getArgs(String line) throws ArgumentTokenizer.ArgumentException {
+    private static String[] getArgs(String line) throws ArgumentException {
         List<String> args = new ArrayList<>();
         ArgumentTokenizer t = new ArgumentTokenizer(line);
         while (t.hasMoreTokens()) {
@@ -451,16 +446,4 @@
         }
         return args.toArray(new String[args.size()]);
     }
-
-    @Override
-    public void postConstruct() {
-        super.postConstruct();
-        try {
-            cmd = new RemoteCLICommand(REMOTE_COMMAND,
-                locator.<ProgramOptions>getService(ProgramOptions.class),
-                locator.<Environment>getService(Environment.class));
-        } catch (CommandException ex) {
-            // ignore - will be handled by execute()
-        }
-    }
 }
diff --git a/nucleus/osgi-platforms/osgi-cli-remote/pom.xml b/nucleus/osgi-platforms/osgi-cli-remote/pom.xml
index ce53c33..0fc1d81 100644
--- a/nucleus/osgi-platforms/osgi-cli-remote/pom.xml
+++ b/nucleus/osgi-platforms/osgi-cli-remote/pom.xml
@@ -53,15 +53,19 @@
             <artifactId>admin-util</artifactId>
             <version>${project.version}</version>
         </dependency>
+
+        <!-- Alternatives -->
         <dependency>
             <groupId>org.apache.felix</groupId>
             <artifactId>org.apache.felix.shell</artifactId>
             <scope>provided</scope>
+            <optional>true</optional>
         </dependency>
         <dependency>
             <groupId>org.apache.felix</groupId>
             <artifactId>org.apache.felix.gogo.runtime</artifactId>
             <scope>provided</scope>
+            <optional>true</optional>
         </dependency>
     </dependencies>
 </project>
diff --git a/nucleus/osgi-platforms/osgi-cli-remote/src/main/java/org/glassfish/osgi/cli/remote/OSGiShellCommand.java b/nucleus/osgi-platforms/osgi-cli-remote/src/main/java/org/glassfish/osgi/cli/remote/OSGiShellCommand.java
index e331bf1..28d2c21 100644
--- a/nucleus/osgi-platforms/osgi-cli-remote/src/main/java/org/glassfish/osgi/cli/remote/OSGiShellCommand.java
+++ b/nucleus/osgi-platforms/osgi-cli-remote/src/main/java/org/glassfish/osgi/cli/remote/OSGiShellCommand.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -19,21 +20,15 @@
 import com.sun.enterprise.admin.remote.ServerRemoteAdminCommand;
 import com.sun.enterprise.config.serverbeans.Domain;
 import com.sun.enterprise.config.serverbeans.Server;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintStream;
+
+import jakarta.inject.Inject;
+
+import java.util.Arrays;
 import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
 import java.util.logging.Level;
 import java.util.logging.Logger;
-import jakarta.inject.Inject;
-import org.apache.felix.service.command.CommandProcessor;
-import org.apache.felix.service.command.CommandSession;
-import org.apache.felix.service.command.Result;
-import org.apache.felix.shell.ShellService;
+import java.util.stream.Collectors;
+
 import org.glassfish.api.ActionReport;
 import org.glassfish.api.I18n;
 import org.glassfish.api.Param;
@@ -50,11 +45,15 @@
 import org.glassfish.hk2.api.PerLookup;
 import org.glassfish.hk2.api.PostConstruct;
 import org.glassfish.hk2.api.ServiceLocator;
+import org.glassfish.osgi.cli.remote.impl.OsgiShellService;
+import org.glassfish.osgi.cli.remote.impl.SessionOperation;
 import org.jvnet.hk2.annotations.Service;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleReference;
-import org.osgi.framework.ServiceReference;
+
+import static org.glassfish.osgi.cli.remote.impl.OsgiShellService.ASADMIN_OSGI_SHELL;
+import static org.glassfish.osgi.cli.remote.impl.OsgiShellServiceProvider.detectService;
 
 /**
  * A simple AdminCommand that bridges to the Felix Shell Service.
@@ -77,15 +76,12 @@
 @AccessRequired(resource="domain/osgi/shell", action="execute")
 public class OSGiShellCommand implements AdminCommand, PostConstruct {
 
-    private static final Logger log = Logger.getLogger(OSGiShellCommand.class.getPackage().getName());
-
-    private static final Map<String, RemoteCommandSession> sessions =
-            new ConcurrentHashMap<String, RemoteCommandSession>();
+    private static final Logger LOG = Logger.getLogger(OSGiShellCommand.class.getPackage().getName());
 
     @Param(name = "command-line", primary = true, optional = true, multiple = true, defaultValue = "help")
     private Object commandLine;
 
-    @Param(name = "session", optional = true)
+    @Param(name = "session", optional = true, acceptableValues = "new,list,execute,stop")
     private String sessionOp;
 
     @Param(name = "session-id", optional = true)
@@ -102,234 +98,94 @@
     @Inject
     Domain domain;
 
-    @Override
-    public void execute(AdminCommandContext context) {
-        ActionReport report = context.getActionReport();
-
-        if(instance != null) {
-            Server svr = domain.getServerNamed(instance);
-            if(svr == null) {
-                report.setMessage("No server target found for "
-                        + instance);
-                report.setActionExitCode(ActionReport.ExitCode.FAILURE);
-                return;
-            }
-            String host = svr.getAdminHost();
-            int port = svr.getAdminPort();
-
-            try {
-                ServerRemoteAdminCommand remote =
-                        new ServerRemoteAdminCommand(
-                                locator,
-                                "osgi",
-                                host,
-                                port,
-                                false,
-                                "admin",
-                                "",
-                                log);
-
-                ParameterMap params = new ParameterMap();
-
-                if(commandLine == null) {
-                    params.set("DEFAULT".toLowerCase(Locale.US), "asadmin-osgi-shell");
-                } else if(commandLine instanceof String) {
-                    params.set("DEFAULT".toLowerCase(Locale.US), (String) commandLine);
-                } else if(commandLine instanceof List) {
-                    params.set("DEFAULT".toLowerCase(Locale.US), (List<String>) commandLine);
-                }
-
-                if(sessionOp != null) {
-                    params.set("session", sessionOp);
-                }
-
-                if(sessionId != null) {
-                    params.set("session-id", sessionId);
-                }
-
-                report.setMessage(remote.executeCommand(params));
-                report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
-                return;
-            } catch(CommandException x) {
-                report.setMessage("Remote execution failed: "
-                        + x.getMessage());
-                report.setFailureCause(x);
-                report.setActionExitCode(ActionReport.ExitCode.FAILURE);
-                return;
-            }
-        }
-
-        String cmdName = "";
-        String cmd = "";
-        if(commandLine == null) {
-            cmd = "asadmin-osgi-shell";
-            cmdName = cmd;
-        } else if(commandLine instanceof String) {
-            cmd = (String) commandLine;
-            cmdName = cmd;
-        } else if(commandLine instanceof List) {
-            for(Object arg : (List) commandLine) {
-                if(cmd.length() == 0) {
-                    // first arg
-                    cmd = (String) arg;
-                    cmdName = cmd;
-                } else {
-                    cmd += " " + (String) arg;
-                }
-            }
-        } else if(commandLine instanceof String[]) {
-            for(Object arg : (String[]) commandLine) {
-                if(cmd.length() == 0) {
-                    // first arg
-                    cmd = (String) arg;
-                    cmdName = cmd;
-                } else {
-                    cmd += " " + (String) arg;
-                }
-            }
-        } else {
-            // shouldn't happen...
-            report.setMessage("Unable to deal with argument list of type "
-                    + commandLine.getClass().getName());
-            report.setActionExitCode(ActionReport.ExitCode.WARNING);
-            return;
-        }
-
-        // standard output...
-        ByteArrayOutputStream bOut = new ByteArrayOutputStream(512);
-        PrintStream out = new PrintStream(bOut);
-
-        // error output...
-        ByteArrayOutputStream bErr = new ByteArrayOutputStream(512);
-        PrintStream err = new PrintStream(bErr);
-
-        try {
-            Object shell = null;
-
-            ServiceReference sref = ctx.getServiceReference(
-                    "org.apache.felix.service.command.CommandProcessor");
-            if(sref != null) {
-                shell = ctx.getService(sref);
-            }
-
-            if(shell == null) {
-                // try with felix...
-                sref = ctx.getServiceReference("org.apache.felix.shell.ShellService");
-                if(sref != null) {
-                    shell = ctx.getService(sref);
-                }
-
-                if(shell == null) {
-                    report.setMessage("No Shell Service available");
-                    report.setActionExitCode(ActionReport.ExitCode.WARNING);
-                    return;
-                } else if("asadmin-osgi-shell".equals(cmdName)) {
-                    out.println("felix");
-                } else {
-                    ShellService s = (ShellService) shell;
-                    s.executeCommand(cmd, out, err);
-                }
-            } else {
-                // try with gogo...
-
-                // GLASSFISH-19126 - prepare fake input stream...
-                InputStream in = new InputStream() {
-
-                    @Override
-                    public int read() throws IOException {
-                        return -1;
-                    }
-
-                    @Override
-                    public int available() throws IOException {
-                        return 0;
-                    }
-
-                    @Override
-                    public int read(byte[] b) throws IOException {
-                        return -1;
-                    }
-
-                    @Override
-                    public int read(byte[] b, int off, int len) throws IOException {
-                        return -1;
-                    }
-                };
-
-                CommandProcessor cp = (CommandProcessor) shell;
-                if (sessionOp == null) {
-                    if("asadmin-osgi-shell".equals(cmdName)) {
-                        out.println("gogo");
-                    } else {
-                        CommandSession session = cp.createSession(in, out, err);
-                        Object result = session.execute(cmd);
-
-                        if (result instanceof String) {
-                            out.println(result.toString());
-                        }
-
-                        session.close();
-                    }
-                } else if("new".equals(sessionOp)) {
-                    CommandSession session = cp.createSession(in, out, err);
-                    RemoteCommandSession remote = new RemoteCommandSession(session);
-
-                    log.log(Level.FINE, "Remote session established: {0}",
-                            remote.getId());
-
-                    sessions.put(remote.getId(), remote);
-                    out.println(remote.getId());
-                } else if("list".equals(sessionOp)) {
-                    for(String id : sessions.keySet()) {
-                        out.println(id);
-                    }
-                } else if("execute".equals(sessionOp)) {
-                    RemoteCommandSession remote = sessions.get(sessionId);
-                    CommandSession session = remote.attach(in, out, err);
-                    Object result = session.execute(cmd);
-
-                    if (result instanceof String) {
-                        out.println(result.toString());
-                    }
-
-                    remote.detach();
-                } else if("stop".equals(sessionOp)) {
-                    RemoteCommandSession remote = sessions.remove(sessionId);
-                    CommandSession session = remote.attach(in, out, err);
-                    session.close();
-
-                    log.log(Level.FINE, "Remote session closed: {0}",
-                            remote.getId());
-                }
-            }
-
-            out.flush();
-            err.flush();
-
-            String output = bOut.toString("UTF-8");
-            String errors = bErr.toString("UTF-8");
-            report.setMessage(output);
-
-            if(errors.length() > 0) {
-                report.setMessage(errors);
-                report.setActionExitCode(ActionReport.ExitCode.WARNING);
-            } else {
-                report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
-            }
-        } catch (Exception ex) {
-            report.setMessage(ex.getMessage());
-            report.setActionExitCode(ActionReport.ExitCode.WARNING);
-        } finally {
-            out.close();
-            err.close();
-        }
-    }
 
     @Override
     public void postConstruct() {
-        if(ctx == null) {
-            Bundle me = BundleReference.class.cast(getClass().getClassLoader()).getBundle();
+        if (ctx == null) {
+            final Bundle me = BundleReference.class.cast(getClass().getClassLoader()).getBundle();
             ctx = me.getBundleContext();
         }
     }
+
+
+    @Override
+    public void execute(final AdminCommandContext context) {
+        final ActionReport report = context.getActionReport();
+
+        if (instance != null) {
+            final Server server = domain.getServerNamed(instance);
+            if (server == null) {
+                report.setMessage("No server target found for " + instance);
+                report.setActionExitCode(ActionReport.ExitCode.FAILURE);
+                return;
+            }
+            final String host = server.getAdminHost();
+            final int port = server.getAdminPort();
+            try {
+                final ServerRemoteAdminCommand remote
+                    = new ServerRemoteAdminCommand(locator, "osgi", host, port, false, "admin", "", LOG);
+
+                final ParameterMap params = new ParameterMap();
+                if (commandLine == null) {
+                    params.set("default", ASADMIN_OSGI_SHELL);
+                } else if (commandLine instanceof String) {
+                    params.set("default", (String) commandLine);
+                } else if (commandLine instanceof List) {
+                    params.set("default", (List<String>) commandLine);
+                }
+                if (sessionOp != null) {
+                    params.set("session", sessionOp);
+                }
+                if (sessionId != null) {
+                    params.set("session-id", sessionId);
+                }
+                report.setMessage(remote.executeCommand(params));
+                report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
+                return;
+            } catch(final CommandException e) {
+                report.setMessage("Remote execution failed: " + e.getMessage());
+                report.setFailureCause(e);
+                report.setActionExitCode(ActionReport.ExitCode.FAILURE);
+                return;
+            }
+        }
+
+        // must not be null, called services forbid it.
+        final String cmdName;
+        final String cmd;
+        if (commandLine == null) {
+            cmdName = ASADMIN_OSGI_SHELL;
+            cmd = ASADMIN_OSGI_SHELL;
+        } else if (commandLine instanceof String) {
+            cmdName = (String) commandLine;
+            cmd = cmdName;
+        } else if (commandLine instanceof List) {
+            @SuppressWarnings("unchecked")
+            final List<String> list = (List<String>) commandLine;
+            cmdName = list.isEmpty() ? "" : list.get(0);
+            cmd = list.isEmpty() ? "" : list.stream().collect(Collectors.joining(" "));
+        } else if (commandLine instanceof String[]) {
+            final String[] list = (String[]) commandLine;
+            cmdName = list.length == 0 ? "" : list[0];
+            cmd = list.length == 0 ? "" : Arrays.stream(list).collect(Collectors.joining(" "));
+        } else {
+            report.setMessage("Unable to deal with argument list of type " + commandLine.getClass().getName());
+            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
+            return;
+        }
+        try {
+            final SessionOperation sessionOperation = SessionOperation.parse(sessionOp);
+            final OsgiShellService service = detectService(ctx, sessionOperation, sessionId, report);
+            if (service == null) {
+                report.setMessage("No Shell Service available");
+                report.setActionExitCode(ActionReport.ExitCode.FAILURE);
+                return;
+            }
+            service.exec(cmdName, cmd);
+        } catch (final Exception ex) {
+            LOG.log(Level.SEVERE, ex.getMessage());
+            report.setMessage(ex.getMessage());
+            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
+        }
+    }
 }
diff --git a/nucleus/osgi-platforms/osgi-cli-remote/src/main/java/org/glassfish/osgi/cli/remote/impl/FelixOsgiShellService.java b/nucleus/osgi-platforms/osgi-cli-remote/src/main/java/org/glassfish/osgi/cli/remote/impl/FelixOsgiShellService.java
new file mode 100644
index 0000000..a2fba91
--- /dev/null
+++ b/nucleus/osgi-platforms/osgi-cli-remote/src/main/java/org/glassfish/osgi/cli/remote/impl/FelixOsgiShellService.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2022 Eclipse Foundation and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.osgi.cli.remote.impl;
+
+import org.apache.felix.shell.ShellService;
+import org.glassfish.api.ActionReport;
+
+/**
+ * Service using {@link ShellService} and NOT supporting sessions.
+ *
+ * @author David Matejcek
+ */
+class FelixOsgiShellService extends OsgiShellService {
+
+    private final ShellService service;
+
+    FelixOsgiShellService(Object service, ActionReport report) {
+        super(report);
+        this.service = (ShellService) service;
+    }
+
+
+    @Override
+    protected void execCommand(String cmdName, String cmd) throws Exception {
+        if (ASADMIN_OSGI_SHELL.equals(cmdName)) {
+            stdout.println("felix");
+        } else {
+            service.executeCommand(cmd, stdout, stderr);
+        }
+    }
+}
diff --git a/nucleus/osgi-platforms/osgi-cli-remote/src/main/java/org/glassfish/osgi/cli/remote/impl/GogoOsgiShellService.java b/nucleus/osgi-platforms/osgi-cli-remote/src/main/java/org/glassfish/osgi/cli/remote/impl/GogoOsgiShellService.java
new file mode 100644
index 0000000..8183d41
--- /dev/null
+++ b/nucleus/osgi-platforms/osgi-cli-remote/src/main/java/org/glassfish/osgi/cli/remote/impl/GogoOsgiShellService.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2022 Eclipse Foundation and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.osgi.cli.remote.impl;
+
+import java.io.InputStream;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.felix.service.command.CommandProcessor;
+import org.apache.felix.service.command.CommandSession;
+import org.glassfish.api.ActionReport;
+import org.glassfish.common.util.io.EmptyInputStream;
+
+import static org.glassfish.osgi.cli.remote.impl.SessionOperation.EXECUTE;
+import static org.glassfish.osgi.cli.remote.impl.SessionOperation.LIST;
+import static org.glassfish.osgi.cli.remote.impl.SessionOperation.NEW;
+import static org.glassfish.osgi.cli.remote.impl.SessionOperation.STOP;
+
+/**
+ * Service using {@link CommandProcessor} and supporting sessions.
+ *
+ * @author David Matejcek
+ */
+class GogoOsgiShellService extends OsgiShellService {
+    private static final Logger LOG = Logger.getLogger(GogoOsgiShellService.class.getName());
+
+    private static final Map<String, RemoteCommandSession> SESSIONS = new ConcurrentHashMap<>();
+    private final CommandProcessor processor;
+    private final SessionOperation sessionOperation;
+    private final String sessionId;
+
+    GogoOsgiShellService(Object service, SessionOperation sessionOperation, String sessionId, ActionReport report) {
+        super(report);
+        this.processor = (CommandProcessor) service;
+        this.sessionOperation = sessionOperation;
+        this.sessionId = sessionId;
+    }
+
+    @Override
+    protected void execCommand(String cmdName, String cmd) throws Exception {
+        final InputStream in = new EmptyInputStream();
+        if (sessionOperation == null) {
+            if (ASADMIN_OSGI_SHELL.equals(cmdName)) {
+                stdout.println("gogo");
+            } else {
+                try (CommandSession session = processor.createSession(in, stdout, stderr)) {
+                    final Object result = session.execute(cmd);
+                    if (result instanceof String) {
+                        stdout.println(result.toString());
+                    }
+                }
+            }
+        } else if (sessionOperation == NEW) {
+            final CommandSession session = processor.createSession(in, stdout, stderr);
+            final RemoteCommandSession remote = new RemoteCommandSession(session);
+            LOG.log(Level.FINE, "Remote session established: {0}", remote.getId());
+            SESSIONS.put(remote.getId(), remote);
+            stdout.println(remote.getId());
+        } else if (sessionOperation == LIST) {
+            for (final String id : SESSIONS.keySet()) {
+                stdout.println(id);
+            }
+        } else if (sessionOperation == EXECUTE) {
+            final RemoteCommandSession remote = SESSIONS.get(sessionId);
+            final CommandSession session = remote.attach(in, stdout, stderr);
+            final Object result = session.execute(cmd);
+            if (result instanceof String) {
+                stdout.println(result.toString());
+            }
+            remote.detach();
+        } else if (sessionOperation == STOP) {
+            final RemoteCommandSession remote = SESSIONS.remove(sessionId);
+            if (remote != null) {
+                final CommandSession session = remote.attach(in, stdout, stderr);
+                session.close();
+            }
+            LOG.log(Level.FINE, "Remote session closed: {0}", sessionId);
+        }
+    }
+}
diff --git a/nucleus/osgi-platforms/osgi-cli-remote/src/main/java/org/glassfish/osgi/cli/remote/impl/OsgiShellService.java b/nucleus/osgi-platforms/osgi-cli-remote/src/main/java/org/glassfish/osgi/cli/remote/impl/OsgiShellService.java
new file mode 100644
index 0000000..76238f1
--- /dev/null
+++ b/nucleus/osgi-platforms/osgi-cli-remote/src/main/java/org/glassfish/osgi/cli/remote/impl/OsgiShellService.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2022 Eclipse Foundation and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.osgi.cli.remote.impl;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.glassfish.api.ActionReport;
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+
+/**
+ * Common parent of OSGi Shell service wrappers.
+ *
+ * @author David Matejcek
+ */
+public abstract class OsgiShellService {
+    /** Used by LocalOSGiShellCommand */
+    public static final String ASADMIN_OSGI_SHELL = "asadmin-osgi-shell";
+    private static final Logger LOG = Logger.getLogger(OsgiShellService.class.getName());
+
+    private final ActionReport report;
+    private final ByteArrayOutputStream stdoutBytes;
+    private final ByteArrayOutputStream stderrBytes;
+    /** Can be used to send response to user */
+    protected final PrintStream stdout;
+    /** Error output for user */
+    protected final PrintStream stderr;
+
+
+    /**
+     * Initializes streams collecting output,
+     *
+     * @param report
+     */
+    protected OsgiShellService(final ActionReport report) {
+        this.report = report;
+        this.stdoutBytes = new ByteArrayOutputStream(1024);
+        this.stdout = new PrintStream(stdoutBytes);
+        this.stderrBytes = new ByteArrayOutputStream(1024);
+        this.stderr = new PrintStream(stderrBytes);
+    }
+
+
+    /**
+     * Executes the command.
+     *
+     * @param cmdName - command name. Can be {@value #ASADMIN_OSGI_SHELL} or the first command of cmd.
+     * @param cmd - command and arguments.
+     * @return updated {@link ActionReport} given in constructor
+     * @throws Exception
+     */
+    public ActionReport exec(final String cmdName, final String cmd) throws Exception {
+        LOG.log(Level.FINE, "exec: {0}", cmd);
+        execCommand(cmdName, cmd);
+        stdout.flush();
+        stderr.flush();
+        return generateReport();
+    }
+
+
+    /**
+     * Calls the real implementation of the OSGI shell.
+     *
+     * @param cmdName - command name. Can be {@value #ASADMIN_OSGI_SHELL} or the first command of cmd.
+     * @param cmd - command and arguments.
+     * @throws Exception
+     */
+    protected abstract void execCommand(String cmdName, String cmd) throws Exception;
+
+
+    private ActionReport generateReport() {
+        final String output = stdoutBytes.toString(UTF_8);
+        report.setMessage(output);
+
+        final String errors = stderrBytes.toString(UTF_8);
+        if (errors.isEmpty()) {
+            report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
+        } else {
+            report.setMessage(errors);
+            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
+        }
+        return report;
+    }
+}
diff --git a/nucleus/osgi-platforms/osgi-cli-remote/src/main/java/org/glassfish/osgi/cli/remote/impl/OsgiShellServiceProvider.java b/nucleus/osgi-platforms/osgi-cli-remote/src/main/java/org/glassfish/osgi/cli/remote/impl/OsgiShellServiceProvider.java
new file mode 100644
index 0000000..65e3db0
--- /dev/null
+++ b/nucleus/osgi-platforms/osgi-cli-remote/src/main/java/org/glassfish/osgi/cli/remote/impl/OsgiShellServiceProvider.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2022 Eclipse Foundation and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.osgi.cli.remote.impl;
+
+import org.glassfish.api.ActionReport;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+/**
+ * Detects OSGI shell impl available on the classpath and provides one of them.
+ *
+ * @author David Matejcek
+ */
+public class OsgiShellServiceProvider {
+
+
+    /**
+     * Effectively masks classes as used dependencies are optional and might not be on the classpath
+     *
+     * @param ctx - used to detect and get the service impl
+     * @param sessionId - used to attach to an existing session with this id.
+     * @param sessionOperation - used to start/attach/stop
+     * @param report
+     * @return {@link OsgiShellService} or null if there is no shell impl available.
+     */
+    public static OsgiShellService detectService(final BundleContext ctx, final SessionOperation sessionOperation,
+        final String sessionId, final ActionReport report) {
+        // warning: don't replace strings by classes, classes might not be on the classpath.
+        final ServiceReference<?> processor = ctx
+            .getServiceReference("org.apache.felix.service.command.CommandProcessor");
+        if (processor != null) {
+            return new GogoOsgiShellService(ctx.getService(processor), sessionOperation, sessionId, report);
+        }
+        final ServiceReference<?> shell = ctx.getServiceReference("org.apache.felix.shell.ShellService");
+        if (shell != null) {
+            return new FelixOsgiShellService(ctx.getService(shell), report);
+        }
+        return null;
+    }
+}
diff --git a/nucleus/osgi-platforms/osgi-cli-remote/src/main/java/org/glassfish/osgi/cli/remote/RemoteCommandSession.java b/nucleus/osgi-platforms/osgi-cli-remote/src/main/java/org/glassfish/osgi/cli/remote/impl/RemoteCommandSession.java
similarity index 80%
rename from nucleus/osgi-platforms/osgi-cli-remote/src/main/java/org/glassfish/osgi/cli/remote/RemoteCommandSession.java
rename to nucleus/osgi-platforms/osgi-cli-remote/src/main/java/org/glassfish/osgi/cli/remote/impl/RemoteCommandSession.java
index a08a4ff..1d685ae 100644
--- a/nucleus/osgi-platforms/osgi-cli-remote/src/main/java/org/glassfish/osgi/cli/remote/RemoteCommandSession.java
+++ b/nucleus/osgi-platforms/osgi-cli-remote/src/main/java/org/glassfish/osgi/cli/remote/impl/RemoteCommandSession.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
  * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -14,7 +15,7 @@
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
  */
 
-package org.glassfish.osgi.cli.remote;
+package org.glassfish.osgi.cli.remote.impl;
 
 import java.io.InputStream;
 import java.io.PrintStream;
@@ -26,6 +27,7 @@
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.UUID;
+
 import org.apache.felix.service.command.CommandSession;
 
 /**
@@ -39,49 +41,47 @@
  *
  * @author ancoron
  */
-public class RemoteCommandSession {
+class RemoteCommandSession {
 
     private final CommandSession delegate;
     private final String id;
 
-    public RemoteCommandSession(CommandSession delegate)
-    {
+    public RemoteCommandSession(final CommandSession delegate) {
         this.delegate = delegate;
         this.id = UUID.randomUUID().toString();
     }
 
+
     /**
-     * Get the identifier for this session, which is a UUID of type 4.
-     *
-     * @return
+     * @return the identifier for this session, which is a UUID of type 4.
      */
     public String getId() {
         return id;
     }
 
+
     /**
-     * Attached the specified streams to the delegate of this instance and
+     * Attaches the specified streams to the delegate of this instance and
      * returns the modified delegate.
      *
      * @param in The "stdin" stream for the session
      * @param out The "stdout" stream for the session
      * @param err The "stderr" stream for the session
-     *
      * @return The modified {@link CommandSession} delegate
-     *
      * @see #detach()
      */
-    public CommandSession attach(InputStream in, PrintStream out, PrintStream err) {
+    public CommandSession attach(final InputStream in, final PrintStream out, final PrintStream err) {
         set(this.delegate, "in", in);
         set(this.delegate, "out", out);
         set(this.delegate, "err", err);
-        ReadableByteChannel inCh = Channels.newChannel(in);
-        WritableByteChannel outCh = Channels.newChannel(out);
-        WritableByteChannel errCh = out == err ? outCh : Channels.newChannel(err);
+        final ReadableByteChannel inCh = Channels.newChannel(in);
+        final WritableByteChannel outCh = Channels.newChannel(out);
+        final WritableByteChannel errCh = out == err ? outCh : Channels.newChannel(err);
         set(this.delegate, "channels", new Channel[] {inCh, outCh, errCh});
         return this.delegate;
     }
 
+
     /**
      * Detaches all previously attached streams and hence, ensures that there
      * are no stale references left.
@@ -94,11 +94,14 @@
         set(this.delegate, "err", null);
     }
 
+
     private void set(final Object obj, final String field, final Object value) {
         try {
             final Field f = obj.getClass().getDeclaredField(field);
-            final boolean accessible = f.isAccessible();
-            if(!accessible) {
+            final boolean accessible = f.canAccess(obj);
+            if (accessible) {
+                f.set(obj, value);
+            } else {
                 AccessController.doPrivileged(new PrivilegedAction<Void>() {
 
                     @Override
@@ -106,7 +109,7 @@
                         f.setAccessible(true);
                         try {
                             f.set(obj, value);
-                        } catch(Exception x) {
+                        } catch (final Exception x) {
                             throw new RuntimeException(x);
                         }
 
@@ -115,10 +118,8 @@
                         return null;
                     }
                 });
-            } else {
-                f.set(obj, value);
             }
-        } catch(Exception x) {
+        } catch (final Exception x) {
             throw new RuntimeException(x);
         }
     }
diff --git a/nucleus/osgi-platforms/osgi-cli-remote/src/main/java/org/glassfish/osgi/cli/remote/impl/SessionOperation.java b/nucleus/osgi-platforms/osgi-cli-remote/src/main/java/org/glassfish/osgi/cli/remote/impl/SessionOperation.java
new file mode 100644
index 0000000..b07868e
--- /dev/null
+++ b/nucleus/osgi-platforms/osgi-cli-remote/src/main/java/org/glassfish/osgi/cli/remote/impl/SessionOperation.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2022 Eclipse Foundation and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.glassfish.osgi.cli.remote.impl;
+
+
+/**
+ * Commands for session manipulation.
+ *
+ * @author David Matejcek
+ */
+public enum SessionOperation {
+
+    /** Create session */
+    NEW,
+    /** List sessions */
+    LIST,
+    /** Execute command in session */
+    EXECUTE,
+    /** Stop session */
+    STOP;
+
+    /**
+     * @param operation see {@link SessionOperation} values. Case insensitive.
+     * @return {@link SessionOperation} or null if operation was null.
+     * @throws IllegalArgumentException if the operation is an unknown string.
+     *
+     */
+    public static SessionOperation parse(String operation) throws IllegalArgumentException {
+        if (operation == null) {
+            return null;
+        }
+        for (SessionOperation value : values()) {
+            if (value.name().equalsIgnoreCase(operation)) {
+                return value;
+            }
+        }
+        throw new IllegalArgumentException("Unsupported session operation: " + operation);
+    }
+
+}
diff --git a/nucleus/parent/pom.xml b/nucleus/parent/pom.xml
index ac84d55..5ab209a 100644
--- a/nucleus/parent/pom.xml
+++ b/nucleus/parent/pom.xml
@@ -411,6 +411,12 @@
                 <artifactId>gmbal</artifactId>
                 <version>${gmbal.version}</version>
             </dependency>
+            <dependency>
+                <groupId>org.jboss.shrinkwrap.resolver</groupId>
+                <artifactId>shrinkwrap-resolver-impl-maven-archive</artifactId>
+                <version>3.1.4</version>
+                <scope>test</scope>
+            </dependency>
 
             <!-- GlassFish Shoal -->
             <dependency>
@@ -524,8 +530,7 @@
                 <version>7.0.3</version>
                 <scope>provided</scope>
             </dependency>
-
-            <!-- This is currently used by osgi-shell cmd, but can be used for others as well -->
+            <!-- This is currently used by osgi-shell cmd -->
             <dependency>
                 <groupId>org.jline</groupId>
                 <artifactId>jline</artifactId>
@@ -764,10 +769,32 @@
                             <testExclude>**/.ade_path/**</testExclude>
                         </testExcludes>
                     </configuration>
+                    <executions>
+                        <execution>
+                            <id>default-compile</id>
+                            <phase>compile</phase>
+                            <goals>
+                                <goal>compile</goal>
+                            </goals>
+                            <configuration>
+                                <proc>none</proc>
+                            </configuration>
+                        </execution>
+                        <execution>
+                            <id>process-annotations</id>
+                            <phase>process-classes</phase>
+                            <goals>
+                                <goal>compile</goal>
+                            </goals>
+                            <configuration>
+                                <proc>only</proc>
+                            </configuration>
+                        </execution>
+                    </executions>
                 </plugin>
                 <plugin>
                     <artifactId>maven-dependency-plugin</artifactId>
-                    <version>3.2.0</version>
+                    <version>3.3.0</version>
                 </plugin>
                 <plugin>
                     <groupId>org.glassfish.build</groupId>
@@ -776,7 +803,7 @@
                 </plugin>
                 <plugin>
                     <artifactId>maven-javadoc-plugin</artifactId>
-                    <version>3.3.1</version>
+                    <version>3.3.2</version>
                 </plugin>
                 <plugin>
                     <artifactId>maven-source-plugin</artifactId>
@@ -784,11 +811,11 @@
                 </plugin>
                 <plugin>
                     <artifactId>maven-clean-plugin</artifactId>
-                    <version>3.1.0</version>
+                    <version>3.2.0</version>
                 </plugin>
                 <plugin>
                     <artifactId>maven-surefire-plugin</artifactId>
-                    <version>3.0.0-M5</version>
+                    <version>3.0.0-M6</version>
                     <configuration>
                         <argLine>${surefire.argLine}</argLine>
                         <trimStackTrace>false</trimStackTrace>
@@ -803,7 +830,7 @@
                 </plugin>
                 <plugin>
                     <artifactId>maven-failsafe-plugin</artifactId>
-                    <version>3.0.0-M5</version>
+                    <version>3.0.0-M6</version>
                     <configuration>
                         <argLine>${failsafe.argLine}</argLine>
                         <trimStackTrace>false</trimStackTrace>
@@ -873,6 +900,10 @@
                     </executions>
                 </plugin>
                 <plugin>
+                    <artifactId>maven-gpg-plugin</artifactId>
+                    <version>3.0.1</version>
+                </plugin>
+                <plugin>
                     <groupId>com.googlecode.maven-download-plugin</groupId>
                     <artifactId>download-maven-plugin</artifactId>
                     <version>1.6.8</version>
@@ -887,7 +918,7 @@
                 </plugin>
                 <plugin>
                     <artifactId>maven-site-plugin</artifactId>
-                    <version>3.10.0</version>
+                    <version>3.11.0</version>
                 </plugin>
                 <plugin>
                     <artifactId>maven-assembly-plugin</artifactId>
@@ -990,10 +1021,8 @@
             </plugins>
         </pluginManagement>
         <plugins>
-            <!-- Sets minimal Maven version to 3.5.4 -->
             <plugin>
                 <artifactId>maven-enforcer-plugin</artifactId>
-                <version>3.0.0</version>
                 <executions>
                     <execution>
                         <id>enforce-maven</id>
@@ -1003,7 +1032,7 @@
                         <configuration>
                             <rules>
                                 <requireMavenVersion>
-                                    <version>3.5.4</version>
+                                    <version>3.6.0</version>
                                 </requireMavenVersion>
                             </rules>
                         </configuration>
@@ -1435,7 +1464,7 @@
             <id>jacoco</id>
             <properties>
                 <jacoco.report.outputDirectory>${project.build.directory}/jacoco</jacoco.report.outputDirectory>
-                <jacoco.version>0.8.7</jacoco.version>
+                <jacoco.version>0.8.8</jacoco.version>
                 <maven.test.failure.ignore>true</maven.test.failure.ignore>
                 <surefire.argLine>${maven.test.jvmoptions} @{argLine}</surefire.argLine>
             </properties>
diff --git a/nucleus/pom.xml b/nucleus/pom.xml
index a724c84..2955637 100644
--- a/nucleus/pom.xml
+++ b/nucleus/pom.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 
-	Copyright (c) 2021 Contributors to the Eclipse Foundation
+    Copyright (c) 2021-2022 Contributors to the Eclipse Foundation
     Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved.
 
     This program and the accompanying materials are made available under the
@@ -95,19 +95,9 @@
                     <version>2.4</version>
                 </plugin>
                 <plugin>
-                    <groupId>org.jvnet.jaxb2.maven2</groupId>
-                    <artifactId>maven-jaxb2-plugin</artifactId>
-                    <version>0.8.1</version>
-                </plugin>
-                <plugin>
                     <artifactId>maven-war-plugin</artifactId>
                     <version>3.3.2</version>
                 </plugin>
-                <plugin>
-                    <groupId>org.codehaus.mojo</groupId>
-                    <artifactId>jaxws-maven-plugin</artifactId>
-                    <version>1.12</version>
-                </plugin>
             </plugins>
         </pluginManagement>
         <plugins>
diff --git a/nucleus/tests/admin/pom.xml b/nucleus/tests/admin/pom.xml
deleted file mode 100644
index 46d5848..0000000
--- a/nucleus/tests/admin/pom.xml
+++ /dev/null
@@ -1,151 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
-
-    This program and the accompanying materials are made available under the
-    terms of the Eclipse Public License v. 2.0, which is available at
-    http://www.eclipse.org/legal/epl-2.0.
-
-    This Source Code may also be made available under the following Secondary
-    Licenses when the conditions for such availability set forth in the
-    Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
-    version 2 with the GNU Classpath Exception, which is available at
-    https://www.gnu.org/software/classpath/license.html.
-
-    SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-
--->
-
-<!--
-INSTRUCTIONS for running nucleus admin dev tests.
-
-To run all of the tests using the staged nucleus build in distributions/nucleus:
-    mvn test
-
-To run just one test:
-    mvn -Dtest=MiscCommandsTest,NucleusStartStopTest test
-
-Some tests require testing libraries/modules in running distribution. Please do
-NOT start test against running instance.
-
-To run tests based on your own install:
-    mvn -Dnucleus.home=...somedirectory/nucleus test
-
-To see the output of a test run, look in the target/surefire-reports directory.
-The TEST-TestSuite.xml file is especially useful.
-
-INSTRUCTIONS for adding tests.
-
-Copy one of the existing test files, such as MiscCommandsTest.java.  Then add
-tests.  The file will automatically be picked up as part of the suite. There is
-no need to modify this pom.xml file or any other configuration file. Useful
-utilities are in the NucleusTestUtils class.
-
-Test suit contains place for additional modules/libraries with testing content
-that are copied into the Nucleus before start and removed after stop:
-- src/addon/module/* -> <Nucleus>/modules
-(If you need to add your testing module to different directory in nucleus than
-modify org.glassfish.nucleus.admin.NucleusStartStopTest static initializer
-of COPY_LIB map constant.)
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.glassfish.main.tests</groupId>
-        <artifactId>nucleus-tests</artifactId>
-        <version>7.0.0-SNAPSHOT</version>
-    </parent>
-
-    <groupId>org.glassfish.tests</groupId>
-    <artifactId>nucleus-admin</artifactId>
-
-    <name>Nucleus Tests - Admin</name>
-    <description>This pom describes how to run admin developer tests on the Nucleus Bundle</description>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.glassfish.hk2</groupId>
-            <artifactId>hk2-api</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.glassfish.jersey.core</groupId>
-            <artifactId>jersey-server</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.glassfish.jersey.inject</groupId>
-            <artifactId>jersey-hk2</artifactId>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.glassfish.main.admin</groupId>
-            <artifactId>rest-client</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.glassfish.main.admin</groupId>
-            <artifactId>rest-service</artifactId>
-            <version>${project.version}</version>
-            <type>jar</type>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.glassfish.main.common</groupId>
-            <artifactId>common-util</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>jakarta.xml.bind</groupId>
-            <artifactId>jakarta.xml.bind-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.sun.xml.bind</groupId>
-            <artifactId>jaxb-osgi</artifactId>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <artifactId>maven-invoker-plugin</artifactId>
-                <configuration>
-                    <pomIncludes>
-                        <pomInclude>modules/*/pom.xml</pomInclude>
-                        <pomInclude>asadmin/*/pom.xml</pomInclude>
-                    </pomIncludes>
-                    <goals>
-                        <goal>clean</goal>
-                        <goal>package</goal>
-                    </goals>
-                    <projectsDirectory>${basedir}/src/addon/</projectsDirectory>
-                    <cloneProjectsTo>${project.build.directory}/addon</cloneProjectsTo>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>build-addons</id>
-                        <phase>process-test-resources</phase>
-                        <goals>
-                            <goal>run</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-
-            <plugin>
-                <artifactId>maven-surefire-plugin</artifactId>
-                <configuration>
-                    <properties>
-                        <runOrder>alphabetical</runOrder>
-                    </properties>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-</project>
diff --git a/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/pom.xml b/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/pom.xml
deleted file mode 100644
index bfcb847..0000000
--- a/nucleus/tests/admin/src/addon/modules/test-progress-status-commands/pom.xml
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
-
-    This program and the accompanying materials are made available under the
-    terms of the Eclipse Public License v. 2.0, which is available at
-    http://www.eclipse.org/legal/epl-2.0.
-
-    This Source Code may also be made available under the following Secondary
-    Licenses when the conditions for such availability set forth in the
-    Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
-    version 2 with the GNU Classpath Exception, which is available at
-    https://www.gnu.org/software/classpath/license.html.
-
-    SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-
--->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.glassfish.main.tests</groupId>
-        <artifactId>nucleus-tests</artifactId>
-        <version>@project.version@</version>
-        <relativePath>../../../../../pom.xml</relativePath>
-    </parent>
-    <artifactId>test-progress-status-commands</artifactId>
-    <name>Progress status - Test Commands</name>
-    <packaging>glassfish-jar</packaging>
-
-    <properties>
-    </properties>
-
-    <build>
-        <resources>
-            <resource>
-                <directory>src/main/java</directory>
-                <includes>
-                    <include>**/*.properties</include>
-                </includes>
-            </resource>
-            <resource>
-                <directory>src/main/resources</directory>
-                <includes>
-                    <include>**/*.1</include>
-                    <include>**/*.xml</include>
-                    <include>**/*.properties</include>
-                </includes>
-            </resource>
-        </resources>
-
-    </build>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.glassfish.main.common</groupId>
-            <artifactId>glassfish-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.glassfish.main.common</groupId>
-            <artifactId>common-util</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.glassfish.main.admin</groupId>
-            <artifactId>config-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.glassfish.hk2</groupId>
-            <artifactId>hk2</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.glassfish.hk2</groupId>
-            <artifactId>hk2-junitrunner</artifactId>
-        </dependency>
-    </dependencies>
-</project>
-
diff --git a/nucleus/tests/admin/src/main/java/.gitkeep_empty_dir b/nucleus/tests/admin/src/main/java/.gitkeep_empty_dir
deleted file mode 100644
index e69de29..0000000
--- a/nucleus/tests/admin/src/main/java/.gitkeep_empty_dir
+++ /dev/null
diff --git a/nucleus/tests/admin/src/main/resources/.gitkeep_empty_dir b/nucleus/tests/admin/src/main/resources/.gitkeep_empty_dir
deleted file mode 100644
index e69de29..0000000
--- a/nucleus/tests/admin/src/main/resources/.gitkeep_empty_dir
+++ /dev/null
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/ClusterTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/ClusterTest.java
deleted file mode 100644
index 566259d..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/ClusterTest.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin;
-
-import static org.glassfish.tests.utils.NucleusTestUtils.getURL;
-import static org.glassfish.tests.utils.NucleusTestUtils.matchString;
-import static org.glassfish.tests.utils.NucleusTestUtils.nadmin;
-import static org.testng.AssertJUnit.assertTrue;
-
-import org.testng.annotations.Test;
-
-/**
- *
- * @author Tom Mueller
- */
-@Test(testName = "ClusterTest", enabled = true)
-public class ClusterTest {
-
-    final String tn = "QLCluster";
-    final String port1 = "55123";
-    final String port2 = "55124";
-    final String cname = "eec1";
-    final String i1name = "eein1-with-a-very-very-very-long-name";
-    final String i2name = "eein2";
-    String i1url = "http://localhost:" + port1;
-    String i2url = "http://localhost:" + port2;
-
-    @Test
-    public void createClusterTest() {
-        // create a cluster and two instances
-        assertTrue("create cluster", nadmin("create-cluster", cname));
-    }
-
-    @Test(dependsOnMethods = { "createClusterTest" })
-    public void createInstancesTest() {
-        assertTrue("create instance1",
-            nadmin("create-local-instance", "--cluster", cname, "--systemproperties",
-                        "HTTP_LISTENER_PORT=" + port1 + ":" +
-                        "HTTP_SSL_LISTENER_PORT=18181:" +
-                        "IIOP_SSL_LISTENER_PORT=13800:" +
-                        "IIOP_LISTENER_PORT=13700:" +
-                        "JMX_SYSTEM_CONNECTOR_PORT=17676:" +
-                        "IIOP_SSL_MUTUALAUTH_PORT=13801:" +
-                        "JMS_PROVIDER_PORT=18686:" +
-                        "ASADMIN_LISTENER_PORT=14848",
-                        i1name));
-
-        assertTrue("create instance2",
-            nadmin("create-local-instance", "--cluster", cname, "--systemproperties",
-                    "HTTP_LISTENER_PORT=" + port2 +
-                    ":HTTP_SSL_LISTENER_PORT=28181:IIOP_SSL_LISTENER_PORT=23800:" +
-                    "IIOP_LISTENER_PORT=23700:JMX_SYSTEM_CONNECTOR_PORT=27676:IIOP_SSL_MUTUALAUTH_PORT=23801:" +
-                    "JMS_PROVIDER_PORT=28686:ASADMIN_LISTENER_PORT=24848",
-                    i2name));
-    }
-
-    @Test(dependsOnMethods = { "createInstancesTest" })
-    public void startInstancesTest() {
-        // start the instances
-        assertTrue("start instance1", nadmin("start-local-instance", i1name));
-        assertTrue("start instance2", nadmin("start-local-instance", i2name));
-    }
-
-    @Test(dependsOnMethods = { "startInstancesTest" })
-    public void checkClusterTest() {
-        // check that the instances are there
-        assertTrue("list-instances", nadmin("list-instances"));
-        assertTrue("getindex1", matchString("GlassFish Server", getURL(i1url)));
-        assertTrue("getindex2", matchString("GlassFish Server", getURL(i2url)));
-    }
-
-    @Test(dependsOnMethods = { "checkClusterTest" })
-    public void stopInstancesTest() {
-        // stop and delete the instances and cluster
-        assertTrue("stop instance1", nadmin("stop-local-instance", "--kill", i1name));
-        assertTrue("stop instance2", nadmin("stop-local-instance", "--kill", i2name));
-    }
-
-    @Test(dependsOnMethods = { "stopInstancesTest" })
-    public void deleteInstancesTest() {
-        assertTrue("delete instance1", nadmin("delete-local-instance", i1name));
-        assertTrue("delete instance2", nadmin("delete-local-instance", i2name));
-    }
-
-    @Test(dependsOnMethods = { "deleteInstancesTest" })
-    public void deleteClusterTest() {
-        assertTrue("delete cluster", nadmin("delete-cluster", cname));
-    }
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/MiscCommandsTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/MiscCommandsTest.java
deleted file mode 100644
index 6067b94..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/MiscCommandsTest.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin;
-
-import static org.glassfish.tests.utils.NucleusTestUtils.*;
-import static org.testng.AssertJUnit.assertTrue;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author Tom Mueller
- */
-@Test(testName="MiscCommandsTest")
-public class MiscCommandsTest {
-
-    public void uptime() {
-        assertTrue(nadmin("uptime"));
-    }
-
-    public void version1() {
-        assertTrue(nadmin("version"));
-    }
-
-    public void version2() {
-        assertTrue(nadmin("stop-domain"));
-        assertTrue(nadmin("version", "--local"));
-        assertTrue(nadmin("start-domain"));
-    }
-
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/NucleusStartStopTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/NucleusStartStopTest.java
deleted file mode 100644
index edabfbf..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/NucleusStartStopTest.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin;
-
-import static org.glassfish.tests.utils.NucleusTestUtils.getNucleusRoot;
-import static org.glassfish.tests.utils.NucleusTestUtils.nadmin;
-import static org.testng.AssertJUnit.assertNotNull;
-import static org.testng.AssertJUnit.assertTrue;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.nio.channels.FileChannel;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.testng.ITestContext;
-import org.testng.annotations.AfterSuite;
-import org.testng.annotations.BeforeSuite;
-
-public class NucleusStartStopTest {
-
-    private static final String TEST_LIBS_KEY = "TEST_LIBS";
-    private static final Map<String, String> COPY_LIB;
-    static {
-        Map<String, String> map = new HashMap<>();
-        map.put("modules", "modules");
-        COPY_LIB = Collections.unmodifiableMap(map);
-    }
-
-    @BeforeSuite
-    public void setUp(ITestContext context) throws IOException {
-        // Copy testing libraries into Nucleus distribution
-        Collection<File> testLibs = new ArrayList<File>();
-        context.setAttribute(TEST_LIBS_KEY, testLibs);
-        String basedir = System.getProperty("basedir");
-        assertNotNull(basedir);
-
-        File addondir = new File(basedir, "target/addon");
-        for (Map.Entry<String, String> copyLibEntry : COPY_LIB.entrySet()) {
-            copyLibraries(
-                new File(addondir, copyLibEntry.getKey()),
-                new File(getNucleusRoot(), copyLibEntry.getValue()),
-                testLibs);
-        }
-
-        // Start
-        assertTrue(nadmin("start-domain"));
-    }
-
-    @AfterSuite(alwaysRun = true)
-    public void tearDown(ITestContext context) {
-        try {
-            assertTrue(nadmin("stop-domain"));
-        } finally {
-            @SuppressWarnings("unchecked")
-            Collection<File> libs = (Collection<File>) context.getAttribute(TEST_LIBS_KEY);
-            if (libs != null) {
-                for (File lib : libs) {
-                    if (lib.exists()) {
-                        try {
-                            lib.delete();
-                        } catch (Exception ex) {
-                            System.out.println("Can not delete " + lib.getAbsolutePath());
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    private void copyLibraries(File src, File dest, Collection<File> copiedLibs) throws IOException {
-        if (src.exists() && src.isDirectory()) {
-            File[] dirs = src.listFiles(f -> f.isDirectory());
-
-            for (File dir : dirs) {
-                File target = new File(dir, "target");
-                if (target.exists() && target.isDirectory()) {
-                    File[] jars = target.listFiles(f-> f.isFile() && f.getName().toLowerCase().endsWith(".jar"));
-
-                    for (File jar : jars) {
-                        File destinationFile = new File(dest, jar.getName());
-                        copiedLibs.add(destinationFile);
-                        copy(jar, destinationFile);
-
-                        System.out.println("TESTING LIBRARY: " + destinationFile.getAbsolutePath());
-                    }
-                }
-            }
-        }
-    }
-
-    private static void copy(File src, File dest) throws IOException {
-        if (!dest.exists()) {
-            dest.createNewFile();
-        }
-
-        try (FileChannel sch = new FileInputStream(src).getChannel();  FileChannel dch = new FileOutputStream(dest).getChannel()) {
-            dch.transferFrom(sch, 0, sch.size());
-        }
-    }
-
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/OSGiCommandsTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/OSGiCommandsTest.java
deleted file mode 100644
index 36faf61..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/OSGiCommandsTest.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin;
-
-import org.glassfish.api.admin.AccessRequired;
-import org.glassfish.tests.utils.NucleusTestUtils;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import java.io.*;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import static org.glassfish.tests.utils.NucleusTestUtils.nadmin;
-import static org.glassfish.tests.utils.NucleusTestUtils.nadminWithOutput;
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertFalse;
-import static org.testng.AssertJUnit.assertTrue;
-
-/**
- * @author sanjeeb.sahoo@oracle.com
- */
-@Test
-public class OSGiCommandsTest {
-
-    public void basicOsgiCmd() {
-        assertTrue(nadmin("osgi", "lb"));
-    }
-
-    private List<String> runCmd(String... cmd) throws Exception {
-        NucleusTestUtils.NadminReturn value = nadminWithOutput(cmd);
-        if (!value.returnValue) {
-            throw new Exception("Cmd failed: \n" + value.outAndErr);
-        }
-        List<String> output = new ArrayList<String>();
-        for (String line : value.out.split("\\n")) {
-            line = line.trim();
-            if (line.isEmpty() || line.startsWith("nadmin") || line.startsWith("Command")) continue;
-            output.add(line);
-        }
-        return output;
-    }
-
-    private String newCmdSession() throws Exception {
-        List<String> value = runCmd("osgi", "--session", "new");
-        if (value.size() != 1) {
-            throw new Exception("Unexpected output: \n " + value);
-        }
-        return value.get(0);
-    }
-
-    private Set<String> listCmdSessions() throws Exception {
-        List<String> sessions = runCmd("osgi", "--session", "list");
-        return new HashSet<String>(sessions);
-    }
-
-    /**
-     * Tests functionality of session handling of osgi command.
-     * It creates sessions, lists them, executes commands against each session and finally stops them.
-     * @throws Exception
-     */
-    public void osgiCmdSession() throws Exception {
-        // Create some sessions
-        Set<String> sessions = new HashSet<String>();
-        for (int i = 0 ; i < 3; ++i) {
-            sessions.add(newCmdSession());
-        }
-
-        // Let's list them to make sure list operation works.
-        final Set<String> actual = listCmdSessions();
-        assertEquals("listed sessions do not match with created sessions", sessions, actual);
-
-        // Let's set the same variable in each command session with a different value and make sure the variables
-        // are scoped to sessions.
-        for (String sessionId : sessions) {
-            runCmd("osgi", "--session", "execute", "--session-id", sessionId, "var=" + sessionId);
-        }
-        for (String sessionId : sessions) {
-            String value = runCmd("osgi", "--session", "execute", "--session-id", sessionId, "echo $var").get(0);
-            assertEquals(sessionId, value);
-        }
-
-        // Let's stop all sessions.
-        for (String sessionId : sessions) {
-            runCmd("osgi", "--session", "stop", "--session-id", sessionId);
-        }
-        sessions = listCmdSessions();
-        assertTrue("Not all sessions closed properly: " + sessions, sessions.isEmpty());
-    }
-
-    /**
-     * Test osgi-shell command which is a local command. It takes a file as input. The file contains
-     * a list of shell commands to be executed.
-     * @throws IOException
-     */
-    public void osgiShell() throws IOException {
-        File cmdFile = File.createTempFile("osgi-commands", ".txt");
-        cmdFile.deleteOnExit();
-        PrintStream ps = new PrintStream(new FileOutputStream(cmdFile));
-        try {
-            ps.println("help");
-            ps.println("lb");
-            NucleusTestUtils.NadminReturn value = nadminWithOutput("osgi-shell", "--file", cmdFile.getAbsolutePath());
-            assertTrue(value.out.contains("System Bundle"));
-        } finally {
-            try {
-                ps.close();
-            } catch (Exception e) {
-                // ignore
-            }
-        }
-    }
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/RestTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/RestTest.java
deleted file mode 100644
index f73e62c..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/RestTest.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin;
-
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import static org.testng.AssertJUnit.*;
-import org.testng.annotations.Test;
-
-@Test
-public class RestTest {
-
-    public void testManagementEndpoint() {
-        try {
-            HttpURLConnection connection = getConnection("http://localhost:4848/management/domain.xml");
-            assertEquals(200, connection.getResponseCode());
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-    }
-
-    public void testMonitoringEndpoint() {
-        try {
-            HttpURLConnection connection = getConnection("http://localhost:4848/monitoring/domain.xml");
-            assertEquals(200, connection.getResponseCode());
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-    }
-
-    public void testAdminCommandEndpoint() {
-        try {
-            HttpURLConnection connection = getConnection("http://localhost:4848/management/domain/version.xml");
-            assertEquals(200, connection.getResponseCode());
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-    }
-
-    public void testChildConfigBeanEndpoint() {
-        try {
-            HttpURLConnection connection = getConnection("http://localhost:4848/management/domain/applications.xml");
-            assertEquals(200, connection.getResponseCode());
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-    }
-
-    public void testPostGetDelete() {
-        deleteNode(); // This should almost always fail, so we don't check the status. Just need to clean up from any prior runs
-        assertEquals(200, createNode());
-        assertEquals(200, getNode());
-        assertEquals(200, deleteNode());
-    }
-
-    protected HttpURLConnection getConnection(String url) throws IOException {
-        HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
-        connection.setRequestProperty("X-GlassFish-3", "true");
-        connection.setRequestProperty("X-Requested-By", "dummy");
-        return connection;
-    }
-
-    private int createNode() {
-        HttpURLConnection connection = null;
-        try {
-            String parameters = "name=myConfigNode";
-            connection = getConnection("http://localhost:4848/management/domain/nodes/create-node-config");
-            connection.setRequestMethod("POST");
-            connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
-            connection.setRequestProperty("Content-Length", "" + Integer.toString(parameters.getBytes().length));
-            connection.setUseCaches(false);
-            connection.setDoInput(true);
-            connection.setDoOutput(true);
-            connection.setRequestProperty("Content-Language", "en-US");
-            DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
-            wr.writeBytes(parameters);
-            wr.flush();
-            wr.close();
-            return connection.getResponseCode();
-        } catch (Exception ex) {
-            fail(ex.getMessage());
-        } finally {
-            if (connection != null) {
-                connection.disconnect();
-            }
-        }
-
-        return -1;
-    }
-
-    private int getNode() {
-        HttpURLConnection connection = null;
-        try {
-            connection = getConnection("http://localhost:4848/management/domain/nodes/node/myConfigNode");
-            return connection.getResponseCode();
-        } catch (Exception ex) {
-            fail(ex.getMessage());
-        } finally {
-            if (connection != null) {
-                connection.disconnect();
-            }
-        }
-
-        return -1;
-    }
-
-    private int deleteNode() {
-        HttpURLConnection connection = null;
-        try {
-            connection = getConnection("http://localhost:4848/management/domain/nodes/delete-node-config?name=myConfigNode");
-            connection.setRequestMethod("DELETE");
-            connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
-            connection.setDoOutput(true);
-            return connection.getResponseCode();
-        } catch (Exception ex) {
-            fail(ex.getMessage());
-        } finally {
-            if (connection != null) {
-                connection.disconnect();
-            }
-        }
-
-        return -1;
-    }
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/progress/DetachAttachTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/progress/DetachAttachTest.java
deleted file mode 100644
index 92e064e..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/progress/DetachAttachTest.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.progress;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.io.File;
-import java.util.StringTokenizer;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-import java.util.concurrent.ThreadFactory;
-import static org.glassfish.tests.utils.NucleusTestUtils.*;
-import static org.testng.AssertJUnit.*;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author martinmares
- */
-@Test(testName="DetachAttachTest")
-public class DetachAttachTest {
-    private static File nucleusRoot  = getNucleusRoot();
-
-    @AfterTest
-    public void cleanUp() throws Exception {
-        nadmin("stop-domain");
-        JobManagerTest.deleteJobsFile();
-        //osgi-cache workaround
-        File osgiCacheDir = new File(nucleusRoot, "domains"+File.separator+"domain1"+File.separator+"osgi-cache");
-        deleteDirectoryContents(osgiCacheDir);
-        nadmin("start-domain");
-    }
-
-    // Test disabled till intermittent failures are fixed
-    @Test(enabled = false)
-    public void uptimePeriodically() throws InterruptedException {
-        Set<String> ids = new HashSet<String>();
-        for (int i = 0; i < 3; i++) {
-            System.out.println("detachAndAttachUptimePeriodically(): round " + i);
-            NadminReturn result = nadminWithOutput("--detach", "--terse", "uptime");
-            assertTrue(result.returnValue);
-            String id = parseJobIdFromEchoTerse(result.out);
-            assertTrue(ids.add(id)); //Must be unique
-            Thread.sleep(1000L);
-            //Now attach
-            result = nadminWithOutput("--terse", "attach", id);
-            assertTrue(result.returnValue);
-            assertTrue(result.out.contains("uptime"));
-        }
-    }
-
-    public void commandWithProgressStatus() throws InterruptedException {
-        NadminReturn result = nadminWithOutput("--detach", "--terse", "progress-custom", "6x1");
-        assertTrue(result.returnValue);
-        String id = parseJobIdFromEchoTerse(result.out);
-        Thread.sleep(2000L);
-        //Now attach running
-        result = nadminWithOutput("attach", id);
-        assertTrue(result.returnValue);
-        assertTrue(result.out.contains("progress-custom"));
-        List<ProgressMessage> prgs = ProgressMessage.grepProgressMessages(result.out);
-        assertFalse(prgs.isEmpty());
-        assertTrue(prgs.get(0).getValue() > 0);
-        assertEquals(100, prgs.get(prgs.size() - 1).getValue());
-        //Now attach finished - must NOT exists - seen progress job is removed
-        result = nadminWithOutput("attach", id);
-        assertFalse(result.returnValue);
-    }
-
-    public void detachOnesAttachMulti() throws InterruptedException, ExecutionException {
-        ExecutorService pool = Executors.newCachedThreadPool(new ThreadFactory() {
-                                            @Override
-                                            public Thread newThread(Runnable r) {
-                                                Thread result = new Thread(r);
-                                                result.setDaemon(true);
-                                                return result;
-                                            }
-                                        });
-        //Execute command with progress status suport
-        NadminReturn result = nadminWithOutput("--detach", "--terse", "progress-custom", "8x1");
-        assertTrue(result.returnValue);
-        final String id = parseJobIdFromEchoTerse(result.out);
-        Thread.sleep(1500L);
-        //Now attach
-        final int _attach_count = 3;
-        Collection<Callable<NadminReturn>> attaches = new ArrayList<Callable<NadminReturn>>(_attach_count);
-        for (int i = 0; i < _attach_count; i++) {
-            attaches.add(new Callable<NadminReturn>() {
-                    @Override
-                    public NadminReturn call() throws Exception {
-                        return nadminWithOutput("attach", id);
-                    }
-                });
-        }
-        List<Future<NadminReturn>> results = pool.invokeAll(attaches);
-        //Test results
-        for (Future<NadminReturn> fRes : results) {
-            NadminReturn res = fRes.get();
-            assertTrue(res.returnValue);
-            assertTrue(res.out.contains("progress-custom"));
-            List<ProgressMessage> prgs = ProgressMessage.grepProgressMessages(res.out);
-            assertFalse(prgs.isEmpty());
-            assertTrue(prgs.get(0).getValue() > 0);
-            assertEquals(100, prgs.get(prgs.size() - 1).getValue());
-        }
-    }
-
-    private String parseJobIdFromEchoTerse(String str) {
-        StringTokenizer stok = new StringTokenizer(str, "\n\r");
-        assertTrue(stok.hasMoreTokens());
-        stok.nextToken();
-        //Id is second non empty line
-        assertTrue(stok.hasMoreTokens());
-        String result = stok.nextToken().trim();
-        assertFalse(result.isEmpty());
-        assertFalse(result.contains(" ")); //With space does not look like ID but like some error message
-        return result;
-    }
-
-    static class NadminCallable implements Callable<NadminReturn> {
-
-        private final String[] args;
-
-        public NadminCallable(String... args) {
-            this.args = args;
-        }
-
-        @Override
-        public NadminReturn call() throws Exception {
-            throw new UnsupportedOperationException("Not supported yet.");
-        }
-
-
-
-    }
-
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/progress/JobManagerTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/progress/JobManagerTest.java
deleted file mode 100644
index b6d16b6..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/progress/JobManagerTest.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.progress;
-
-import java.io.File;
-import java.lang.InterruptedException;
-import java.lang.Thread;
-
-import static org.glassfish.tests.utils.NucleusTestUtils.*;
-import  org.glassfish.tests.utils.NucleusTestUtils;
-import static org.testng.AssertJUnit.assertTrue;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Test;
-
-/**
- * This tests the functionality of JobManager, list-jobs
- * @author Bhakti Mehta
- */
-@Test(testName="JobManagerTest", enabled=true)
-public class JobManagerTest {
-    private static File nucleusRoot  = NucleusTestUtils.getNucleusRoot();
-
-    private final String COMMAND1 = "progress-simple";
-
-    @BeforeTest
-    public void setUp() throws Exception {
-        nadmin("stop-domain");
-        //delete jobs.xml incase there were other jobs run
-        deleteJobsFile();
-        //osgi-cache workaround
-        File osgiCacheDir = new File(nucleusRoot, "domains"+File.separator+"domain1"+File.separator+"osgi-cache");
-        deleteDirectoryContents(osgiCacheDir);
-        nadmin("start-domain");
-
-
-    }
-
-    @AfterTest
-    public void cleanUp() throws Exception {
-        nadmin("stop-domain");
-        nadmin("start-domain");
-
-    }
-
-    @Test(enabled=true)
-    public void noJobsTest() {
-        nadmin("stop-domain");
-        //delete jobs.xml incase there were other jobs run
-        deleteJobsFile();
-        nadmin("start-domain");
-        String result = null;
-        result = nadminWithOutput("list-jobs").outAndErr;
-        assertTrue(matchString("Nothing to list", result));
-
-
-    }
-
-    @Test(dependsOnMethods = { "noJobsTest" },enabled=true)
-    public void runJobTest() {
-        String result = null;
-
-        NadminReturn result1 = nadminWithOutput("--terse", "progress-simple");
-        assertTrue(result1.returnValue);
-        //check list-jobs
-        result = nadminWithOutput("list-jobs").out;
-        assertTrue( result.contains(COMMAND1) && result.contains("COMPLETED"));
-        //check list-jobs with id 1
-        result = nadminWithOutput("list-jobs","1").out;
-        assertTrue( result.contains(COMMAND1) && result.contains("COMPLETED"));
-        //shutdown server
-        assertTrue( nadmin("stop-domain"));
-        //restart
-        assertTrue( nadmin("start-domain"));
-        //check jobs
-        result = nadminWithOutput("list-jobs","1").out;
-        assertTrue( result.contains(COMMAND1) && result.contains("COMPLETED"));
-        nadmin("start-domain");
-
-    }
-
-    @Test(dependsOnMethods = { "runJobTest" }, enabled=true)
-       public void runDetachTest() {
-           String result = null;
-           //shutdown server
-           assertTrue( nadmin("stop-domain"));
-
-           //delete the jobs file
-           deleteJobsFile();
-
-           //restart
-           assertTrue( nadmin("start-domain"));
-           result = nadminDetachWithOutput( COMMAND1).out;
-           //Detached job id is returned
-           assertTrue( result.contains("Job ID: "));
-
-           //list-jobs
-           result = nadminWithOutput("list-jobs","1").out;
-           assertTrue( result.contains(COMMAND1) );
-           //attach to the job
-           assertTrue(nadmin("attach", "1"));
-
-           //list-jobs   and it should be purged since the user
-           //starting is the same as the user who attached to it
-           result = nadminWithOutput("list-jobs").outAndErr;
-           assertTrue(matchString("Nothing to list", result));
-
-           //delete the jobs file
-           deleteJobsFile();
-
-
-
-       }
-
-       @Test(dependsOnMethods = { "runDetachTest" }, enabled=false)
-       public void runConfigureManagedJobsTest() throws InterruptedException {
-           try {
-               String result = null;
-               //shutdown server
-               assertTrue( nadmin("stop-domain"));
-
-               //delete the jobs file
-               deleteJobsFile();
-
-               //restart
-               assertTrue( nadmin("start-domain"));
-               //configure-managed-jobs
-               assertTrue( nadmin("configure-managed-jobs","--job-retention-period=6s","--cleanup-initial-delay=2s",
-                       "--cleanup-poll-interval=2s"));
-               assertTrue(COMMAND1, nadmin(COMMAND1));
-
-
-               //list-jobs
-               result = nadminWithOutput("list-jobs","1").out;
-               assertTrue( result.contains(COMMAND1) );
-               //shutdown server
-               assertTrue( nadmin("stop-domain"));
-
-               //start server
-               assertTrue( nadmin("start-domain"));
-               Thread.sleep(5000L);
-
-               //list-jobs there should be none since the configure-managed-jobs command will purge it
-               result = nadminWithOutput("list-jobs").outAndErr;
-               assertTrue(matchString("Nothing to list", result));
-
-           } finally {
-                //reset configure-managed-jobs
-                assertTrue( nadmin("configure-managed-jobs","--job-retention-period=24h","--cleanup-initial-delay=20m",
-                   "--cleanup-poll-interval=20m"));
-           }
-           //delete the jobs file
-           deleteJobsFile();
-
-
-
-       }
-
-    /**
-     * This will delete the jobs.xml file
-     */
-    public static void deleteJobsFile() {
-        File configDir = new File(nucleusRoot,"domains/domain1/config");
-        File jobsFile = new File (configDir,"jobs.xml");
-        System.out.println("Deleting.. " + jobsFile);
-        if (jobsFile!= null && jobsFile.exists()) {
-            jobsFile.delete();
-        }
-    }
-
-
-}
-
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/progress/ProgressMessage.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/progress/ProgressMessage.java
deleted file mode 100644
index 88f391d..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/progress/ProgressMessage.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.progress;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/** Parse progress status message.
- *
- * @author martinmares
- */
-public class ProgressMessage {
-
-    private static final Pattern RGXP = Pattern.compile(" *(\\d+)(%)?:(.+:)?(.*)");
-
-    private final int value;
-    private final boolean percentage;
-    private final String scope;
-    private final String message;
-
-    public ProgressMessage(String txt) throws IllegalArgumentException {
-        Matcher matcher = RGXP.matcher(txt);
-        if (!matcher.matches()) {
-            throw new IllegalArgumentException("Arg txt is not progress message");
-        }
-        this.value = Integer.parseInt(matcher.group(1));
-        this.percentage = matcher.group(2) != null;
-        this.scope = nvlTrim(matcher.group(3));
-        this.message = nvlTrim(matcher.group(4));
-    }
-
-    private static String nvlTrim(String txt) {
-        if (txt != null) {
-            txt = txt.trim();
-        }
-        return txt;
-    }
-
-    public int getValue() {
-        return value;
-    }
-
-    public boolean isPercentage() {
-        return percentage;
-    }
-
-    public String getScope() {
-        return scope;
-    }
-
-    public String getMessage() {
-        return message;
-    }
-
-    public static List<ProgressMessage> grepProgressMessages(String txt) {
-        StringTokenizer stok = new StringTokenizer(txt, "\n\r");
-        List<ProgressMessage> result = new ArrayList<ProgressMessage>();
-        while (stok.hasMoreTokens()) {
-            String line = stok.nextToken();
-            try {
-                result.add(new ProgressMessage(line));
-            } catch (Exception ex) {
-                //System.out.println(ex);
-            }
-        }
-        return result;
-    }
-
-    /** Unique only that not equal with previous.
-     */
-    public static String[] uniqueMessages(List<ProgressMessage> pms) {
-        List<String> messages = new ArrayList<String>();
-        for (ProgressMessage pm : pms) {
-            if (pm.getMessage() != null &&
-                    (messages.isEmpty() || !pm.getMessage().equals(messages.get(messages.size() - 1)))) {
-                messages.add(pm.getMessage());
-            }
-        }
-        String[] result = new String[messages.size()];
-        return messages.toArray(result);
-    }
-
-    public static boolean isNonDecreasing(List<ProgressMessage> pms) {
-        if (pms == null) {
-            return false;
-        }
-        int lastVal = Integer.MIN_VALUE;
-        for (ProgressMessage pm : pms) {
-            if (pm.getValue() < lastVal) {
-                return false;
-            } else {
-                lastVal = pm.getValue();
-            }
-        }
-        return true;
-    }
-
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/progress/ProgressStatusBasicTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/progress/ProgressStatusBasicTest.java
deleted file mode 100644
index 93ab234..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/progress/ProgressStatusBasicTest.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.progress;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.List;
-import static org.glassfish.tests.utils.NucleusTestUtils.*;
-import static org.testng.AssertJUnit.*;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author martinmares
- */
-@Test(testName="ProgressStatusBasicTest")
-public class ProgressStatusBasicTest {
-
-    public void simple() {
-        NadminReturn result = nadminWithOutput("progress-simple");
-        assertTrue(result.returnValue);
-        List<ProgressMessage> prgs = ProgressMessage.grepProgressMessages(result.out);
-        assertEquals(12, prgs.size());
-        for (int i = 0; i < 11; i++) {
-            assertEquals(10 * i, prgs.get(i + 1).getValue());
-            assertTrue(prgs.get(i + 1).isPercentage());
-        }
-        assertTrue(ProgressMessage.isNonDecreasing(prgs));
-    }
-
-    public void simpleNoTotal() {
-        NadminReturn result = nadminWithOutput("progress-simple", "--nototalsteps");
-        assertTrue(result.returnValue);
-        List<ProgressMessage> prgs = ProgressMessage.grepProgressMessages(result.out);
-        boolean nonPercentageExists = false;
-        for (ProgressMessage prg : prgs) {
-            if (prg.getValue() != 0 && prg.getValue() != 100) {
-                assertFalse(prg.isPercentage());
-                nonPercentageExists = true;
-            }
-        }
-        assertTrue(nonPercentageExists);
-        assertTrue(ProgressMessage.isNonDecreasing(prgs));
-    }
-
-    public void simpleSpecInAnnotation() {
-        NadminReturn result = nadminWithOutput("progress-full-annotated");
-        assertTrue(result.returnValue);
-        List<ProgressMessage> prgs = ProgressMessage.grepProgressMessages(result.out);
-        assertEquals(12, prgs.size());
-        for (int i = 0; i < 11; i++) {
-            assertEquals(10 * i, prgs.get(i + 1).getValue());
-            assertTrue(prgs.get(i + 1).isPercentage());
-        }
-        assertTrue(ProgressMessage.isNonDecreasing(prgs));
-        assertEquals("annotated:", prgs.get(5).getScope());
-    }
-
-    public void simpleTerse() {
-        NadminReturn result = nadminWithOutput("--terse", "progress-simple");
-        assertTrue(result.returnValue);
-        List<ProgressMessage> prgs = ProgressMessage.grepProgressMessages(result.out);
-        assertTrue(prgs.isEmpty());
-    }
-
-//    public void commandWithPayloud() throws IOException {
-//        File tmp = File.createTempFile(String.valueOf(System.currentTimeMillis()) + "ms_", "test");
-//        FileWriter writer = null;
-//        try {
-//            writer = new FileWriter(tmp);
-//            writer.write("This is testing file for nucleus admin tests.\n");
-//            writer.write("Created - " + System.currentTimeMillis() + "\n");
-//            writer.close();
-//            NadminReturn result = nadminWithOutput("progress-payload", tmp.getCanonicalPath());
-//            assertTrue(result.returnValue);
-//            List<ProgressMessage> prgs = ProgressMessage.grepProgressMessages(result.out);
-//            assertTrue(prgs.size() > 0);
-//        } finally {
-//            try {tmp.delete();} catch (Exception ex) {}
-//        }
-//    }
-
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/progress/ProgressStatusComplexTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/progress/ProgressStatusComplexTest.java
deleted file mode 100644
index e926ac1..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/progress/ProgressStatusComplexTest.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.progress;
-
-import static org.glassfish.nucleus.admin.progress.ProgressMessage.grepProgressMessages;
-import static org.glassfish.nucleus.admin.progress.ProgressMessage.isNonDecreasing;
-import static org.glassfish.nucleus.admin.progress.ProgressMessage.uniqueMessages;
-import static org.glassfish.tests.utils.NucleusTestUtils.nadminWithOutput;
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertFalse;
-import static org.testng.AssertJUnit.assertTrue;
-import static org.testng.internal.junit.ArrayAsserts.assertArrayEquals;
-
-import java.util.List;
-
-import org.glassfish.tests.utils.NucleusTestUtils;
-import org.glassfish.tests.utils.NucleusTestUtils.NadminReturn;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author martinmares
- */
-@Test(testName = "ProgressStatusComplexTest")
-public class ProgressStatusComplexTest {
-
-    public void executeCommandFromCommand() {
-        NadminReturn result = nadminWithOutput("progress-exec-other");
-
-        assertTrue(result.returnValue);
-
-        assertArrayEquals(new String[] {
-            "Starting", "Preparing", "Parsing", "Working on main part",
-            "Cleaning", "Finished", "Finishing outer command", "Finished outer command" },
-
-            uniqueMessages(grepProgressMessages(result.out)));
-    }
-
-    @Test(enabled = false)
-    public void executeCommandWithSupplements() {
-        NadminReturn result = nadminWithOutput("progress-supplement");
-        assertTrue(result.returnValue);
-
-        List<ProgressMessage> prgs = grepProgressMessages(result.out);
-
-        assertArrayEquals(new String[] {
-            "Starting", "2 seconds supplemental command", "Parsing",
-            "Working on main part", "Finished", "3 seconds supplemental" },
-
-            uniqueMessages(prgs));
-
-        assertTrue(prgs.size() > 10);
-        assertFalse(prgs.get(4).isPercentage());
-        assertTrue(prgs.get(10).isPercentage());
-        assertTrue(isNonDecreasing(prgs));
-    }
-
-    // Test disabled till intermittent failures are fixed
-    @Test(enabled = false)
-    public void executeVeryComplexCommand() {
-        NucleusTestUtils.NadminReturn result = nadminWithOutput("progress-complex");
-
-        assertTrue(result.returnValue);
-
-        List<ProgressMessage> prgs = ProgressMessage.grepProgressMessages(result.out);
-        assertTrue(prgs.size() > 40);
-        assertTrue(scopeCount(prgs, "complex:") >= 4);
-        assertEquals(0, scopeCount(prgs, "complex.ch1:"));
-        assertEquals(5, scopeCount(prgs, "complex.ch2-paral:"));
-        assertEquals(4, scopeCount(prgs, "complex.ch3:"));
-        assertEquals(5, scopeCount(prgs, "complex.ch1.ch11:"));
-        assertEquals(6, scopeCount(prgs, "complex.ch1.ch12:"));
-        assertEquals(25, scopeCount(prgs, "complex.ch2-paral.ch21:"));
-        assertEquals(25, scopeCount(prgs, "complex.ch2-paral.ch22:"));
-        assertEquals(25, scopeCount(prgs, "complex.ch2-paral.ch23:"));
-        assertEquals(25, scopeCount(prgs, "complex.ch2-paral.ch24:"));
-        assertEquals(5, scopeCount(prgs, "complex.ch3.ch31:"));
-        assertEquals(5, scopeCount(prgs, "complex.ch3.ch32:"));
-        assertTrue(ProgressMessage.isNonDecreasing(prgs));
-    }
-
-    private int scopeCount(List<ProgressMessage> prgs, String scope) {
-        int result = 0;
-        for (ProgressMessage prg : prgs) {
-            if (scope.equals(prg.getScope())) {
-                result++;
-            }
-        }
-        return result;
-    }
-
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/progress/ProgressStatusFailTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/progress/ProgressStatusFailTest.java
deleted file mode 100644
index 7f04b89..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/progress/ProgressStatusFailTest.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.progress;
-
-import java.util.List;
-import org.testng.annotations.Test;
-import static org.glassfish.tests.utils.NucleusTestUtils.*;
-import static org.testng.AssertJUnit.*;
-
-/**
- *
- * @author martinmares
- */
-@Test(testName="ProgressStatusFailTest")
-public class ProgressStatusFailTest {
-
-    public void failDuringExecution() {
-        NadminReturn result = nadminWithOutput("progress-fail-in-half");
-        assertFalse(result.returnValue);
-        List<ProgressMessage> prgs = ProgressMessage.grepProgressMessages(result.out);
-        assertFalse(prgs.isEmpty());
-        assertEquals(50, prgs.get(prgs.size() - 1).getValue());
-    }
-
-    public void timeout() {
-        NadminReturn result = nadminWithOutput(6 * 1000, "progress-custom", "3x1", "1x8", "2x1");
-        assertFalse(result.returnValue);
-        List<ProgressMessage> prgs = ProgressMessage.grepProgressMessages(result.out);
-        assertFalse(prgs.isEmpty());
-        assertEquals(50, prgs.get(prgs.size() - 1).getValue());
-    }
-
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/progress/ProgressStatusSpecialTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/progress/ProgressStatusSpecialTest.java
deleted file mode 100644
index 5d4063d..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/progress/ProgressStatusSpecialTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.progress;
-
-import java.util.Iterator;
-import java.util.List;
-import static org.glassfish.tests.utils.NucleusTestUtils.*;
-import static org.testng.AssertJUnit.*;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author martinmares
- */
-@Test(testName="ProgressStatusSpecialTest")
-public class ProgressStatusSpecialTest {
-
-    public void stepBackCommand() {
-        NadminReturn result = nadminWithOutput("progress-step-back");
-        assertTrue(result.returnValue);
-        List<ProgressMessage> prgs = ProgressMessage.grepProgressMessages(result.out);
-        assertFalse(ProgressMessage.isNonDecreasing(prgs));
-        Iterator<ProgressMessage> itr = prgs.iterator();
-        while (itr.hasNext()) {
-            ProgressMessage prg = itr.next();
-            if (prg.getValue() >= 80) {
-                break;
-            }
-        }
-        assertTrue(itr.hasNext()); //Exist more record
-        while (itr.hasNext()) {
-            ProgressMessage prg = itr.next();
-            assertTrue(prg.getValue() <= 80);
-            if (prg.getValue() < 80) {
-                break;
-            }
-        }
-        assertTrue(itr.hasNext()); //Exist more record
-        ProgressMessage prg = itr.next();
-        assertTrue(prg.getValue() < 80);
-    }
-
-    public void doubleTotalCommand() {
-        NadminReturn result = nadminWithOutput("progress-double-totals");
-        assertTrue(result.returnValue);
-        List<ProgressMessage> prgs = ProgressMessage.grepProgressMessages(result.out);
-        assertFalse(ProgressMessage.isNonDecreasing(prgs));
-    }
-
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/ApplicationTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/ApplicationTest.java
deleted file mode 100644
index 508d122..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/ApplicationTest.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.rest;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-import jakarta.ws.rs.core.Response;
-import static org.testng.AssertJUnit.*;
-import org.testng.annotations.Test;
-/**
- *
- * @author jasonlee
- */
-public class ApplicationTest extends RestTestBase {
-    public static final String BASE_JDBC_RESOURCE_URL = "/domain/resources/jdbc-resource";
-    public static final String URL_APPLICATION_DEPLOY = "/domain/applications/application";
-    public static final String URL_CODI_SAMPLE = "http://java.net/jira/secure/attachment/44850/GlassfishIssues.war";
-    public static final String URL_CREATE_INSTANCE = "/domain/create-instance";
-
-    @Test(enabled=false)
-    public void testApplicationDeployment() throws URISyntaxException {
-        final String appName = "testApp" + generateRandomString();
-
-        try {
-            Map<String, String> deployedApp = deployApp(getFile("test.war"), appName, appName);
-            assertEquals(appName, deployedApp.get("name"));
-
-            assertEquals("/" + appName, deployedApp.get("contextRoot"));
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        } finally {
-            undeployApp(appName);
-        }
-    }
-
-//    @Test(enabled=false)
-    public void deployCodiApp() throws URISyntaxException, MalformedURLException, IOException {
-        try {
-            final String appName = "testApp" + generateRandomString();
-
-            Map<String, String> params = new HashMap<String, String>();
-            params.put("name", "CloudBeesDS");
-            params.put("poolName", "DerbyPool");
-
-            Response response = post (BASE_JDBC_RESOURCE_URL, params);
-            assertTrue(isSuccess(response));
-
-            Map<String, String> deployedApp = deployApp(downloadFile(new URL(URL_CODI_SAMPLE)), appName, appName);
-            assertEquals(appName, deployedApp.get("name"));
-
-            assertEquals("/" + appName, deployedApp.get("contextRoot"));
-
-            undeployApp(appName);
-        } finally {
-            delete(BASE_JDBC_RESOURCE_URL + "/CloudBeesDS");
-        }
-    }
-
-    @Test(enabled=false)
-    public void testApplicationDisableEnable() throws URISyntaxException {
-        final String appName = "testApp" + generateRandomString();
-
-        Map<String, String> deployedApp = deployApp(getFile("test.war"), appName, appName);
-        assertEquals(appName, deployedApp.get("name"));
-
-        assertEquals("/" + appName, deployedApp.get("contextRoot"));
-
-        try {
-            String appUrl = "http://localhost:" + instancePort + "/" + appName;
-            Response response = get(appUrl);
-            assertEquals ("Test", response.readEntity(String.class).trim());
-
-            response = post(URL_APPLICATION_DEPLOY + "/" + appName + "/disable");
-            checkStatusForSuccess(response);
-
-            response = get(appUrl);
-            assertFalse("Response was " + response.getStatus(), isSuccess(response));
-
-            response = post(URL_APPLICATION_DEPLOY + "/" + appName + "/enable");
-            checkStatusForSuccess(response);
-
-            response = get(appUrl);
-            assertEquals ("Test", response.readEntity(String.class).trim());
-        } finally {
-            undeployApp(appName);
-        }
-    }
-
-    @Test(enabled=false)
-    public void listSubComponents() throws URISyntaxException {
-        final String appName = "testApp" + generateRandomString();
-
-        try {
-            deployApp(getFile("stateless-simple.ear"), appName, appName);
-            Response response = get(URL_APPLICATION_DEPLOY +"/" + appName + "/list-sub-components?id=" + appName);
-            checkStatusForSuccess(response);
-            String subComponents = response.readEntity(String.class);
-            assertTrue(subComponents.contains("stateless-simple.war"));
-
-            response = get(URL_APPLICATION_DEPLOY +"/" + appName + "/list-sub-components?id=stateless-simple.war&appname=" + appName);
-            checkStatusForSuccess(response);
-            subComponents = response.readEntity(String.class);
-            assertTrue(subComponents.contains("GreeterServlet"));
-        } finally {
-            undeployApp(appName);
-        }
-    }
-
-    @Test(enabled=false)
-    public void testCreatingAndDeletingApplicationRefs() throws URISyntaxException {
-        final String instanceName = "instance_" + generateRandomString();
-        final String appName = "testApp" + generateRandomString();
-        final String appRefUrl = "/domain/servers/server/" + instanceName + "/application-ref";
-
-        Map<String, String> newInstance = new HashMap<String, String>() {{
-            put("id", instanceName);
-            put("node", "localhost-domain1");
-        }};
-        Map<String, String> applicationRef = new HashMap<String, String>() {{
-            put("id", appName);
-            put("target", instanceName);
-        }};
-
-        try {
-            Response response = post(URL_CREATE_INSTANCE, newInstance);
-            checkStatusForSuccess(response);
-
-            deployApp(getFile("test.war"), appName, appName);
-
-            response = post (appRefUrl, applicationRef);
-            checkStatusForSuccess(response);
-
-            response = get(appRefUrl + "/" + appName);
-            checkStatusForSuccess(response);
-
-            response = delete(appRefUrl + "/" + appName, new HashMap<String, String>() {{ put("target", instanceName); }});
-            checkStatusForSuccess(response);
-        } finally {
-            Response response = delete("/domain/servers/server/" + instanceName + "/delete-instance");
-            checkStatusForSuccess(response);
-            response = get("/domain/servers/server/" + instanceName);
-            assertFalse(isSuccess(response));
-            undeployApp(appName);
-        }
-    }
-
-    @Test(enabled=false)
-    public void testGetContextRoot() throws URISyntaxException {
-        final String appName = "testApp" + generateRandomString();
-
-        try {
-            Map<String, String> deployedApp = deployApp(getFile("stateless-simple.ear"), appName, appName);
-            assertEquals(appName, deployedApp.get("name"));
-            Map<String, String> contextRootPayload = new HashMap<String, String>() {{
-                put("appname", appName);
-                put("modulename", "stateless-simple.war");
-            }};
-
-            Response response = get("/domain/applications/application/" +appName + "/get-context-root", contextRootPayload);
-            checkStatusForSuccess(response);
-            assertTrue(response.readEntity(String.class).contains("helloworld"));
-        } finally {
-            undeployApp(appName);
-        }
-    }
-
-//    @Test(enabled=false)
-    public void testUndeploySubActionWarnings() throws URISyntaxException {
-        final String appName = "testApp" + generateRandomString();
-        final String serverName = "in" + generateRandomNumber();
-        try {
-            Response response = post ("/domain/create-instance", new HashMap<String, String>() {{
-                put("id", serverName);
-                put("node", "localhost-domain1");
-            }});
-            checkStatusForSuccess(response);
-
-            response = post("/domain/servers/server/" + serverName + "/start-instance");
-            checkStatusForSuccess(response);
-
-            deployApp(getFile("test.war"), appName, appName);
-            addAppRef(appName, serverName);
-
-            response = post("/domain/servers/server/" + serverName + "/stop-instance");
-            checkStatusForSuccess(response);
-
-            response = delete ("/domain/applications/application/"+appName, new HashMap<String, String>() {{
-                put("target", "domain");
-            }});
-            assertTrue(response.readEntity(String.class).contains("WARNING: Instance " + serverName + " seems to be offline"));
-        } finally {
-            delete ("/domain/applications/application/" + appName, new HashMap<String, String>() {{
-                put("target", "domain");
-            }});
-        }
-    }
-
-    protected File getFile(String fileName) throws URISyntaxException {
-        final URL resource = getClass().getResource("/" + fileName);
-        return new File(resource.toURI());
-    }
-
-    protected File downloadFile(URL url) throws IOException {
-        String urlText = url.getFile();
-        String fileName = urlText.substring(urlText.lastIndexOf("/")+1);
-        File file = new File(fileName);
-        file.deleteOnExit();
-        BufferedInputStream in = new BufferedInputStream(url.openStream());
-        FileOutputStream fos = new FileOutputStream(file);
-        BufferedOutputStream bout = new BufferedOutputStream(fos, 1024);
-        byte data[] = new byte[8192];
-        int read = in.read(data, 0, 8192);
-        while (read >= 0) {
-            bout.write(data, 0, read);
-            data = new byte[8192];
-            read = in.read(data, 0, 8192);
-        }
-        bout.close();
-        in.close();
-
-        return file;
-    }
-
-    public Map<String, String> deployApp (final String fileName, final String contextRoot, final String name) throws URISyntaxException {
-        return deployApp(getFile(fileName), contextRoot, name);
-    }
-
-    public Map<String, String> deployApp (final File archive, final String contextRoot, final String name) {
-        Map<String, Object> app = new HashMap<String, Object>() {{
-            put("id", archive);
-            put("contextroot", contextRoot);
-            put("name", name);
-        }};
-
-        Response response = postWithUpload(URL_APPLICATION_DEPLOY, app);
-        checkStatusForSuccess(response);
-
-        return getEntityValues(get(URL_APPLICATION_DEPLOY + "/" + app.get("name")));
-    }
-
-    public void addAppRef(final String applicationName, final String targetName){
-        Response cr = post("/domain/servers/server/" + targetName + "/application-ref", new HashMap<String,String>() {{
-            put("id", applicationName);
-            put("target", targetName);
-        }});
-        checkStatusForSuccess(cr);
-    }
-
-    public Response undeployApp(String appName) {
-        Response response = delete(URL_APPLICATION_DEPLOY + "/" + appName);
-        checkStatusForSuccess(response);
-
-        return response;
-    }
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/AuthRealmTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/AuthRealmTest.java
deleted file mode 100644
index 47d11bf..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/AuthRealmTest.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.rest;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import jakarta.ws.rs.core.Response;
-import org.glassfish.admin.rest.client.utils.MarshallingUtils;
-import static org.testng.AssertJUnit.*;
-import org.testng.annotations.Test;
-
-public class AuthRealmTest extends RestTestBase {
-    public static final String URL_LIST_GROUP_NAMES = "/domain/configs/config/server-config/security-service/auth-realm/admin-realm/list-group-names";
-    public static final String URL_SUPPORTS_USER_MANAGEMENT = "/domain/configs/config/server-config/security-service/auth-realm/admin-realm/supports-user-management";
-    public static final String URL_LIST_ADMIN_REALM_USERS = "/domain/configs/config/server-config/security-service/auth-realm/admin-realm/list-users";
-    public static final String URL_LIST_FILE_USERS = "/domain/configs/config/server-config/security-service/auth-realm/file/list-users";
-    public static final String URL_CREATE_USER = "/domain/configs/config/server-config/security-service/auth-realm/file/create-user";
-    public static final String URL_DELETE_USER = "/domain/configs/config/server-config/security-service/auth-realm/file/delete-user";
-    public static final String URL_AUTH_REALM_CLASS_NAMES = "/domain/list-predefined-authrealm-classnames";
-
-    // Disable this test for now...
-//    @Test
-    public void testListGroupNames() {
-        Response response = get(URL_LIST_GROUP_NAMES, new HashMap<String, String>() {{
-            put("userName", "admin");
-            put("realmName", "admin-realm");
-        }});
-        checkStatusForSuccess(response);
-        final String entity = response.readEntity(String.class);
-        Map responseMap = MarshallingUtils.buildMapFromDocument(entity);
-        Map extraProperties = (Map)responseMap.get("extraProperties");
-        List<String> groups = (List<String>)extraProperties.get("groups");
-
-        assertTrue(groups.size() > 0);
-    }
-
-    @Test
-    public void testSupportsUserManagement() {
-        List<String> groups = getCommandResults(get(URL_SUPPORTS_USER_MANAGEMENT));
-        assertEquals("true", groups.get(0));
-    }
-
-//    @Test
-    public void testUserManagement() {
-        final String userName = "user" + generateRandomString();
-        Map<String, String> newUser = new HashMap<String, String>() {{
-           put ("id", userName);
-           put ("AS_ADMIN_USERPASSWORD", "password");
-        }};
-
-        Response response = post(URL_CREATE_USER, newUser);
-        assertTrue(isSuccess(response));
-
-        List<String> values = getCommandResults(get(URL_LIST_FILE_USERS));
-        assertTrue(values.contains(userName));
-
-        response = delete(URL_DELETE_USER, newUser);
-        assertTrue(isSuccess(response));
-
-        values = getCommandResults(get(URL_LIST_FILE_USERS));
-        assertFalse(values.contains(userName));
-    }
-
-    @Test
-    public void testListAuthRealmClassNames() {
-        List<String> classNameList = getCommandResults(get(URL_AUTH_REALM_CLASS_NAMES));
-        assertTrue(!classNameList.isEmpty());
-    }
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/ClusterTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/ClusterTest.java
deleted file mode 100644
index 7fef091..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/ClusterTest.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.rest;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import jakarta.ws.rs.core.Response;
-import org.glassfish.admin.rest.client.utils.MarshallingUtils;
-import static org.testng.AssertJUnit.*;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author jasonlee
- */
-public class ClusterTest extends RestTestBase {
-    public static final String URL_CLUSTER = "/domain/clusters/cluster";
-
-    @Test
-    public void testClusterCreationAndDeletion() {
-        final String clusterName = "cluster_" + generateRandomString();
-        createCluster(clusterName);
-
-        Map<String, String> entity = getEntityValues(get(URL_CLUSTER + "/" + clusterName));
-        assertEquals(clusterName + "-config", entity.get("configRef"));
-
-        deleteCluster(clusterName);
-    }
-
-    @Test
-    public void testListLifecycleModules() {
-        final String clusterName = "cluster_" + generateRandomString();
-        Map<String, String> newCluster = new HashMap<String, String>() {
-            {
-                put("id", clusterName);
-            }
-        };
-
-        Response response = post(URL_CLUSTER, newCluster);
-        checkStatusForSuccess(response);
-
-        response = get(URL_CLUSTER + "/" + clusterName + "/list-lifecycle-modules");
-        checkStatusForSuccess(response);
-
-        response = delete(URL_CLUSTER + "/" + clusterName); // + "/delete-cluster");
-        checkStatusForSuccess(response);
-
-        response = get(URL_CLUSTER + "/" + clusterName);
-        checkStatusForFailure(response);
-
-    }
-
-    public String createCluster() {
-        final String clusterName = "cluster_" + generateRandomString();
-        createCluster(clusterName);
-
-        return clusterName;
-    }
-
-    public void createCluster(final String clusterName) {
-        Map<String, String> newCluster = new HashMap<String, String>() {
-            {
-                put("id", clusterName);
-            }
-        };
-
-        Response response = post(URL_CLUSTER, newCluster);
-        checkStatusForSuccess(response);
-    }
-
-    public void startCluster(String clusterName) {
-        Response response = post(URL_CLUSTER + "/" + clusterName + "/start-cluster");
-        checkStatusForSuccess(response);
-    }
-
-    public void stopCluster(String clusterName) {
-        Response response = post(URL_CLUSTER + "/" + clusterName + "/stop-cluster");
-        checkStatusForSuccess(response);
-    }
-
-    public void createClusterInstance(final String clusterName, final String instanceName) {
-        Response response = post("/domain/create-instance", new HashMap<String, String>() {
-            {
-                put("cluster", clusterName);
-                put("id", instanceName);
-                put("node", "localhost-domain1");
-            }
-        });
-        checkStatusForSuccess(response);
-    }
-
-    public void deleteCluster(String clusterName) {
-        Response response = get(URL_CLUSTER + "/" + clusterName + "/list-instances");
-        Map body = MarshallingUtils.buildMapFromDocument(response.readEntity(String.class));
-        Map extraProperties = (Map) body.get("extraProperties");
-        if (extraProperties != null) {
-            List<Map<String, String>> instanceList = (List<Map<String, String>>) extraProperties.get("instanceList");
-            if ((instanceList != null) && (!instanceList.isEmpty())) {
-                for (Map<String, String> instance : instanceList) {
-                    String status = instance.get("status");
-                    String instanceName = instance.get("name");
-                    if (!"NOT_RUNNING".equalsIgnoreCase(status)) {
-                        response = post("/domain/servers/server/" + instanceName + "/stop-instance");
-                        checkStatusForSuccess(response);
-                    }
-                    response = delete("/domain/servers/server/" + instanceName + "/delete-instance");
-                    checkStatusForSuccess(response);
-                }
-            }
-        }
-
-
-        response = delete(URL_CLUSTER + "/" + clusterName);// + "/delete-cluster");
-        checkStatusForSuccess(response);
-
-//        response = get(URL_CLUSTER + "/" + clusterName);
-//        checkStatusForFailure(response);
-    }
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/ConfigTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/ConfigTest.java
deleted file mode 100644
index ccd5edb..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/ConfigTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.rest;
-
-import jakarta.ws.rs.core.MultivaluedHashMap;
-import jakarta.ws.rs.core.MultivaluedMap;
-import jakarta.ws.rs.core.Response;
-import static org.testng.AssertJUnit.*;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author jasonlee
- */
-public class ConfigTest extends RestTestBase {
-
-    public static final String BASE_CONFIGS_URL = "/domain/configs";
-
-    @Test
-    public void testConfigCopy() {
-        String configName = "config-" + generateRandomString();
-        MultivaluedMap formData = new MultivaluedHashMap();
-        formData.add("id", "default-config");
-        formData.add("id", configName);
-        createAndVerifyConfig(configName, formData);
-        deleteAndVerifyConfig(configName);
-    }
-
-    @Test
-    public void duplicateCopyShouldFail() {
-        MultivaluedMap formData = new MultivaluedHashMap();
-        formData.add("id", "default-config");
-        formData.add("id", "server-config");
-
-        Response response = post(BASE_CONFIGS_URL + "/copy-config", formData);
-        assertFalse(isSuccess(response));
-    }
-
-    public void createAndVerifyConfig(String configName, MultivaluedMap configData) {
-        Response response = post(BASE_CONFIGS_URL + "/copy-config", configData);
-        checkStatusForSuccess(response);
-
-        response = get(BASE_CONFIGS_URL + "/config/" + configName);
-        checkStatusForSuccess(response);
-    }
-
-    public void deleteAndVerifyConfig(String configName) {
-        Response response = post(BASE_CONFIGS_URL + "/config/" + configName + "/delete-config");
-        checkStatusForSuccess(response);
-
-        response = get(BASE_CONFIGS_URL + "/config/" + configName);
-        assertFalse(isSuccess(response));
-    }
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/DomainTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/DomainTest.java
deleted file mode 100644
index 7e2ebbb..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/DomainTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.rest;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-import jakarta.ws.rs.core.Response;
-import static org.testng.AssertJUnit.*;
-import org.testng.annotations.Test;
-
-public class DomainTest extends RestTestBase {
-    @Test
-    public void testDomainGet() throws IOException {
-        Map payload = new HashMap();
-        Map<String, String> current = getEntityValues(get("/domain"));
-
-        // Select a random locale so we're not setting the locale to its current value
-        List<String> locales = new ArrayList<String>() {{
-            add("en_US");
-            add("en");
-            add("de_DE");
-            add("_GB");
-            add("en_US_WIN");
-            add("de__POSIX");
-            add("fr__MAC");
-        }};
-        locales.remove(current.get("locale"));
-        final int random = new Random().nextInt(locales.size());
-        String newLocale = locales.get(random);
-
-        payload.put("locale", newLocale);
-
-        Response response = post("/domain", payload);
-        assertTrue(isSuccess(response));
-
-        // Reload the domain and make sure our new locale was saved
-        Map<String, String> map = getEntityValues(this.get("/domain"));
-        assertEquals(newLocale, map.get("locale"));
-    }
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/ElementStarTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/ElementStarTest.java
deleted file mode 100644
index b5bd9bc..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/ElementStarTest.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.rest;
-
-import java.net.URISyntaxException;
-import java.util.HashMap;
-import java.util.Map;
-import jakarta.ws.rs.core.Response;
-import static org.testng.AssertJUnit.*;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-/**
- * This class tests the changes to the handling of @Element("*") instances
- * @author jasonlee
- */
-public class ElementStarTest extends RestTestBase {
-    protected static final String URL_CREATE_INSTANCE = "/domain/create-instance";
-
-    protected String instanceName1;
-    protected String instanceName2;
-
-    @BeforeMethod
-    public void before() {
-        instanceName1 = "instance_" + generateRandomString();
-        instanceName2 = "instance_" + generateRandomString();
-
-        Response response = post(URL_CREATE_INSTANCE, new HashMap<String, String>() {{ put("id", instanceName1); put("node", "localhost-domain1"); }});
-        checkStatusForSuccess(response);
-        response = post(URL_CREATE_INSTANCE, new HashMap<String, String>() {{ put("id", instanceName2); put("node", "localhost-domain1"); }});
-        checkStatusForSuccess(response);
-    }
-
-    @AfterMethod
-    public void after() {
-        Response response = delete("/domain/servers/server/" + instanceName1 + "/delete-instance"); // TODO: This url should be fixed
-        checkStatusForSuccess(response);
-        response = delete("/domain/servers/server/" + instanceName2 + "/delete-instance");
-        checkStatusForSuccess(response);
-    }
-
-    @Test(enabled=false)
-    public void testApplications() throws URISyntaxException {
-        ApplicationTest at = getTestClass(ApplicationTest.class);
-        final String app1 = "app" + generateRandomString();
-        final String app2 = "app" + generateRandomString();
-
-        at.deployApp("test.war", app1, app1);
-        at.deployApp("test.war", app2, app2);
-        at.addAppRef(app1, instanceName1);
-        at.addAppRef(app2, instanceName1);
-
-        Response response = get("/domain/servers/server/"+instanceName1+"/application-ref");
-        Map<String, String> children = this.getChildResources(response);
-        assertEquals(2, children.size());
-    }
-
-    @Test
-    public void testResources() {
-        // The DAS should already have two resource-refs (jdbc/__TimerPool and jdbc/__default)
-        Response response = get ("/domain/servers/server/server/resource-ref");
-        Map<String, String> children = this.getChildResources(response);
-        assertTrue(children.size() >= 2);
-    }
-
-    @Test(enabled=false)
-    public void testLoadBalancerConfigs() {
-        final String lbName = "lbconfig-" + generateRandomString();
-        Response response = post ("/domain/lb-configs/lb-config/",
-                new HashMap<String, String>() {{
-                    put("id", lbName);
-                    put("target", instanceName1);
-                }});
-        checkStatusForSuccess(response);
-
-        response = post("/domain/lb-configs/lb-config/" + lbName + "/create-http-lb-ref",
-                new HashMap<String,String>() {{
-                    put ("id", instanceName2);
-                }});
-        checkStatusForSuccess(response);
-
-        response = get ("/domain/lb-configs/lb-config/" + lbName + "/server-ref");
-        Map<String, String> children = this.getChildResources(response);
-        assertTrue(!children.isEmpty());
-    }
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/ExceptionFilterTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/ExceptionFilterTest.java
deleted file mode 100644
index ef4a7e0..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/ExceptionFilterTest.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.glassfish.nucleus.admin.rest;
-
-import org.testng.annotations.Test;
-
-/**
- *
- * @author jdlee
- */
-@Test(enabled = false)
-public class ExceptionFilterTest {
-    public void testExceptionFiler() {
-        // TODO
-    }
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/ExternalResourceTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/ExternalResourceTest.java
deleted file mode 100644
index 7f93ef2..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/ExternalResourceTest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.rest;
-
-import java.util.HashMap;
-import java.util.Map;
-import jakarta.ws.rs.core.Response;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author jasonlee
- */
-public class ExternalResourceTest extends RestTestBase {
-    protected static final String URL_EXTERNAL_RESOURCE = "/domain/resources/external-jndi-resource";
-    @Test(enabled=false)
-    public void createAndDeleteExternalResource() {
-        final String resourceName = "resource_" + generateRandomString();
-        final String jndiName = "jndi/"+resourceName;
-        Map<String, String> newResource = new HashMap<String, String>() {{
-            put("id", resourceName);
-            put("jndilookupname", jndiName);
-            put("factoryClass", "org.glassfish.resources.custom.factory.PrimitivesAndStringFactory");
-            put("restype", "java.lang.Double");
-        }};
-        Response response = post (URL_EXTERNAL_RESOURCE, newResource);
-        checkStatusForSuccess(response);
-
-        response = get(URL_EXTERNAL_RESOURCE + "/" + resourceName);
-        checkStatusForSuccess(response);
-
-        response = delete(URL_EXTERNAL_RESOURCE + "/" + resourceName);
-        checkStatusForSuccess(response);
-    }
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/JdbcTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/JdbcTest.java
deleted file mode 100644
index 188c9a9..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/JdbcTest.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.rest;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import jakarta.ws.rs.core.Response;
-import static org.testng.AssertJUnit.*;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author jasonlee
- */
-public class JdbcTest extends RestTestBase {
-    public static final String BASE_JDBC_RESOURCE_URL = "/domain/resources/jdbc-resource";
-    public static final String BASE_JDBC_CONNECTION_POOL_URL = "/domain/resources/jdbc-connection-pool";
-
-    @Test(enabled=false)
-    public void testReadingPoolEntity() {
-        Map<String, String> entity = getEntityValues(get(BASE_JDBC_CONNECTION_POOL_URL + "/__TimerPool"));
-        assertEquals("__TimerPool", entity.get("name"));
-    }
-
-    @Test(enabled=false)
-    public void testCreateAndDeletePool() {
-        String poolName = "TestPool" + generateRandomString();
-        Map<String, String> params = new HashMap<String, String>();
-        params.put("name", poolName);
-        params.put("datasourceClassname","org.apache.derby.jdbc.ClientDataSource");
-        Response response = post(BASE_JDBC_CONNECTION_POOL_URL, params);
-        assertTrue(isSuccess(response));
-
-        Map<String, String> entity = getEntityValues(get(BASE_JDBC_CONNECTION_POOL_URL + "/"+poolName));
-        assertNotSame(0, entity.size());
-
-        response = delete(BASE_JDBC_CONNECTION_POOL_URL+"/"+poolName, new HashMap<String, String>());
-        assertTrue(isSuccess(response));
-
-        response = get(BASE_JDBC_CONNECTION_POOL_URL + "/" + poolName);
-        assertEquals(404, response.getStatus());
-    }
-
-//    @Test(enabled=false)
-    // TODO: Disabled until 13348 is resolved
-    public void testCreateResourceWithBackslash() {
-        String poolName = "TestPool\\" + generateRandomString();
-        String encodedPoolName = poolName;
-        try {
-            encodedPoolName = URLEncoder.encode(poolName, "UTF-8");
-        } catch (UnsupportedEncodingException ex) {
-            Logger.getLogger(JdbcTest.class.getName()).log(Level.SEVERE, null, ex);
-        }
-        Map<String, String> params = new HashMap<String, String>();
-        params.put("name", poolName);
-        params.put("poolName", "DerbyPool");
-
-        Response response = post (BASE_JDBC_RESOURCE_URL, params);
-        assertTrue(isSuccess(response));
-
-        Map<String, String> entity = getEntityValues(get(BASE_JDBC_CONNECTION_POOL_URL + "/" + encodedPoolName));
-        assertNotSame(0, entity.size());
-
-        response = delete("/" + encodedPoolName, new HashMap<String, String>());
-        assertTrue(isSuccess(response));
-
-        response = get(BASE_JDBC_CONNECTION_POOL_URL + "/" + encodedPoolName);
-        assertEquals(404, response.getStatus());
-    }
-
-    @Test(enabled=false)
-    public void createDuplicateResource() {
-        final String resourceName = "jdbc/__default";
-        Map<String, String> params = new HashMap<String, String>() {{
-           put("id", resourceName);
-           put("poolName", "DerbyPool");
-        }};
-
-        Response response = post (BASE_JDBC_RESOURCE_URL, params);
-        assertFalse(isSuccess(response));
-    }
-
-    @Test(enabled=false)
-    public void createDuplicateConnectionPool() {
-        final String poolName = "DerbyPool";
-        Map<String, String> params = new HashMap<String, String>() {{
-           put("id", poolName);
-           put("datasourceClassname", "org.apache.derby.jdbc.ClientDataSource");
-        }};
-
-        Response response = post (BASE_JDBC_CONNECTION_POOL_URL, params);
-        assertFalse(isSuccess(response));
-    }
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/JmsTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/JmsTest.java
deleted file mode 100644
index 0712cbc..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/JmsTest.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- * Copyright (c) 2010, 2020 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.rest;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.util.HashMap;
-import java.util.Map;
-import jakarta.ws.rs.core.Response;
-import static org.testng.AssertJUnit.*;
-import org.testng.annotations.Test;
-
-/**
- * Created by IntelliJ IDEA.
- * User: jasonlee
- * Date: May 26, 2010
- * Time: 2:28:27 PM
- * To change this template use File | Settings | File Templates.
- */
-public class JmsTest extends RestTestBase {
-    static final String URL_ADMIN_OBJECT_RESOURCE = "/domain/resources/admin-object-resource";
-    static final String URL_CONNECTOR_CONNECTION_POOL = "/domain/resources/connector-connection-pool";
-    static final String URL_CONNECTOR_RESOURCE = "/domain/resources/connector-resource";
-    static final String URL_JMS_HOST = "/domain/configs/config/server-config/jms-service/jms-host";
-    static final String URL_SEVER_JMS_DEST = "/domain/servers/server/server";
-    static final String DEST_TYPE = "topic";
-
-    @Test(enabled=false)
-    public void testJmsConnectionFactories() {
-        final String poolName = "JmsConnectionFactory" + generateRandomString();
-        Map<String, String> ccp_attrs = new HashMap<String, String>() {
-            {
-                put("name", poolName);
-                put("connectiondefinition", "jakarta.jms.ConnectionFactory");
-                put("raname", "jmsra");
-            }
-        };
-        Map<String, String> cr_attrs = new HashMap<String, String>() {
-            {
-                put("id", poolName);
-                put("poolname", poolName);
-            }
-        };
-
-        // Create connection pool
-        Response response = post(URL_CONNECTOR_CONNECTION_POOL, ccp_attrs);
-        checkStatusForSuccess(response);
-
-        // Check connection pool creation
-        Map<String, String> pool = getEntityValues(get(URL_CONNECTOR_CONNECTION_POOL + "/" + poolName));
-        assertFalse(pool.isEmpty());
-
-        // Create connector resource
-        response = post(URL_CONNECTOR_RESOURCE, cr_attrs);
-        checkStatusForSuccess(response);
-
-        // Check connector resource
-        Map<String, String> resource = getEntityValues(get(URL_CONNECTOR_RESOURCE + "/" + poolName));
-        assertFalse(resource.isEmpty());
-
-        // Edit and check ccp
-        response = post(URL_CONNECTOR_CONNECTION_POOL + "/" + poolName, new HashMap<String, String>() {
-            {
-                put("description", poolName);
-            }
-        });
-        checkStatusForSuccess(response);
-
-        pool = getEntityValues(get(URL_CONNECTOR_CONNECTION_POOL + "/" + poolName));
-        assertTrue(pool.get("description").equals(poolName));
-
-        // Edit and check cr
-        response = post(URL_CONNECTOR_RESOURCE + "/" + poolName, new HashMap<String, String>() {
-            {
-                put("description", poolName);
-            }
-        });
-        checkStatusForSuccess(response);
-
-        resource = getEntityValues(get(URL_CONNECTOR_RESOURCE + "/" + poolName));
-        assertTrue(pool.get("description").equals(poolName));
-
-        // Delete objects
-        response = delete(URL_CONNECTOR_CONNECTION_POOL + "/" + poolName, new HashMap<String, String>() {
-            {
-                put("cascade", "true");
-            }
-        });
-        checkStatusForSuccess(response);
-    }
-
-    @Test(enabled=false)
-    public void testJmsDestinationResources() {
-        final String jndiName = "jndi/" + generateRandomString();
-        String encodedJndiName = jndiName;
-        try {
-            encodedJndiName = URLEncoder.encode(jndiName, "UTF-8");
-        } catch (UnsupportedEncodingException e) {
-        }
-
-        Map<String, String> attrs = new HashMap<String, String>() {
-            {
-                put("id", jndiName);
-                put("raname", "jmsra");
-                put("restype", "jakarta.jms.Topic");
-            }
-        };
-
-        Response response = post(URL_ADMIN_OBJECT_RESOURCE, attrs);
-        checkStatusForSuccess(response);
-
-        Map<String, String> entity = getEntityValues(get(URL_ADMIN_OBJECT_RESOURCE + "/" + encodedJndiName));
-        assertFalse(entity.isEmpty());
-
-        response = delete(URL_ADMIN_OBJECT_RESOURCE + "/" + encodedJndiName);
-        checkStatusForSuccess(response);
-    }
-
-    @Test(enabled=false)
-    public void testJmsPhysicalDestination() {
-        final String destName = "jmsDest" + generateRandomString();
-        final int maxNumMsgs = generateRandomNumber(500);
-        final int consumerFlowLimit = generateRandomNumber(500);
-
-        createJmsPhysicalDestination(destName, DEST_TYPE, URL_SEVER_JMS_DEST);
-
-        final HashMap<String, String> newDest = new HashMap<String, String>() {
-            {
-                put("id", destName);
-                put("desttype", DEST_TYPE);
-            }
-        };
-        Map<String, String> destProps = new HashMap<String, String>() {
-            {
-                putAll(newDest);
-                put("property", "MaxNumMsgs=" + maxNumMsgs + ":ConsumerFlowLimit=" + consumerFlowLimit);
-            }
-        };
-
-        Response response = get(URL_SEVER_JMS_DEST + "/__get-jmsdest", newDest);
-        checkStatusForSuccess(response);
-
-        response = post(URL_SEVER_JMS_DEST + "/__update-jmsdest", destProps);
-        checkStatusForSuccess(response);
-        response = get(URL_SEVER_JMS_DEST + "/__get-jmsdest", newDest);
-        checkStatusForSuccess(response);
-        Map<String, String> entity = this.getEntityValues(response);
-        assertEquals(maxNumMsgs, entity.get("MaxNumMsgs"));
-        assertEquals(consumerFlowLimit, entity.get("ConsumerFlowLimit"));
-
-        deleteJmsPhysicalDestination(destName, URL_SEVER_JMS_DEST);
-    }
-
-    @Test(enabled=false)
-    public void testJmsPhysicalDestionationsWithClusters() {
-        final String destName = "jmsDest" + generateRandomString();
-        ClusterTest ct = getTestClass(ClusterTest.class);
-        final String clusterName = ct.createCluster();
-        ct.createClusterInstance(clusterName, "in1_"+clusterName);
-        ct.startCluster(clusterName);
-        final String endpoint = "/domain/clusters/cluster/" + clusterName;
-        try {
-
-            createJmsPhysicalDestination(destName, "topic", endpoint);
-            final HashMap<String, String> newDest = new HashMap<String, String>() {
-                {
-                    put("id", destName);
-                    put("desttype", DEST_TYPE);
-                }
-            };
-
-            Response response = get(endpoint + "/__get-jmsdest", newDest);
-            checkStatusForSuccess(response);
-
-            response = get(URL_SEVER_JMS_DEST + "/__get-jmsdest", newDest);
-            checkStatusForFailure(response);
-        }
-        finally {
-            deleteJmsPhysicalDestination(destName, endpoint);
-            ct.stopCluster(clusterName);
-            ct.deleteCluster(clusterName);
-        }
-    }
-
-    @Test(enabled=false)
-    public void testJmsPing() {
-        String results = get(URL_SEVER_JMS_DEST + "/jms-ping").readEntity(String.class);
-        assertTrue(results.contains("JMS-ping command executed successfully"));
-    }
-
-    @Test(enabled=false)
-    public void testJmsFlush() {
-        Map<String, String> payload = new HashMap<String, String>() {
-            {
-                put("id", "mq.sys.dmq");
-                put("destType", "queue");
-            }
-        };
-
-        Response response = post(URL_SEVER_JMS_DEST + "/flush-jmsdest", payload);
-        checkStatusForSuccess(response);
-    }
-
-    @Test(enabled=false)
-    public void testJmsHosts() {
-        final String jmsHostName = "jmshost" + generateRandomString();
-        Map<String, String> newHost = new HashMap<String, String>() {
-            {
-                put("id", jmsHostName);
-                put("adminPassword", "admin");
-                put("port", "7676");
-                put("adminUserName", "admin");
-                put("host", "localhost");
-            }
-        };
-
-        // Test create
-        Response response = post(URL_JMS_HOST, newHost);
-        checkStatusForSuccess(response);
-
-        // Test edit
-        Map<String, String> entity = getEntityValues(get(URL_JMS_HOST + "/" + jmsHostName));
-        assertFalse(entity.isEmpty());
-        assertEquals(jmsHostName, entity.get("name"));
-        entity.put("port", "8686");
-        response = post(URL_JMS_HOST + "/" + jmsHostName, entity);
-        checkStatusForSuccess(response);
-        entity = getEntityValues(get(URL_JMS_HOST + "/" + jmsHostName));
-        assertEquals("8686", entity.get("port"));
-
-        // Test delete
-        response = delete(URL_JMS_HOST + "/" + jmsHostName);
-        checkStatusForSuccess(response);
-    }
-
-    public void createJmsPhysicalDestination(final String destName, final String type, String endpoint) {
-        final Map<String, String> newDest = new HashMap<String, String>() {
-            {
-                put("id", destName);
-                put("desttype", type);
-            }
-        };
-
-        // Test Create
-        Response response = post(endpoint + "/create-jmsdest", newDest);
-        // This command returns 200 instead of 201, for some reason.  Odd.
-        checkStatusForSuccess(response);
-    }
-
-    public void deleteJmsPhysicalDestination(final String destName, String endpoint) {
-        final HashMap<String, String> newDest = new HashMap<String, String>() {
-            {
-                put("id", destName);
-                put("desttype", DEST_TYPE);
-            }
-        };
-
-        // Test deletion
-        Response response = delete(endpoint + "/delete-jmsdest", newDest); // You POST to commands
-        checkStatusForSuccess(response);
-
-        response = get(endpoint + "__get-jmsdest", newDest);
-        assertFalse(response.getStatus() == 200);
-    }
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/JobsResourceTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/JobsResourceTest.java
deleted file mode 100644
index 249a2fe..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/JobsResourceTest.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.rest;
-
-import java.util.Locale;
-import jakarta.ws.rs.core.Response;
-import org.codehaus.jettison.json.JSONArray;
-import org.codehaus.jettison.json.JSONException;
-import org.codehaus.jettison.json.JSONObject;
-import org.glassfish.admin.rest.Constants;
-import org.glassfish.admin.rest.composite.CompositeUtil;
-import org.glassfish.admin.rest.resources.composite.Job;
-import static org.glassfish.tests.utils.NucleusTestUtils.nadminWithOutput;
-import static org.testng.AssertJUnit.*;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author jdlee
- */
-@Test(testName="JobsResourceTest")
-public class JobsResourceTest extends RestTestBase {
-    public static final String URL_JOBS = "/jobs";
-
-    public void testJobsListing() {
-        assertTrue(isSuccess(get(URL_JOBS)));
-    }
-
-    public void testGetJob() throws JSONException {
-        // make sure we have at least one job
-        issueDetachedCommand();
-
-        // verify getting the collection
-        Response response = get(URL_JOBS);
-        assertTrue(isSuccess(response));
-
-        // verify the overall structure
-        JSONObject json = response.readEntity(JSONObject.class);
-        JSONArray resources = json.getJSONArray("resources");
-        assertNotNull(resources);
-        assertTrue(resources.length() > 0);
-        JSONArray items = json.getJSONArray("items");
-        assertNotNull(items);
-        assertTrue(items.length() > 0);
-
-        // unlike most resources that also return a parent link,
-        // the jobs resource only returns child links.
-        // verify the first of them
-        JSONObject resource = resources.getJSONObject(0);
-        String uri = resource.getString("uri");
-        assertNotNull(uri);
-        assertEquals("job", resource.getString("rel"));
-        String jobId = resource.getString("title");
-        assertNotNull(jobId);
-        assertTrue(uri.endsWith(URL_JOBS + "/id/" + jobId));
-
-        // verify the job it refers to by following the link.
-        // it should only have a parent link
-        response = get(uri);
-        assertTrue(isSuccess(response));
-        json = response.readEntity(JSONObject.class);
-        JSONObject item = json.getJSONObject("item");
-        verifyItem(jobId, item);
-        resources = json.getJSONArray("resources");
-        assertNotNull(resources);
-        assertTrue(resources.length() == 1);
-        resource = resources.getJSONObject(0);
-        assertEquals("parent", resource.getString("rel"));
-        assertTrue(resource.getString("uri").endsWith(URL_JOBS));
-
-        // verify that the collection returned the item too
-        item = null;
-        for (int i = 0; item == null && i < items.length(); i++) {
-            JSONObject thisItem = items.getJSONObject(i);
-            if (jobId.equals(thisItem.getString("jobId"))) {
-                item = thisItem;
-            }
-        }
-        verifyItem(jobId, item);
-    }
-
-    private void verifyItem(String jobIdWant, JSONObject itemHave) throws JSONException {
-        assertNotNull(itemHave);
-        Locale locale = null;
-        Job job = CompositeUtil.instance().unmarshallClass(locale, Job.class, itemHave);
-        assertNotNull(job);
-        assertEquals(jobIdWant, job.getJobId());
-    }
-
-    private void issueDetachedCommand() {
-        nadminWithOutput("--detach", "uptime");
-    }
-
-    @Override
-    protected String getResponseType() {
-        return Constants.MEDIA_TYPE_JSON;
-    }
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/JvmOptionsTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/JvmOptionsTest.java
deleted file mode 100644
index 95fb0ae..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/JvmOptionsTest.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.rest;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import jakarta.ws.rs.core.MultivaluedHashMap;
-import jakarta.ws.rs.core.MultivaluedMap;
-import jakarta.ws.rs.core.Response;
-import org.glassfish.admin.rest.client.utils.MarshallingUtils;
-import static org.testng.AssertJUnit.*;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author jasonlee
- */
-public class JvmOptionsTest extends RestTestBase {
-    protected static final String URL_SERVER_JVM_OPTIONS = "/domain/configs/config/server-config/java-config/jvm-options";
-    protected static final String URL_DEFAULT_JVM_OPTIONS = "/domain/configs/config/default-config/java-config/jvm-options";
-
-    protected static final String URL_SERVER_CONFIG_CREATE_PROFILER = "/domain/configs/config/server-config/java-config/create-profiler";
-    protected static final String URL_SERVER_CONFIG_DELETE_PROFILER = "/domain/configs/config/server-config/java-config/profiler/delete-profiler";
-    protected static final String URL_SERVER_CONFIG_PROFILER_JVM_OPTIONS = "/domain/configs/config/server-config/java-config/profiler/jvm-options";
-
-    protected static final String URL_DEFAULT_CONFIG_CREATE_PROFILER = "/domain/configs/config/default-config/java-config/create-profiler";
-    protected static final String URL_DEFAULT_CONFIG_DELETE_PROFILER = "/domain/configs/config/default-config/java-config/profiler/delete-profiler";
-    protected static final String URL_DEFAULT_CONFIG_PROFILER_JVM_OPTIONS = "/domain/configs/config/default-config/java-config/profiler/jvm-options";
-
-    private ConfigTest configTest;
-    private String testConfigName;
-    private String URL_TEST_CONFIG;
-    private String URL_TEST_CONFIG_JVM_OPTIONS;
-
-    @BeforeMethod
-    public void createConfig() {
-        if (configTest == null) {
-            configTest = getTestClass(ConfigTest.class);
-        }
-
-        testConfigName = "config-" + generateRandomString();
-        MultivaluedMap formData = new MultivaluedHashMap() {{
-            add("id", "default-config");
-            add("id", testConfigName);
-        }};
-        configTest.createAndVerifyConfig(testConfigName, formData);
-
-        URL_TEST_CONFIG = "/domain/configs/config/" + testConfigName;
-        URL_TEST_CONFIG_JVM_OPTIONS = URL_TEST_CONFIG + "/java-config/jvm-options";
-    }
-
-    @AfterMethod
-    public void deleteConfig() {
-        configTest.deleteAndVerifyConfig(testConfigName);
-    }
-
-
-    @Test
-    public void getJvmOptions() {
-        Response response = get(URL_SERVER_JVM_OPTIONS);
-        assertTrue(isSuccess(response));
-        Map<String, Object> responseMap = MarshallingUtils.buildMapFromDocument(response.readEntity(String.class));
-        List<String> jvmOptions = (List<String>)((Map)responseMap.get("extraProperties")).get("leafList");
-        assertTrue(jvmOptions.size() > 0);
-    }
-
-    @Test
-    public void createAndDeleteOptions() {
-        final String option1Name = "-Doption" + generateRandomString();
-        Map<String, String> newOptions = new HashMap<String, String>() {{
-            put(option1Name, "someValue");
-        }};
-
-        Response response = post(URL_TEST_CONFIG_JVM_OPTIONS, newOptions);
-        assertTrue(isSuccess(response));
-        response = get(URL_TEST_CONFIG_JVM_OPTIONS);
-        List<String> jvmOptions = getJvmOptions(response);
-        assertTrue(jvmOptions.contains(option1Name+"=someValue"));
-
-        response = delete(URL_TEST_CONFIG_JVM_OPTIONS, newOptions);
-        assertTrue(isSuccess(response));
-        response = get(URL_TEST_CONFIG_JVM_OPTIONS);
-        jvmOptions = getJvmOptions(response);
-        assertFalse(jvmOptions.contains(option1Name+"=someValue"));
-    }
-
-    // http://java.net/jira/browse/GLASSFISH-19069
-    @Test
-    public void createAndDeleteOptionsWithBackslashes() {
-        final String optionName = "-Dfile" + generateRandomString();
-        final String optionValue = "C:\\ABC\\DEF\\";
-        Map<String, String> newOptions = new HashMap<String, String>() {{
-            put(optionName, escape(optionValue));
-        }};
-
-        Response response = post(URL_TEST_CONFIG_JVM_OPTIONS, newOptions);
-        assertTrue(isSuccess(response));
-        response = get(URL_TEST_CONFIG_JVM_OPTIONS);
-        List<String> jvmOptions = getJvmOptions(response);
-        assertTrue(jvmOptions.contains(optionName+"="+optionValue));
-
-        response = delete(URL_TEST_CONFIG_JVM_OPTIONS, newOptions);
-        assertTrue(isSuccess(response));
-        response = get(URL_TEST_CONFIG_JVM_OPTIONS);
-        jvmOptions = getJvmOptions(response);
-        assertFalse(jvmOptions.contains(optionName+"="+optionValue));
-    }
-
-    @Test
-    public void createAndDeleteOptionsWithoutValues() {
-        final String option1Name = "-Doption" + generateRandomString();
-        final String option2Name = "-Doption" + generateRandomString();
-        Map<String, String> newOptions = new HashMap<String, String>() {{
-            put(option1Name, "");
-            put(option2Name, "");
-        }};
-
-        Response response = post(URL_TEST_CONFIG_JVM_OPTIONS, newOptions);
-        assertTrue(isSuccess(response));
-        response = get(URL_TEST_CONFIG_JVM_OPTIONS);
-        List<String> jvmOptions = getJvmOptions(response);
-        assertTrue(jvmOptions.contains(option1Name));
-        assertFalse(jvmOptions.contains(option1Name+"="));
-        assertTrue(jvmOptions.contains(option2Name));
-        assertFalse(jvmOptions.contains(option2Name+"="));
-
-        response = delete(URL_TEST_CONFIG_JVM_OPTIONS, newOptions);
-        assertTrue(isSuccess(response));
-        response = get(URL_TEST_CONFIG_JVM_OPTIONS);
-        jvmOptions = getJvmOptions(response);
-        assertFalse(jvmOptions.contains(option1Name));
-        assertFalse(jvmOptions.contains(option2Name));
-    }
-
-    @Test
-    public void testIsolatedOptionsCreationOnNewConfig() {
-        final String optionName = "-Doption" + generateRandomString();
-
-        Map<String, String> newOptions = new HashMap<String, String>() {{
-            put(optionName, "");
-            put("target", testConfigName);
-        }};
-
-        // Test new config to make sure option is there
-        Response response = post(URL_TEST_CONFIG_JVM_OPTIONS, newOptions);
-        assertTrue(isSuccess(response));
-        response = get(URL_TEST_CONFIG_JVM_OPTIONS);
-        List<String> jvmOptions = getJvmOptions(response);
-        assertTrue(jvmOptions.contains(optionName));
-
-        // Test server-config to make sure the options are NOT there
-        response = get(URL_SERVER_JVM_OPTIONS);
-        jvmOptions = getJvmOptions(response);
-        assertFalse(jvmOptions.contains(optionName));
-    }
-
-    @Test
-    public void testProfilerJvmOptions() {
-        final String profilerName = "profiler" + generateRandomString();
-        final String optionName = "-Doption" + generateRandomString();
-        Map<String, String> attrs = new HashMap<String, String>() {{
-            put("name", profilerName);
-            put("target", testConfigName);
-        }};
-        Map<String, String> newOptions = new HashMap<String, String>() {{
-//            put("target", testConfigName);
-//            put("profiler", "true");
-            put(optionName, "");
-        }};
-
-        deleteProfiler(URL_TEST_CONFIG + "/java-config/profiler/delete-profiler", testConfigName, false);
-
-        Response response = post(URL_TEST_CONFIG + "/java-config/create-profiler", attrs);
-        assertTrue(isSuccess(response));
-
-        response = post(URL_TEST_CONFIG + "/java-config/profiler/jvm-options", newOptions);
-        assertTrue(isSuccess(response));
-
-        response = get(URL_TEST_CONFIG + "/java-config/profiler/jvm-options");
-        List<String> jvmOptions = getJvmOptions(response);
-        assertTrue(jvmOptions.contains(optionName));
-
-        deleteProfiler(URL_TEST_CONFIG + "/java-config/profiler/delete-profiler", testConfigName, true);
-    }
-
-    @Test
-    public void testJvmOptionWithColon() {
-        final String optionName = "-XX:MaxPermSize";
-        final String optionValue = "152m";
-        Map<String, String> newOptions = new HashMap<String, String>() {{
-            put(escape(optionName), optionValue);
-        }};
-
-        Response response = post(URL_TEST_CONFIG_JVM_OPTIONS, newOptions);
-        assertTrue(isSuccess(response));
-        response = get(URL_TEST_CONFIG_JVM_OPTIONS);
-//        assertTrue(isSuccess(response));
-        List<String> jvmOptions = getJvmOptions(response);
-        assertTrue(jvmOptions.contains(optionName+"="+optionValue));
-
-        response = delete(URL_TEST_CONFIG_JVM_OPTIONS, newOptions);
-        assertTrue(isSuccess(response));
-        response = get(URL_TEST_CONFIG_JVM_OPTIONS);
-        jvmOptions = getJvmOptions(response);
-        assertFalse(jvmOptions.contains(optionName+"="+optionValue));
-    }
-
-    protected void deleteProfiler(final String url, final String target, final boolean failOnError) {
-        Response response = delete (url, new HashMap() {{ put ("target", target); }});
-        if (failOnError) {
-            assertTrue(isSuccess(response));
-        }
-    }
-
-    protected List<String> getJvmOptions(Response response) {
-        Map<String, Object> responseMap = MarshallingUtils.buildMapFromDocument(response.readEntity(String.class));
-        List<String> jvmOptions = (List<String>)((Map)responseMap.get("extraProperties")).get("leafList");
-
-        return jvmOptions;
-    }
-
-    protected String escape(String part) {
-        String changed = part
-                .replace("\\", "\\\\")
-                .replace(":", "\\:");
-        return changed;
-    }
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/MetadataTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/MetadataTest.java
deleted file mode 100644
index 2e11a93..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/MetadataTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.rest;
-
-import java.util.Map;
-import jakarta.ws.rs.core.Response;
-import org.glassfish.admin.rest.client.utils.MarshallingUtils;
-import static org.testng.AssertJUnit.*;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author jasonlee
- */
-public class MetadataTest extends RestTestBase {
-    protected static final String URL_CONFIG = "/domain/configs/config.json";
-    protected static final String URL_UPTIMECOMMAND = "/domain/uptime.json";
-
-    @Test
-    public void configParameterTest() {
-        Response response = options(URL_CONFIG);
-        assertTrue(isSuccess(response));
-        // Really dumb test.  Should be good enough for now
-
-        Map extraProperties = MarshallingUtils.buildMapFromDocument(response.readEntity(String.class));
-        assertNotNull(extraProperties);
-
-        // Another dumb test to make sure that "name" shows up on the HTML page
-        response = getClient().target(getAddress(URL_CONFIG)).request().get(Response.class);
-        assertTrue(response.readEntity(String.class).contains("extraProperties"));
-    }
-
-    @Test
-    public void UpTimeMetadaDataTest() {
-        Response response = options(URL_UPTIMECOMMAND);
-        assertTrue(isSuccess(response));
-
-        Map extraProperties = MarshallingUtils.buildMapFromDocument(response.readEntity(String.class));
-        assertNotNull(extraProperties);
-
-        // Another dumb test to make sure that "extraProperties" shows up on the HTML page
-        response = getClient().target(getAddress(URL_UPTIMECOMMAND)).request().get(Response.class);
-        String resp = response.readEntity(String.class);
-        assertTrue(resp.contains("extraProperties"));
-        // test to see if we get the milliseconds parameter description which is an
-        //optional param metadata for the uptime command
-        assertTrue(resp.contains("milliseconds"));
-        assertTrue(resp.contains("GET"));
-    }
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/MonitoringTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/MonitoringTest.java
deleted file mode 100644
index 5a5f98b..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/MonitoringTest.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.rest;
-
-
-import java.util.HashMap;
-import java.util.Map;
-import jakarta.ws.rs.core.Response;
-import static org.testng.AssertJUnit.*;
-import org.testng.annotations.Test;
-
-
-/**
- *
- * @author Mitesh Meswani
- */
-public class MonitoringTest extends RestTestBase {
-    private static final String MONITORING_RESOURCE_URL = "/domain/configs/config/server-config/monitoring-service/module-monitoring-levels";
-    private static final String JDBC_CONNECTION_POOL_URL = "/domain/resources/jdbc-connection-pool";
-    private static final String PING_CONNECTION_POOL_URL = "/domain/resources/ping-connection-pool";
-    private static final String CONTEXT_ROOT_MONITORING = "monitoring";
-
-    @Override
-    protected String getContextRoot() {
-        return CONTEXT_ROOT_MONITORING;
-    }
-
-    @Test(enabled=false)
-    public void initializeMonitoring() {
-        // Enable monitoring
-        String url = getManagementURL(MONITORING_RESOURCE_URL);
-        Map<String, String> payLoad = new HashMap<String, String>() {
-            {
-                put("ThreadPool", "HIGH");
-                put("Orb", "HIGH");
-                put("EjbContainer", "HIGH");
-                put("WebContainer", "HIGH");
-                put("Deployment", "HIGH");
-                put("TransactionService", "HIGH");
-                put("HttpService", "HIGH");
-                put("JdbcConnectionPool", "HIGH");
-                put("ConnectorConnectionPool", "HIGH");
-                put("ConnectorService", "HIGH");
-                put("JmsService", "HIGH");
-                put("Jvm", "HIGH");
-                put("Security", "HIGH");
-                put("WebServicesContainer", "HIGH");
-                put("Jpa", "HIGH");
-                put("Jersey", "HIGH");
-            }
-        };
-        Response response = post(url, payLoad);
-        checkStatusForSuccess(response);
-    }
-
-    /**
-     * Objective - Verify that basic monitoring is working
-     * Strategy - Call /monitoring/domain and assert that "server" is present as child element
-     */
-    @Test(enabled=false)
-    public void testBaseURL() {
-        Map<String, String> entity = getChildResources(get("/domain")); // monitoring/domain
-        assertNotNull(entity.get("server"));
-    }
-
-    /**
-     * Objective - Verify that resources with dot work
-     * Strategy - create a resource with "." in name and then try to access it
-     */
-    @Test(enabled=false)
-    public void testDot() {
-        // Step 1- Create a resource with "."
-        final String POOL_NAME = "poolNameWith.dot";
-
-        // Clean up from leftover from previous run
-        String url = getManagementURL(JDBC_CONNECTION_POOL_URL + '/' + POOL_NAME);
-        delete(url);
-
-        url = getManagementURL(JDBC_CONNECTION_POOL_URL);
-        Map<String, String> payLoad = new HashMap<String, String>() {
-            {
-                put("name", POOL_NAME);
-                put("resType", "javax.sql.DataSource");
-                put("datasourceClassname", "foo.bar");
-            }
-        };
-        Response response = post(url, payLoad);
-        checkStatusForSuccess(response);
-
-
-        // Step 2- Ping the connection pool to generate some monitoring data
-        url = getManagementURL(PING_CONNECTION_POOL_URL);
-        payLoad.clear();
-        payLoad.put("id", POOL_NAME);
-        get(url, payLoad);
-
-       // Step 3 - Access monitoring tree to assert it is accessible
-        response = get("/domain/server/resources/"+ POOL_NAME);
-        checkStatusForSuccess(response);
-        Map<String, String> responseEntity = getEntityValues(response);
-        assertTrue("No Monitoring data found for pool " + POOL_NAME, responseEntity.size() > 0 );
-    }
-
-    /**
-     * Objective - Verify that invalid resources returns 404
-     * Strategy - Request an invalid resource under monitoring and ensure that 404 is returned
-     */
-    @Test(enabled=false)
-    public void testInvalidResource() {
-        Response response = get("/domain/server/foo");
-        assertTrue("Did not receive ", response.getStatus() == jakarta.ws.rs.core.Response.Status.NOT_FOUND.getStatusCode() ) ;
-    }
-
-
-    private String getManagementURL(String targetResourceURL) {
-        return getBaseUrl() + CONTEXT_ROOT_MANAGEMENT + targetResourceURL;
-
-    }
-
-
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/NetworkListenerTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/NetworkListenerTest.java
deleted file mode 100644
index 25721ce..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/NetworkListenerTest.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.rest;
-
-import java.util.HashMap;
-import java.util.Map;
-import jakarta.ws.rs.core.Response;
-import org.codehaus.jettison.json.JSONObject;
-import static org.testng.AssertJUnit.*;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author jasonlee
- */
-public class NetworkListenerTest extends RestTestBase {
-    protected static final String URL_PROTOCOL = "/domain/configs/config/server-config/network-config/protocols/protocol";
-    protected static final String URL_SSL = "/domain/configs/config/server-config/network-config/protocols/protocol/http-listener-2/ssl";
-
-    @Test(enabled=false)
-    public void createHttpListener() {
-        final String redirectProtocolName = "http-redirect"; //protocol_" + generateRandomString();
-        final String portUniProtocolName = "pu-protocol"; //protocol_" + generateRandomString();
-
-        final String redirectFilterName = "redirect-filter"; //filter_" + generateRandomString();
-        final String finderName1 = "http-finder"; //finder" + generateRandomString();
-        final String finderName2 = "http-redirect"; //finder" + generateRandomString();
-
-        try {
-            Response response = post("/domain/set", new HashMap<String, String>() {{
-                put("configs.config.server-config.network-config.network-listeners.network-listener.http-listener-1.protocol", "http-listener-1");
-            }});
-            checkStatusForSuccess(response);
-            delete(URL_PROTOCOL + "/" + portUniProtocolName);
-            checkStatusForSuccess(response);
-            delete(URL_PROTOCOL + "/" + redirectProtocolName);
-            checkStatusForSuccess(response);
-// asadmin commands taken from: http://www.antwerkz.com/port-unification-in-glassfish-3-part-1/
-//        asadmin create-protocol --securityenabled=false http-redirect
-//        asadmin create-protocol --securityenabled=false pu-protocol
-            response = post(URL_PROTOCOL, new HashMap<String, String>() {{ put ("securityenabled", "false"); put("id", redirectProtocolName); }});
-            checkStatusForSuccess(response);
-            response = post(URL_PROTOCOL, new HashMap<String, String>() {{ put ("securityenabled", "false"); put("id", portUniProtocolName); }});
-            checkStatusForSuccess(response);
-
-//        asadmin create-protocol-filter --protocol http-redirect --classname org.glassfish.grizzly.config.portunif.HttpRedirectFilter redirect-filter
-            response = post (URL_PROTOCOL + "/" + redirectProtocolName + "/create-protocol-filter",
-                new HashMap<String, String>() {{
-                    put ("id", redirectFilterName);
-                    put ("protocol", redirectProtocolName);
-                    put ("classname", "org.glassfish.grizzly.config.portunif.HttpRedirectFilter");
-                }});
-            checkStatusForSuccess(response);
-
-//        asadmin create-protocol-finder --protocol pu-protocol --targetprotocol http-listener-2 --classname org.glassfish.grizzly.config.portunif.HttpProtocolFinder http-finder
-//        asadmin create-protocol-finder --protocol pu-protocol --targetprotocol http-redirect   --classname org.glassfish.grizzly.config.portunif.HttpProtocolFinder http-redirect
-            response = post (URL_PROTOCOL + "/" + portUniProtocolName + "/create-protocol-finder",
-                new HashMap<String, String>() {{
-                    put ("id", finderName1);
-                    put ("protocol", portUniProtocolName);
-                    put ("targetprotocol", "http-listener-2");
-                    put ("classname", "org.glassfish.grizzly.config.portunif.HttpProtocolFinder");
-                }});
-            checkStatusForSuccess(response);
-            response = post (URL_PROTOCOL + "/" + portUniProtocolName + "/create-protocol-finder",
-                new HashMap<String, String>() {{
-                    put ("id", finderName2);
-                    put ("protocol", portUniProtocolName);
-                    put ("targetprotocol", redirectProtocolName);
-                    put ("classname", "org.glassfish.grizzly.config.portunif.HttpProtocolFinder");
-                }});
-            checkStatusForSuccess(response);
-
-
-//        asadmin set configs.config.server-config.network-config.network-listeners.network-listener.http-listener-1.protocol=pu-protocol
-            response = post("/domain/configs/config/server-config/network-config/network-listeners/network-listener/http-listener-1", new HashMap<String, String>() {{
-                put("protocol", portUniProtocolName);
-            }});
-            checkStatusForSuccess(response);
-
-            response = get("/domain/configs/config/server-config/network-config/network-listeners/network-listener/http-listener-1/find-http-protocol");
-            assertTrue(response.readEntity(String.class).contains("http-listener-2"));
-        } finally {
-//            ClientResponse response = post("/domain/set", new HashMap<String, String>() {{
-            Response response = post("/domain/configs/config/server-config/network-config/network-listeners/network-listener/http-listener-1", new HashMap<String, String>() {{
-                put("protocol", "http-listener-1");
-            }});
-            checkStatusForSuccess(response);
-            response = delete(URL_PROTOCOL + "/" + portUniProtocolName + "/delete-protocol-finder",
-                new HashMap<String, String>() {{
-                    put("protocol", portUniProtocolName);
-                    put("id", finderName1);
-                }} );
-            checkStatusForSuccess(response);
-            response = delete(URL_PROTOCOL + "/" + portUniProtocolName + "/delete-protocol-finder",
-                new HashMap<String, String>() {{
-                    put("protocol", portUniProtocolName);
-                    put("id", finderName2);
-                }} );
-            checkStatusForSuccess(response);
-            response = delete(URL_PROTOCOL + "/" + redirectProtocolName + "/protocol-chain-instance-handler/protocol-chain/protocol-filter/" + redirectFilterName,
-                    new HashMap<String, String>() {{ put("protocol", redirectProtocolName); }} );
-            checkStatusForSuccess(response);
-            response = delete(URL_PROTOCOL + "/" + portUniProtocolName);
-            checkStatusForSuccess(response);
-            response = delete(URL_PROTOCOL + "/" + redirectProtocolName);
-            checkStatusForSuccess(response);
-        }
-
-    }
-
-    @Test
-    public void testClearingProperties() {
-        Map<String, String> params = new HashMap<String, String>() {{
-            put("keyStore", "foo");
-            put("trustAlgorithm", "bar");
-            put("trustMaxCertLength", "15");
-            put("trustStore", "baz");
-        }};
-
-        Response response = post(URL_SSL, params);
-        assertTrue(isSuccess(response));
-        response = get(URL_SSL, params);
-        Map<String, String> entity = this.getEntityValues(response);
-        assertEquals(params.get("keyStore"), entity.get("keyStore"));
-        assertEquals(params.get("trustAlgorithm"), entity.get("trustAlgorithm"));
-        assertEquals(params.get("trustMaxCertLength"), entity.get("trustMaxCertLength"));
-        assertEquals(params.get("trustStore"), entity.get("trustStore"));
-
-        params.put("keyStore", "");
-        params.put("trustAlgorithm", "");
-        params.put("trustStore", "");
-        response = post(URL_SSL, params);
-        assertTrue(isSuccess(response));
-        response = get(URL_SSL, params);
-        entity = this.getEntityValues(response);
-        assertEquals(JSONObject.NULL, entity.get("keyStore"));
-        assertEquals(JSONObject.NULL, entity.get("trustAlgorithm"));
-        assertEquals(JSONObject.NULL, entity.get("trustStore"));
-    }
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/NoCLICommandResourceCreationTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/NoCLICommandResourceCreationTest.java
deleted file mode 100644
index e33e87a..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/NoCLICommandResourceCreationTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.rest;
-
-import java.util.HashMap;
-import java.util.Map;
-import jakarta.ws.rs.client.Entity;
-import jakarta.ws.rs.core.MediaType;
-import jakarta.ws.rs.core.Response;
-import org.glassfish.admin.rest.client.utils.MarshallingUtils;
-import static org.testng.AssertJUnit.*;
-import org.testng.annotations.Test;
-
-/**
- * @author Mitesh Meswani
- */
-public class NoCLICommandResourceCreationTest extends RestTestBase {
-    private static final String URL_SERVER_PROPERTY = "/domain/servers/server/server/property";
-
-    @Test
-    public void testPropertyCreation() {
-        final String propertyKey  = "propertyName" + generateRandomString();
-        String propertyValue = generateRandomString();
-
-        //Create a property
-        Map<String, String> param = new HashMap<String, String>();
-        param.put("name", propertyKey);
-        param.put("value",propertyValue);
-        Response response = getClient().target(getAddress(URL_SERVER_PROPERTY))
-                .request(RESPONSE_TYPE)
-                .post(Entity.entity(MarshallingUtils.getXmlForProperties(param), MediaType.APPLICATION_XML), Response.class);
-        assertTrue(isSuccess(response));
-
-        //Verify the property got created
-        String propertyURL = URL_SERVER_PROPERTY + "/" + propertyKey;
-        response = get (propertyURL);
-        assertTrue(isSuccess(response));
-        Map<String, String> entity = getEntityValues(response);
-        assertTrue(entity.get("name").equals(propertyKey));
-        assertTrue(entity.get("value").equals(propertyValue));
-
-        // Verify property update
-        propertyValue = generateRandomString();
-        param.put("value", propertyValue);
-        response = getClient().target(getAddress(URL_SERVER_PROPERTY))
-                .request(RESPONSE_TYPE)
-                .put(Entity.entity(MarshallingUtils.getXmlForProperties(param), MediaType.APPLICATION_XML), Response.class);
-        assertTrue(isSuccess(response));
-        response = get (propertyURL);
-        assertTrue(isSuccess(response));
-        entity = getEntityValues(response);
-        assertTrue(entity.get("name").equals(propertyKey));
-        assertTrue(entity.get("value").equals(propertyValue));
-
-        //Clean up to leave domain.xml good for next run
-        response = delete(propertyURL, new HashMap<String, String>());
-        assertTrue(isSuccess(response));
-    }
-
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/ProvidersTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/ProvidersTest.java
deleted file mode 100644
index 4c48b52..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/ProvidersTest.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.rest;
-
-import jakarta.ws.rs.core.Response;
-import static org.testng.AssertJUnit.*;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author jasonlee
- */
-public class ProvidersTest extends RestTestBase {
-    private static final String URL_ACTION_REPORT_RESULT = "/domain/uptime";
-    private static final String URL_COMMAND_RESOURCE_GET_RESULT = "/domain/stop";
-    private static final String URL_GET_RESULT = "/domain";
-    private static final String URL_GET_RESULT_LIST = "/domain/servers/server";
-    private static final String URL_OPTIONS_RESULT = "/domain";
-    private static final String URL_STRING_LIST_RESULT = "/domain/configs/config/server-config/java-config/jvm-options";
-    private static String URL_TREE_NODE;
-
-    public ProvidersTest() {
-        URL_TREE_NODE = "http://localhost:" + getParameter("admin.port", "4848") + "/monitoring/domain";
-    }
-
-    @Test
-    public void testActionReportResultHtmlProvider() {
-        Response response = get(URL_ACTION_REPORT_RESULT + ".html");
-        assertTrue(isSuccess(response));
-    }
-
-    @Test
-    public void testActionReportResultXmlProvider() {
-        Response response = get(URL_ACTION_REPORT_RESULT + ".xml");
-        assertTrue(isSuccess(response));
-    }
-
-    @Test
-    public void testActionReportResultJsonProvider() {
-        Response response = get(URL_ACTION_REPORT_RESULT + ".json");
-        assertTrue(isSuccess(response));
-    }
-
-    @Test
-    public void testCommandResourceGetResultHtmlProvider() {
-        Response response = get(URL_COMMAND_RESOURCE_GET_RESULT + ".html");
-        assertTrue(isSuccess(response));
-    }
-
-    @Test
-    public void testCommandResourceGetResultXmlProvider() {
-        Response response = get(URL_COMMAND_RESOURCE_GET_RESULT + ".xml");
-        assertTrue(isSuccess(response));
-    }
-
-    @Test
-    public void testCommandResourceGetResultJsonProvider() {
-        Response response = get(URL_COMMAND_RESOURCE_GET_RESULT + ".json");
-        assertTrue(isSuccess(response));
-    }
-
-    @Test
-    public void testGetResultHtmlProvider() {
-        Response response = get(URL_GET_RESULT + ".html");
-        assertTrue(isSuccess(response));
-    }
-
-    @Test
-    public void testGetResultXmlProvider() {
-        Response response = get(URL_GET_RESULT + ".xml");
-        assertTrue(isSuccess(response));
-    }
-
-    @Test
-    public void testGetResultJsonProvider() {
-        Response response = get(URL_GET_RESULT + ".json");
-        assertTrue(isSuccess(response));
-    }
-
-    @Test
-    public void testGetResultListHtmlProvider() {
-        Response response = get(URL_GET_RESULT_LIST + ".html");
-        assertTrue(isSuccess(response));
-    }
-
-    @Test
-    public void testGetResultListXmlProvider() {
-        Response response = get(URL_GET_RESULT_LIST + ".xml");
-        assertTrue(isSuccess(response));
-    }
-
-    @Test
-    public void testGetResultListJsonProvider() {
-        Response response = get(URL_GET_RESULT_LIST + ".json");
-        assertTrue(isSuccess(response));
-    }
-
-    @Test
-    public void testOptionsResultXmlProvider() {
-        Response response = options(URL_OPTIONS_RESULT + ".xml");
-        assertTrue(isSuccess(response));
-    }
-
-    @Test
-    public void testOptionsResultJsonProvider() {
-        Response response = options(URL_OPTIONS_RESULT + ".json");
-        assertTrue(isSuccess(response));
-    }
-
-    @Test
-    public void testStringListResultHtmlProvider() {
-        Response response = get(URL_STRING_LIST_RESULT + ".html");
-        assertTrue(isSuccess(response));
-    }
-
-    @Test
-    public void testStringListResultXmlProvider() {
-        Response response = get(URL_STRING_LIST_RESULT + ".xml");
-        assertTrue(isSuccess(response));
-    }
-
-    @Test
-    public void testStringListResultJsonProvider() {
-        Response response = get(URL_STRING_LIST_RESULT + ".json");
-        assertTrue(isSuccess(response));
-    }
-
-    @Test
-    public void testTreeNodeHtmlProvider() {
-        Response response = get(URL_TREE_NODE + ".html");
-        assertTrue(isSuccess(response));
-    }
-
-    @Test
-    public void testTreeNodeXmlProvider() {
-        Response response = get(URL_TREE_NODE + ".xml");
-        assertTrue(isSuccess(response));
-    }
-
-    @Test
-    public void testTreeNodeJsonProvider() {
-        Response response = get(URL_TREE_NODE + ".json");
-        assertTrue(isSuccess(response));
-    }
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/ResourceRefTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/ResourceRefTest.java
deleted file mode 100644
index ca924dc..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/ResourceRefTest.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.rest;
-
-import java.util.HashMap;
-import java.util.Map;
-import jakarta.ws.rs.core.Response;
-import static org.testng.AssertJUnit.*;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author jasonlee
- */
-public class ResourceRefTest extends RestTestBase {
-    private static final String URL_CREATE_INSTANCE = "/domain/create-instance";
-    private static final String URL_JDBC_RESOURCE = "/domain/resources/jdbc-resource";
-    private static final String URL_RESOURCE_REF = "/domain/servers/server/server/resource-ref";
-
-    @Test(enabled=false)
-    public void testCreatingResourceRef() {
-        final String instanceName = "instance_" + generateRandomString();
-        final String jdbcResourceName = "jdbc_" + generateRandomString();
-        Map<String, String> newInstance = new HashMap<String, String>() {{
-            put("id", instanceName);
-            put("node", "localhost-domain1");
-        }};
-        Map<String, String> jdbcResource = new HashMap<String, String>() {{
-            put("id", jdbcResourceName);
-            put("connectionpoolid", "DerbyPool");
-            put("target", instanceName);
-        }};
-        Map<String, String> resourceRef = new HashMap<String, String>() {{
-            put("id", jdbcResourceName);
-            put("target", "server");
-        }};
-
-        try {
-            Response response = post(URL_CREATE_INSTANCE, newInstance);
-            assertTrue(isSuccess(response));
-
-            response = post(URL_JDBC_RESOURCE, jdbcResource);
-            assertTrue(isSuccess(response));
-
-            response = post(URL_RESOURCE_REF, resourceRef);
-            assertTrue(isSuccess(response));
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            Response response = delete("/domain/servers/server/" + instanceName + "/resource-ref/" + jdbcResourceName, new HashMap<String, String>() {{
-                put("target", instanceName);
-            }});
-            assertTrue(isSuccess(response));
-            response = get("/domain/servers/server/" + instanceName + "/resource-ref/" + jdbcResourceName);
-            assertFalse(isSuccess(response));
-
-            response = delete(URL_JDBC_RESOURCE + "/" + jdbcResourceName);
-            assertTrue(isSuccess(response));
-            response = get(URL_JDBC_RESOURCE + "/" + jdbcResourceName);
-            assertFalse(isSuccess(response));
-
-            response = delete("/domain/servers/server/" + instanceName + "/delete-instance");
-            assertTrue(isSuccess(response));
-            response = get("/domain/servers/server/" + instanceName);
-            assertFalse(isSuccess(response));
-        }
-    }
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/RestTestBase.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/RestTestBase.java
deleted file mode 100644
index 5d79268..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/RestTestBase.java
+++ /dev/null
@@ -1,372 +0,0 @@
-/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.rest;
-
-import java.io.BufferedWriter;
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.PrintWriter;
-import java.math.BigInteger;
-import java.security.SecureRandom;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import jakarta.ws.rs.client.Client;
-import jakarta.ws.rs.client.Entity;
-import jakarta.ws.rs.client.WebTarget;
-import jakarta.ws.rs.core.MediaType;
-import jakarta.ws.rs.core.MultivaluedHashMap;
-import jakarta.ws.rs.core.MultivaluedMap;
-import jakarta.ws.rs.core.Response;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import org.glassfish.admin.rest.client.ClientWrapper;
-import org.glassfish.admin.rest.client.utils.MarshallingUtils;
-
-import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
-import org.glassfish.jersey.logging.LoggingFeature;
-import org.glassfish.jersey.media.multipart.FormDataMultiPart;
-import org.glassfish.jersey.media.multipart.file.FileDataBodyPart;
-import static org.testng.AssertJUnit.*;
-import org.w3c.dom.Document;
-
-public class RestTestBase {
-    protected static String baseUrl = "http://localhost:4848";
-    protected static final String RESPONSE_TYPE = MediaType.APPLICATION_JSON;//APPLICATION_XML;
-    protected static final String AUTH_USER_NAME = "dummyuser";
-    protected static final String AUTH_PASSWORD = "dummypass";
-    protected static final String CONTEXT_ROOT_MANAGEMENT = "/management";
-    private static final HttpAuthenticationFeature basicAuthFilter = HttpAuthenticationFeature.basic(AUTH_USER_NAME, AUTH_PASSWORD);
-    protected static String adminHost;
-    protected static String adminPort;
-    protected static String adminUser;
-    protected static String adminPass;
-    protected static String instancePort;
-
-    private static String currentTestClass = "";
-    protected Client client;
-
-//    @BeforeClass
-    public static void initialize() {
-        adminPort = getParameter("admin.port", "4848");
-        instancePort = getParameter("instance.port", "8080");
-        adminHost = getParameter("instance.host", "localhost");
-        adminUser = getParameter("user.name", "admin");
-        adminPass = getParameter("user.pass", "");
-        baseUrl = "http://" + adminHost + ':' + adminPort + '/';
-
-        final RestTestBase rtb = new RestTestBase();
-        rtb.get("/domain/rotate-log");
-    }
-
-//    @AfterClass
-    public static void captureLog() {
-        try {
-
-            if (!currentTestClass.isEmpty()) {
-                RestTestBase rtb = new RestTestBase();
-                Client client = new ClientWrapper(new HashMap<String, String>(), adminUser, adminPass);
-                Response cr = client.target(rtb.getAddress("/domain/view-log")).
-                        request().
-                        get(Response.class);
-
-                PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("target/surefire-reports/" + currentTestClass + "-server.log")));
-                out.write(cr.readEntity(String.class));
-                out.close();
-            }
-        } catch (Exception ex) {
-            Logger.getLogger(RestTestBase.class.getName()).
-                    log(Level.INFO, null, ex);
-        }
-    }
-
-    protected static String getBaseUrl() {
-        return baseUrl;
-    }
-
-    protected String getContextRoot() {
-        return CONTEXT_ROOT_MANAGEMENT;
-    }
-
-//    @BeforeMethod(alwaysRun = true)
-    public void setup() {
-        currentTestClass = this.getClass().getName();
-    }
-
-    protected String getAddress(String address) {
-        if (address.startsWith("http://")) {
-            return address;
-        }
-
-        return baseUrl + getContextRoot() + address;
-    }
-
-//    @BeforeMethod
-    protected Client getClient() {
-        if (client == null) {
-            client = new ClientWrapper(new HashMap<String, String>(), adminUser, adminPass);
-            if (Boolean.parseBoolean(System.getProperty("DEBUG"))) {
-                client.register(LoggingFeature.class);
-            }
-        }
-        return client;
-    }
-
-    protected void resetClient() {
-        client = null;
-        getClient();
-    }
-
-    protected void authenticate() {
-        getClient().register(basicAuthFilter);
-    }
-
-    protected <T> T getTestClass(Class<T> clazz) {
-        try {
-            T test = clazz.newInstance();
-            ((RestTestBase) test).setup();
-            return test;
-        } catch (Exception ex) {
-            throw new RuntimeException(ex);
-        }
-    }
-
-    protected static String generateRandomString() {
-        SecureRandom random = new SecureRandom();
-
-        return new BigInteger(130, random).toString(16);
-    }
-
-    protected static int generateRandomNumber() {
-        Random r = new Random();
-        return Math.abs(r.nextInt()) + 1;
-    }
-
-    protected int generateRandomNumber(int max) {
-        Random r = new Random();
-        return Math.abs(r.nextInt(max - 1)) + 1;
-    }
-
-    protected boolean isSuccess(Response response) {
-        int status = response.getStatus();
-        return ((status >= 200) && (status <= 299));
-    }
-
-    protected void checkStatusForSuccess(Response cr) {
-        int status = cr.getStatus();
-        if (!isSuccess(cr)) {
-            String message = getErrorMessage(cr);
-            fail("Expected a status between 200 and 299 (inclusive).  Found " + status
-                    + ((message != null) ? ":  " + message : ""));
-        }
-    }
-
-    protected void checkStatusForFailure(Response cr) {
-        int status = cr.getStatus();
-        if (isSuccess(cr)) {
-            fail("Expected a status less than 200 or greater than 299 (inclusive).  Found " + status);
-        }
-    }
-
-    protected String getResponseType() {
-        return RESPONSE_TYPE;
-    }
-
-    protected Response get(String address) {
-        return get(address, new HashMap<String, String>());
-    }
-
-    protected Response get(String address, Map<String, String> payload) {
-        WebTarget target = getClient().target(getAddress(address));
-        for (Map.Entry<String, String> entry : payload.entrySet()) {
-            target = target.queryParam(entry.getKey(), entry.getValue());
-        }
-        return target.request(getResponseType())
-                .get(Response.class);
-    }
-
-    protected Response options(String address) {
-        return getClient().target(getAddress(address)).
-                request(getResponseType()).
-                options(Response.class);
-    }
-
-    protected Response post(String address, Map<String, String> payload) {
-        return getClient().target(getAddress(address)).
-                request(getResponseType()).
-                post(Entity.entity(buildMultivaluedMap(payload), MediaType.APPLICATION_FORM_URLENCODED), Response.class);
-    }
-
-    protected Response post(String address) {
-        return getClient().target(getAddress(address)).
-                request(getResponseType()).
-                post(Entity.entity(null, MediaType.APPLICATION_FORM_URLENCODED), Response.class);
-    }
-
-    protected Response put(String address, Map<String, String> payload) {
-        return getClient().target(getAddress(address)).
-                request(getResponseType()).
-                put(Entity.entity(buildMultivaluedMap(payload), MediaType.APPLICATION_FORM_URLENCODED), Response.class);
-    }
-
-    protected Response put(String address) {
-        return getClient().target(getAddress(address)).
-                request(getResponseType()).
-                put(Entity.entity(null, MediaType.APPLICATION_FORM_URLENCODED), Response.class);
-    }
-
-    protected Response postWithUpload(String address, Map<String, Object> payload) {
-        FormDataMultiPart form = new FormDataMultiPart();
-        for (Map.Entry<String, Object> entry : payload.entrySet()) {
-            if ((entry.getValue() instanceof File)) {
-                form.getBodyParts().
-                        add((new FileDataBodyPart(entry.getKey(), (File) entry.getValue())));
-            } else {
-                form.field(entry.getKey(), entry.getValue(), MediaType.TEXT_PLAIN_TYPE);
-            }
-        }
-        return getClient().target(getAddress(address)).
-                request(getResponseType()).
-                post(Entity.entity(form, MediaType.MULTIPART_FORM_DATA), Response.class);
-    }
-
-    protected Response delete(String address) {
-        return delete(address, new HashMap<String, String>());
-    }
-
-    protected Response delete(String address, Map<String, String> payload) {
-        WebTarget target = getClient().target(getAddress(address));
-        for (Map.Entry<String, String> entry : payload.entrySet()) {
-            target = target.queryParam(entry.getKey(), entry.getValue());
-        }
-        return target.request(getResponseType())
-                .delete(Response.class);
-    }
-
-    /**
-     * This method will parse the provided XML document and return a map of the attributes and values on the root
-     * element
-     *
-     * @param response
-     * @return
-     */
-    protected Map<String, String> getEntityValues(Response response) {
-        Map<String, String> map = new HashMap<String, String>();
-
-        String xml = response.readEntity(String.class);
-        Map responseMap = MarshallingUtils.buildMapFromDocument(xml);
-        Object obj = responseMap.get("extraProperties");
-        if (obj != null) {
-            return (Map) ((Map) obj).get("entity");
-        } else {
-            return map;
-        }
-    }
-
-    protected List<String> getCommandResults(Response response) {
-        String document = response.readEntity(String.class);
-        List<String> results = new ArrayList<String>();
-        Map map = MarshallingUtils.buildMapFromDocument(document);
-        String message = (String) map.get("message");
-        if (message != null && !"".equals(message)) {
-            results.add(message);
-        }
-
-        Object children = map.get("children");
-        if (children instanceof List) {
-            for (Object child : (List) children) {
-                Map childMap = (Map) child;
-                message = (String) childMap.get("message");
-                if (message != null) {
-                    results.add(message);
-                }
-            }
-        }
-
-        return results;
-    }
-
-    protected Map<String, String> getChildResources(Response response) {
-        Map responseMap = MarshallingUtils.buildMapFromDocument(response.readEntity(String.class));
-        Map<String, Map> extraProperties = (Map<String, Map>) responseMap.get("extraProperties");
-        if (extraProperties != null) {
-            return (Map<String, String>) extraProperties.get("childResources");
-        }
-
-        return new HashMap<String, String>();
-    }
-
-    public Document getDocument(String input) {
-        try {
-            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
-            DocumentBuilder db = dbf.newDocumentBuilder();
-            Document doc = db.parse(new ByteArrayInputStream(input.getBytes()));
-            return doc;
-        } catch (Exception ex) {
-            return null;
-        }
-    }
-
-    public List<Map<String, String>> getProperties(Response response) {
-        Map responseMap = MarshallingUtils.buildMapFromDocument(response.readEntity(String.class));
-        Map extraProperties = (Map) responseMap.get("extraProperties");
-        if (extraProperties != null) {
-            return (List) extraProperties.get("properties");
-        }
-        return new ArrayList<Map<String, String>>();
-    }
-
-    private MultivaluedMap buildMultivaluedMap(Map<String, String> payload) {
-        if (payload instanceof MultivaluedMap) {
-            return (MultivaluedMap) payload;
-        }
-        MultivaluedMap formData = new MultivaluedHashMap();
-        if (payload != null) {
-            for (final Map.Entry<String, String> entry : payload.entrySet()) {
-                formData.add(entry.getKey(), entry.getValue());
-            }
-        }
-        return formData;
-    }
-
-    protected String getErrorMessage(Response cr) {
-        String message = null;
-        Map map = MarshallingUtils.buildMapFromDocument(cr.readEntity(String.class));
-        if (map != null) {
-            message = (String) map.get("message");
-        }
-
-        return message;
-    }
-
-    protected static String getParameter(String paramName, String defaultValue) {
-        String value = System.getenv(paramName);
-        if (value == null) {
-            value = System.getProperty(paramName);
-        }
-        if (value == null) {
-            value = defaultValue;
-        }
-
-        return value;
-    }
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/SystemPropertiesTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/SystemPropertiesTest.java
deleted file mode 100644
index 66d8380..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/SystemPropertiesTest.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.rest;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import jakarta.ws.rs.core.Response;
-import org.glassfish.admin.rest.client.utils.MarshallingUtils;
-import static org.testng.AssertJUnit.*;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author jasonlee
- */
-public class SystemPropertiesTest extends RestTestBase {
-    public static final String URL_CONFIG_SYSTEM_PROPERTIES = "/domain/configs/config/%config%/system-properties";
-    public static final String URL_CLUSTER_SYSTEM_PROPERTIES = "/domain/clusters/cluster/%clusterName%/system-properties";
-    public static final String URL_INSTANCE_SYSTEM_PROPERTIES = "/domain/servers/server/%instanceName%/system-properties";
-    public static final String URL_DAS_SYSTEM_PROPERTIES = URL_INSTANCE_SYSTEM_PROPERTIES.replaceAll("%instanceName%", "server");
-    public static final String URL_CREATE_INSTANCE = "/domain/create-instance";
-    public static final String PROP_VALUE = "${com.sun.aas.instanceRoot}/foo";
-
-    @Test
-    public void getSystemProperties() {
-        Response response = get(URL_DAS_SYSTEM_PROPERTIES);
-        checkStatusForSuccess(response);
-        List<Map<String, String>> systemProperties = getSystemProperties(MarshallingUtils.buildMapFromDocument(response.readEntity(String.class)));
-        assertNotNull(systemProperties); // This may or may not be empty, depending on whether or not other tests failed
-    }
-
-    @Test
-    public void createSystemProperties() {
-        final String prop1 = "property" + generateRandomString();
-        final String prop2 = "property" + generateRandomString();
-        Map<String, String> payload = new HashMap<String, String>() {{
-            put(prop1, "value1");
-            put(prop2, "value2");
-        }};
-        Response response = post(URL_DAS_SYSTEM_PROPERTIES, payload);
-        checkStatusForSuccess(response);
-        response = get(URL_DAS_SYSTEM_PROPERTIES);
-        List<Map<String, String>> systemProperties = getSystemProperties(MarshallingUtils.buildMapFromDocument(response.readEntity(String.class)));
-        assertNotNull(systemProperties); // This may or may not be empty, depending on whether or not other tests failed
-
-        int testPropsFound = 0;
-        for (Map<String, String> systemProperty : systemProperties) {
-            String name = (String)systemProperty.get("name");
-            if (prop1.equals(name) || prop2.equals(name)) {
-                testPropsFound++;
-            }
-        }
-
-        assertEquals(2, testPropsFound);
-
-        response = delete(URL_DAS_SYSTEM_PROPERTIES+"/"+prop1);
-        checkStatusForSuccess(response);
-        response = delete(URL_DAS_SYSTEM_PROPERTIES+"/"+prop2);
-        checkStatusForSuccess(response);
-    }
-
-    @Test
-    public void createPropertiesWithColons() {
-        final String prop1 = "property" + generateRandomString();
-        Map<String, String> payload = new HashMap<String, String>() {{
-            put(prop1, "http://localhost:4848");
-        }};
-        Response response = post(URL_DAS_SYSTEM_PROPERTIES, payload);
-        checkStatusForSuccess(response);
-        response = get(URL_DAS_SYSTEM_PROPERTIES);
-        List<Map<String, String>> systemProperties = getSystemProperties(MarshallingUtils.buildMapFromDocument(response.readEntity(String.class)));
-        assertNotNull(systemProperties); // This may or may not be empty, depending on whether or not other tests failed
-
-        int testPropsFound = 0;
-        for (Map<String, String> systemProperty : systemProperties) {
-            String name = (String)systemProperty.get("name");
-            if (prop1.equals(name)) {
-                testPropsFound++;
-            }
-        }
-
-        assertEquals(1, testPropsFound);
-
-        response = delete(URL_DAS_SYSTEM_PROPERTIES+"/"+prop1);
-        checkStatusForSuccess(response);
-    }
-
-    @Test
-    public void testNotResolvingDasSystemProperties() {
-        final String prop1 = "property" + generateRandomString();
-        Map<String, String> payload = new HashMap<String, String>() {{
-            put(prop1, PROP_VALUE);
-        }};
-        createAndTestConfigProperty(prop1, PROP_VALUE, "server-config");
-        createAndTestInstanceOverride(prop1, PROP_VALUE, PROP_VALUE+"-instace", "server");
-    }
-
-    @Test()
-    public void testNotResolvingDasInstanceProperties() {
-        final String instanceName = "in" + generateRandomNumber();
-        final String propertyName = "property" + generateRandomString();
-
-        Response cr = post(URL_CREATE_INSTANCE, new HashMap<String, String>() {{
-            put("id", instanceName);
-            put("node", "localhost-domain1");
-        }});
-        checkStatusForSuccess(cr);
-
-        createAndTestConfigProperty(propertyName, PROP_VALUE, instanceName + "-config");
-
-        createAndTestInstanceOverride(propertyName, PROP_VALUE, PROP_VALUE + "-instance", instanceName);
-    }
-
-    @Test()
-    public void testNotResolvingClusterProperties() {
-        final String propertyName = "property" + generateRandomString();
-        final String clusterName = "c" + generateRandomNumber();
-        final String instanceName = clusterName + "in" + generateRandomNumber();
-        ClusterTest ct = new ClusterTest();
-        ct.setup();
-        ct.createCluster(clusterName);
-        ct.createClusterInstance(clusterName, instanceName);
-
-        createAndTestConfigProperty(propertyName, PROP_VALUE, clusterName + "-config");
-        createAndTestClusterOverride(propertyName, PROP_VALUE, PROP_VALUE + "-cluster", clusterName);
-        createAndTestInstanceOverride(propertyName, PROP_VALUE+"-cluster", PROP_VALUE + "-instance", instanceName);
-
-        ct.deleteCluster(clusterName);
-    }
-
-    protected void createAndTestConfigProperty(final String propertyName, final String propertyValue, String configName) {
-        final String url = URL_CONFIG_SYSTEM_PROPERTIES.replaceAll("%config%", configName);
-        Response response = get(url);
-        Map<String, String> payload = getSystemPropertiesMap(getSystemProperties(MarshallingUtils.buildMapFromDocument(response.readEntity(String.class))));
-        payload.put(propertyName, propertyValue);
-        response = post(url, payload);
-        checkStatusForSuccess(response);
-
-            // Check config props
-        response = get(url);
-        List<Map<String, String>> systemProperties = getSystemProperties(MarshallingUtils.buildMapFromDocument(response.readEntity(String.class)));
-        Map<String, String> sysProp = getSystemProperty(propertyName, systemProperties);
-        assertNotNull(sysProp);
-        assertEquals(sysProp.get("value"), propertyValue);
-    }
-
-    protected void createAndTestClusterOverride(final String propertyName, final String defaultValue, final String propertyValue, final String clusterName) {
-        final String clusterSysPropsUrl = URL_CLUSTER_SYSTEM_PROPERTIES.replaceAll("%clusterName%", clusterName);
-
-        Response response = get(clusterSysPropsUrl);
-        List<Map<String, String>> systemProperties = getSystemProperties(MarshallingUtils.buildMapFromDocument(response.readEntity(String.class)));
-        Map<String, String> sysProp = getSystemProperty(propertyName, systemProperties);
-        assertNotNull(sysProp);
-        assertEquals(sysProp.get("defaultValue"), defaultValue);
-
-        response = post(clusterSysPropsUrl, new HashMap<String, String>() {{
-            put(propertyName, propertyValue);
-        }});
-        checkStatusForSuccess(response);
-
-        // Check updated/overriden system property
-        response = get(clusterSysPropsUrl);
-        systemProperties = getSystemProperties(MarshallingUtils.buildMapFromDocument(response.readEntity(String.class)));
-        sysProp = getSystemProperty(propertyName, systemProperties);
-        assertNotNull(sysProp);
-        assertEquals(sysProp.get("value"), propertyValue);
-        assertEquals(sysProp.get("defaultValue"), defaultValue);
-    }
-
-    protected void createAndTestInstanceOverride(final String propertyName, final String defaultValue, final String propertyValue, final String instanceName) {
-        final String instanceSysPropsUrl = URL_INSTANCE_SYSTEM_PROPERTIES.replaceAll("%instanceName%", instanceName);
-
-        Response response = get(instanceSysPropsUrl);
-        List<Map<String, String>> systemProperties = getSystemProperties(MarshallingUtils.buildMapFromDocument(response.readEntity(String.class)));
-        Map<String, String> sysProp = getSystemProperty(propertyName, systemProperties);
-        assertNotNull(sysProp);
-        assertEquals(sysProp.get("defaultValue"), defaultValue);
-
-        response = post(instanceSysPropsUrl, new HashMap<String, String>() {{
-            put(propertyName, propertyValue);
-        }});
-        checkStatusForSuccess(response);
-
-        // Check updated/overriden system property
-        response = get(instanceSysPropsUrl);
-        systemProperties = getSystemProperties(MarshallingUtils.buildMapFromDocument(response.readEntity(String.class)));
-        sysProp = getSystemProperty(propertyName, systemProperties);
-        assertNotNull(sysProp);
-        assertEquals(sysProp.get("value"), propertyValue);
-        assertEquals(sysProp.get("defaultValue"), defaultValue);
-    }
-
-    private List<Map<String, String>> getSystemProperties(Map<String, Object> responseMap) {
-        Map<String, Object> extraProperties = (Map<String, Object>)responseMap.get("extraProperties");
-        return (List<Map<String, String>>)extraProperties.get("systemProperties");
-    }
-
-    private Map<String, String> getSystemProperty(String propName, List<Map<String, String>> systemProperties) {
-        for (Map<String, String> sysProp : systemProperties) {
-            if (sysProp.get("name").equals(propName)) {
-                return sysProp;
-            }
-        }
-
-        return null;
-    }
-
-    private Map<String, String> getSystemPropertiesMap (List<Map<String, String>> propsList) {
-        Map<String, String> allPropsMap = new HashMap();
-        for (Map<String, String> sysProp : propsList) {
-            allPropsMap.put(sysProp.get("name"),  sysProp.get("value"));
-        }
-        return allPropsMap;
-    }
-
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/TokenAuthenticationTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/TokenAuthenticationTest.java
deleted file mode 100644
index 416ee21..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/TokenAuthenticationTest.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.rest;
-
-import java.util.HashMap;
-import java.util.Map;
-import jakarta.ws.rs.core.Cookie;
-import jakarta.ws.rs.core.Response;
-import org.glassfish.admin.rest.client.utils.MarshallingUtils;
-import static org.testng.AssertJUnit.*;
-import org.testng.annotations.Test;
-
-/**
- * @author Mitesh Meswani
- */
-public class TokenAuthenticationTest extends RestTestBase {
-    private static final String URL_DOMAIN_SESSIONS = "/sessions";
-    private static final String URL_CREATE_USER = "/domain/configs/config/server-config/security-service/auth-realm/admin-realm/create-user";
-    private static final String URL_DELETE_USER = "/domain/configs/config/server-config/security-service/auth-realm/admin-realm/delete-user";
-    private static final String GF_REST_TOKEN_COOKIE_NAME = "gfresttoken";
-    private static final String TEST_GROUP = "newgroup";
-
-    @Test
-    public void testTokenCreateAndDelete() {
-        deleteUserAuthTestUser(null); // just in case
-        //Verify a session token got created
-        String token = getSessionToken();
-
-        // Verify we can use the session token.
-        Response response = getClient().target(getAddress("/domain")).request().cookie(new Cookie(GF_REST_TOKEN_COOKIE_NAME, token)).get(Response.class);
-        assertTrue(isSuccess(response));
-
-        //Delete the token
-        response = getClient().target(getAddress(URL_DOMAIN_SESSIONS) + "/" + token).request().cookie(new Cookie(GF_REST_TOKEN_COOKIE_NAME, token)).delete(Response.class);
-        delete(URL_DOMAIN_SESSIONS);
-        assertTrue(isSuccess(response));
-    }
-
-    @Test
-    public void testAuthRequired() {
-        Map<String, String> newUser = new HashMap<String, String>() {{
-            put("id", AUTH_USER_NAME);
-            put("groups", "asadmin");
-            put("authrealmname", "admin-realm");
-            put("AS_ADMIN_USERPASSWORD", AUTH_PASSWORD);
-        }};
-        String token = null;
-
-        try {
-            // Delete the test user if it exists
-            deleteUserAuthTestUser(token);
-
-            // Verify that we can get unauthenticated access to the server
-            Response response = get("/domain");
-            assertTrue(isSuccess(response));
-
-            // Create the new user
-            response = post(URL_CREATE_USER, newUser);
-            assertTrue(isSuccess(response));
-
-            // Verify that we must now authentication (response.status = 401)
-            response = get("/domain");
-            assertFalse(isSuccess(response));
-
-            // Authenticate, get the token, then "clear" the authentication
-            authenticate();
-            token = getSessionToken();
-            resetClient();
-
-            // Build this request manually so we can pass the cookie
-            response = getClient().target(getAddress("/domain")).request().cookie(new Cookie(GF_REST_TOKEN_COOKIE_NAME, token)).get(Response.class);
-            assertTrue(isSuccess(response));
-            resetClient();
-
-            // Request again w/o the cookie.  This should fail.
-            response = getClient().target(getAddress("/domain")).request().get(Response.class);
-            assertFalse(isSuccess(response));
-            authenticate();
-        } finally {
-            // Clean up after ourselves
-            deleteUserAuthTestUser(token);
-        }
-    }
-
-    protected String getSessionToken() {
-        Response response = post(URL_DOMAIN_SESSIONS);
-        assertTrue(isSuccess(response));
-        Map<String, Object> responseMap = MarshallingUtils.buildMapFromDocument(response.readEntity(String.class));
-        Map<String, Object> extraProperties = (Map<String, Object>)responseMap.get("extraProperties");
-        return (String)extraProperties.get("token");
-    }
-
-    private void deleteUserAuthTestUser(String token) {
-        if (token != null) {
-            final String address = getAddress(URL_DELETE_USER);
-            Response response = getClient().target(address).queryParam("id", AUTH_USER_NAME).request()
-                    .cookie(new Cookie(GF_REST_TOKEN_COOKIE_NAME, token)).delete(Response.class);
-            assertTrue(isSuccess(response));
-            resetClient();
-        } else {
-            Response response = delete(URL_DELETE_USER, new HashMap<String, String>() {{ put("id", AUTH_USER_NAME); }});
-            if (response.getStatus() == 401) {
-                authenticate();
-                response = delete(URL_DELETE_USER, new HashMap<String, String>() {{ put("id", AUTH_USER_NAME); }});
-                assertTrue(isSuccess(response));
-                resetClient();
-            }
-        }
-    }
-}
diff --git a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/UtilityTest.java b/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/UtilityTest.java
deleted file mode 100644
index 4d8b526..0000000
--- a/nucleus/tests/admin/src/test/java/org/glassfish/nucleus/admin/rest/UtilityTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0, which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * This Source Code may also be made available under the following Secondary
- * Licenses when the conditions for such availability set forth in the
- * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
- * version 2 with the GNU Classpath Exception, which is available at
- * https://www.gnu.org/software/classpath/license.html.
- *
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
- */
-
-package org.glassfish.nucleus.admin.rest;
-
-/**
- *
- * @author jdlee
- */
-public class UtilityTest {
-
-    // TODO - JERSEY2
-//    @Test
-//    public void parameterResolutionTest() {
-//        WebApplicationImpl wai = new WebApplicationImpl();
-//        ContainerRequest r = new TestHttpRequestContext(wai,
-//                "GET",
-//                null,
-//                "/management/domain/one/two/three/four/five/six/seven/eight/nine/ten/endpoint",
-//                "/management/domain/");
-//        UriInfo ui = new WebApplicationContext(wai, r, null);
-//        Map<String, String> commandParams = new HashMap<String, String>() {{
-//           put("foo", "$parent");
-//           put("bar", "$grandparent3");
-//           put("baz", "$grandparent5");
-//        }};
-//
-//        ResourceUtil.resolveParamValues(commandParams, ui);
-//        assertEquals("ten", commandParams.get("foo"));
-//        assertEquals("seven", commandParams.get("bar"));
-//        assertEquals("five", commandParams.get("baz"));
-//    }
-//
-//    private class TestHttpRequestContext extends ContainerRequest {
-//
-//        public TestHttpRequestContext(
-//                WebApplication wa,
-//                String method,
-//                InputStream entity,
-//                String completeUri,
-//                String baseUri) {
-//
-//            super(wa, method, URI.create(baseUri), URI.create(completeUri), new InBoundHeaders(), entity);
-//        }
-//    }
-}
diff --git a/nucleus/tests/pom.xml b/nucleus/tests/pom.xml
deleted file mode 100755
index 72ade32..0000000
--- a/nucleus/tests/pom.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
-
-    This program and the accompanying materials are made available under the
-    terms of the Eclipse Public License v. 2.0, which is available at
-    http://www.eclipse.org/legal/epl-2.0.
-
-    This Source Code may also be made available under the following Secondary
-    Licenses when the conditions for such availability set forth in the
-    Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
-    version 2 with the GNU Classpath Exception, which is available at
-    https://www.gnu.org/software/classpath/license.html.
-
-    SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-
--->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.glassfish.main</groupId>
-        <artifactId>glassfish-nucleus-parent</artifactId>
-        <version>7.0.0-SNAPSHOT</version>
-    </parent>
-
-    <groupId>org.glassfish.main.tests</groupId>
-    <artifactId>nucleus-tests</artifactId>
-    <packaging>pom</packaging>
-
-    <name>Nucleus Tests</name>
-
-    <modules>
-        <module>admin</module>
-    </modules>
-
-    <dependencyManagement>
-        <dependencies>
-            <dependency>
-                <groupId>jakarta.servlet</groupId>
-                <artifactId>jakarta.servlet-api</artifactId>
-                <version>${servlet-api.version}</version>
-            </dependency>
-        </dependencies>
-    </dependencyManagement>
-
-    <build>
-        <pluginManagement>
-            <plugins>
-                <plugin>
-                    <groupId>org.codehaus.mojo</groupId>
-                    <artifactId>findbugs-maven-plugin</artifactId>
-                    <configuration>
-                        <skip>true</skip>
-                    </configuration>
-                </plugin>
-            </plugins>
-        </pluginManagement>
-
-        <plugins>
-            <plugin>
-                <artifactId>maven-javadoc-plugin</artifactId>
-                <configuration>
-                    <skip>true</skip>
-                </configuration>
-            </plugin>
-            <plugin>
-                <artifactId>maven-deploy-plugin</artifactId>
-                <configuration>
-                    <skip>true</skip>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-</project>
diff --git a/pom.xml b/pom.xml
index 4bb18c5..72595bd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.eclipse.ee4j</groupId>
         <artifactId>project</artifactId>
-        <version>1.0.6</version>
+        <version>1.0.7</version>
     </parent>
 
     <groupId>org.glassfish.main</groupId>
@@ -50,7 +50,7 @@
             <plugins>
                 <plugin>
                     <artifactId>maven-deploy-plugin</artifactId>
-                    <version>2.7</version>
+                    <version>3.0.0-M2</version>
                     <configuration>
                         <skip>true</skip>
                     </configuration>
@@ -71,10 +71,8 @@
             </plugins>
         </pluginManagement>
         <plugins>
-            <!-- Sets minimal Maven version to 3.5.4 -->
             <plugin>
                 <artifactId>maven-enforcer-plugin</artifactId>
-                <version>3.0.0</version>
                 <executions>
                     <execution>
                         <id>enforce-maven</id>
@@ -84,7 +82,7 @@
                         <configuration>
                             <rules>
                                 <requireMavenVersion>
-                                    <version>3.5.4</version>
+                                    <version>3.6.0</version>
                                 </requireMavenVersion>
                             </rules>
                         </configuration>
@@ -135,9 +133,9 @@
                 <module>appserver</module>
                 <module>nucleus/hk2/config-generator</module>
                 <module>docs</module>
-                <module>appserver/admingui/devtests</module>
                 <module>appserver/extras/embedded/common</module>
-                <module>nucleus/tests</module>
+                <module>appserver/tests/appserv-tests/util/reportbuilder</module>
+                <module>appserver/tests/tck</module>
             </modules>
         </profile>
 
@@ -148,7 +146,7 @@
                     <plugin>
                         <groupId>org.jacoco</groupId>
                         <artifactId>jacoco-maven-plugin</artifactId>
-                        <version>0.8.7</version>
+                        <version>0.8.8</version>
                         <executions>
                             <execution>
                                 <id>jacoco-merge</id>