diff --git a/appserver/packager/microprofile-package/pom.xml b/appserver/packager/microprofile-package/pom.xml
index 420a7052d50..5fddd69fb51 100644
--- a/appserver/packager/microprofile-package/pom.xml
+++ b/appserver/packager/microprofile-package/pom.xml
@@ -2,7 +2,7 @@
diff --git a/appserver/payara-appserver-modules/microprofile/config/pom.xml b/appserver/payara-appserver-modules/microprofile/config/pom.xml
index 92c76d6ef3f..c2b5dadb84a 100644
--- a/appserver/payara-appserver-modules/microprofile/config/pom.xml
+++ b/appserver/payara-appserver-modules/microprofile/config/pom.xml
@@ -63,11 +63,26 @@
microprofile-config-service${project.version}
+
+ fish.payara.server.internal.payara-appserver-modules
+ microprofile-connector
+ ${project.version}
+ fish.payara.server.internal.commoninternal-api${project.version}
+
+ fish.payara.server.internal.web
+ web-glue
+ ${project.version}
+
+
+ fish.payara.server.internal.web
+ weld-integration
+ ${project.version}
+ jakarta.annotationjakarta.annotation-api
diff --git a/appserver/payara-appserver-modules/microprofile/config/src/main/java/fish/payara/microprofile/config/activation/ConfigApplicationContainer.java b/appserver/payara-appserver-modules/microprofile/config/src/main/java/fish/payara/microprofile/config/activation/ConfigApplicationContainer.java
new file mode 100644
index 00000000000..d8e64ac57ab
--- /dev/null
+++ b/appserver/payara-appserver-modules/microprofile/config/src/main/java/fish/payara/microprofile/config/activation/ConfigApplicationContainer.java
@@ -0,0 +1,61 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) [2020] Payara Foundation and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://github.com/payara/Payara/blob/master/LICENSE.txt
+ * See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at glassfish/legal/LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * The Payara Foundation designates this particular file as subject to the "Classpath"
+ * exception as provided by the Payara Foundation in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+package fish.payara.microprofile.config.activation;
+
+import org.eclipse.microprofile.config.ConfigProvider;
+import org.glassfish.api.deployment.ApplicationContext;
+import org.glassfish.api.deployment.DeploymentContext;
+
+import fish.payara.microprofile.connector.MicroProfileApplicationContainer;
+
+public class ConfigApplicationContainer extends MicroProfileApplicationContainer {
+
+ protected ConfigApplicationContainer(DeploymentContext deploymentContext) {
+ super(deploymentContext);
+ }
+
+ @Override
+ public boolean start(ApplicationContext ctx) throws Exception {
+ // Needed to make sure that the Config Sources are created at the right stage during deployment
+ ConfigProvider.getConfig();
+ return true;
+ }
+
+}
diff --git a/appserver/payara-appserver-modules/microprofile/config/src/main/java/fish/payara/microprofile/config/activation/ConfigContainer.java b/appserver/payara-appserver-modules/microprofile/config/src/main/java/fish/payara/microprofile/config/activation/ConfigContainer.java
new file mode 100644
index 00000000000..c91e3034f46
--- /dev/null
+++ b/appserver/payara-appserver-modules/microprofile/config/src/main/java/fish/payara/microprofile/config/activation/ConfigContainer.java
@@ -0,0 +1,62 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) [2020] Payara Foundation and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://github.com/payara/Payara/blob/master/LICENSE.txt
+ * See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at glassfish/legal/LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * The Payara Foundation designates this particular file as subject to the "Classpath"
+ * exception as provided by the Payara Foundation in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+package fish.payara.microprofile.config.activation;
+
+import org.glassfish.api.deployment.Deployer;
+import org.glassfish.hk2.api.PerLookup;
+import org.jvnet.hk2.annotations.Service;
+
+import fish.payara.microprofile.connector.MicroProfileContainer;
+
+@Service(name = "fish.payara.microprofile.config.activation.ConfigContainer")
+@PerLookup
+public class ConfigContainer extends MicroProfileContainer {
+
+ @Override
+ public Class extends Deployer, ?>> getDeployer() {
+ return ConfigDeployer.class;
+ }
+
+ @Override
+ public String getName() {
+ return "ConfigContainer";
+ }
+
+}
diff --git a/appserver/payara-appserver-modules/microprofile/config/src/main/java/fish/payara/microprofile/config/activation/ConfigDeployer.java b/appserver/payara-appserver-modules/microprofile/config/src/main/java/fish/payara/microprofile/config/activation/ConfigDeployer.java
new file mode 100644
index 00000000000..cb0b29f8aa2
--- /dev/null
+++ b/appserver/payara-appserver-modules/microprofile/config/src/main/java/fish/payara/microprofile/config/activation/ConfigDeployer.java
@@ -0,0 +1,92 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) [2020] Payara Foundation and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://github.com/payara/Payara/blob/master/LICENSE.txt
+ * See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at glassfish/legal/LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * The Payara Foundation designates this particular file as subject to the "Classpath"
+ * exception as provided by the Payara Foundation in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+package fish.payara.microprofile.config.activation;
+
+import java.util.Collection;
+import java.util.function.Supplier;
+
+import javax.enterprise.inject.spi.Extension;
+
+import org.eclipse.microprofile.config.Config;
+import org.eclipse.microprofile.config.inject.ConfigProperty;
+import org.glassfish.api.deployment.DeploymentContext;
+import org.glassfish.hk2.api.PerLookup;
+import org.glassfish.hk2.classmodel.reflect.Type;
+import org.glassfish.hk2.classmodel.reflect.Types;
+import org.glassfish.weld.WeldDeployer;
+import org.jvnet.hk2.annotations.Service;
+
+import fish.payara.microprofile.config.cdi.ConfigCdiExtension;
+import fish.payara.microprofile.connector.MicroProfileDeployer;
+
+@Service
+@PerLookup
+public class ConfigDeployer extends MicroProfileDeployer {
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public ConfigApplicationContainer load(ConfigContainer container,
+ DeploymentContext deploymentContext) {
+
+ // Perform annotation scanning to see if CDI extension is required here
+ // This is performed here so that the ApplicationContainer executes regardless of CDI extension state
+ final Types types = deploymentContext.getTransientAppMetaData(Types.class.getName(), Types.class);
+
+ final Type annotationType = types.getBy(ConfigProperty.class.getName());
+ final Type classType = types.getBy(Config.class.getName());
+ final boolean annotationFound = annotationType != null;
+ final boolean classFound = classType != null;
+
+ if (annotationFound || classFound) {
+ // Register the CDI extension
+ final Collection> snifferExtensions = deploymentContext.getTransientAppMetaData(WeldDeployer.SNIFFER_EXTENSIONS, Collection.class);
+ if (snifferExtensions != null) {
+ snifferExtensions.add(ConfigCdiExtension::new);
+ }
+ }
+
+ return new ConfigApplicationContainer(deploymentContext);
+ }
+
+ @Override
+ public void unload(ConfigApplicationContainer applicationContainer, DeploymentContext ctx) {
+ }
+
+}
diff --git a/appserver/payara-appserver-modules/microprofile/config/src/main/java/fish/payara/microprofile/config/activation/ConfigSniffer.java b/appserver/payara-appserver-modules/microprofile/config/src/main/java/fish/payara/microprofile/config/activation/ConfigSniffer.java
new file mode 100644
index 00000000000..c3bf0625ac1
--- /dev/null
+++ b/appserver/payara-appserver-modules/microprofile/config/src/main/java/fish/payara/microprofile/config/activation/ConfigSniffer.java
@@ -0,0 +1,75 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) [2020] Payara Foundation and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://github.com/payara/Payara/blob/master/LICENSE.txt
+ * See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at glassfish/legal/LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * The Payara Foundation designates this particular file as subject to the "Classpath"
+ * exception as provided by the Payara Foundation in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+package fish.payara.microprofile.config.activation;
+
+import java.lang.annotation.Annotation;
+
+import org.glassfish.api.deployment.archive.ReadableArchive;
+import org.glassfish.hk2.api.PerLookup;
+import org.jvnet.hk2.annotations.Service;
+
+import fish.payara.microprofile.connector.MicroProfileSniffer;
+
+@Service
+@PerLookup
+public class ConfigSniffer extends MicroProfileSniffer {
+
+ @Override
+ public boolean handles(ReadableArchive archive) {
+ // Defer annotation processing to the deployer to make sure the ConfigProvider is started correctly
+ return true;
+ }
+
+ @Override
+ public Class extends Annotation>[] getAnnotationTypes() {
+ return null;
+ }
+
+ @Override
+ protected Class> getContainersClass() {
+ return ConfigContainer.class;
+ }
+
+ @Override
+ public String getModuleType() {
+ return "config";
+ }
+
+}
diff --git a/appserver/payara-appserver-modules/microprofile/config/src/main/java/fish/payara/microprofile/config/cdi/CDIExtension.java b/appserver/payara-appserver-modules/microprofile/config/src/main/java/fish/payara/microprofile/config/cdi/ConfigCdiExtension.java
similarity index 99%
rename from appserver/payara-appserver-modules/microprofile/config/src/main/java/fish/payara/microprofile/config/cdi/CDIExtension.java
rename to appserver/payara-appserver-modules/microprofile/config/src/main/java/fish/payara/microprofile/config/cdi/ConfigCdiExtension.java
index e0ba844a37f..7582a53f76c 100644
--- a/appserver/payara-appserver-modules/microprofile/config/src/main/java/fish/payara/microprofile/config/cdi/CDIExtension.java
+++ b/appserver/payara-appserver-modules/microprofile/config/src/main/java/fish/payara/microprofile/config/cdi/ConfigCdiExtension.java
@@ -58,7 +58,7 @@
* CDI extension that implements the Microprofile Config API ConfigProperty injection
* @author Steve Millidge
*/
-public class CDIExtension implements Extension {
+public class ConfigCdiExtension implements Extension {
public void validateInjectionPoint(@Observes ProcessInjectionPoint, ?> pip) {
diff --git a/appserver/payara-appserver-modules/microprofile/config/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension b/appserver/payara-appserver-modules/microprofile/config/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
deleted file mode 100644
index 61878986fdb..00000000000
--- a/appserver/payara-appserver-modules/microprofile/config/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
+++ /dev/null
@@ -1 +0,0 @@
-fish.payara.microprofile.config.cdi.CDIExtension
\ No newline at end of file
diff --git a/appserver/payara-appserver-modules/microprofile/fault-tolerance/pom.xml b/appserver/payara-appserver-modules/microprofile/fault-tolerance/pom.xml
index c7b0163fe03..b1fc9439c17 100644
--- a/appserver/payara-appserver-modules/microprofile/fault-tolerance/pom.xml
+++ b/appserver/payara-appserver-modules/microprofile/fault-tolerance/pom.xml
@@ -2,7 +2,7 @@
+
+ 4.0.0
+
+
+ fish.payara.server.internal.payara-appserver-modules
+ microprofile
+ 5.2020.7-SNAPSHOT
+
+
+ microprofile-connector
+ glassfish-jar
+
+ Microprofile - Connector
+
+
+
+ fish.payara.server.internal.common
+ internal-api
+ ${project.version}
+
+
+ fish.payara.server.internal.deployment
+ deployment-common
+ ${project.version}
+
+
+
+
+ fish.payara.server.internal.web
+ gf-web-connector
+ ${project.version}
+
+
+ fish.payara.server.internal.ejb
+ gf-ejb-connector
+ ${project.version}
+
+
+ fish.payara.server.internal.deployment
+ dol
+ ${project.version}
+
+
+
diff --git a/appserver/payara-appserver-modules/microprofile/microprofile-connector/src/main/java/fish/payara/microprofile/connector/MicroProfileApplicationContainer.java b/appserver/payara-appserver-modules/microprofile/microprofile-connector/src/main/java/fish/payara/microprofile/connector/MicroProfileApplicationContainer.java
new file mode 100644
index 00000000000..129bcd4688e
--- /dev/null
+++ b/appserver/payara-appserver-modules/microprofile/microprofile-connector/src/main/java/fish/payara/microprofile/connector/MicroProfileApplicationContainer.java
@@ -0,0 +1,88 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) [2020] Payara Foundation and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://github.com/payara/Payara/blob/master/LICENSE.txt
+ * See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at glassfish/legal/LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * The Payara Foundation designates this particular file as subject to the "Classpath"
+ * exception as provided by the Payara Foundation in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+package fish.payara.microprofile.connector;
+
+import org.glassfish.api.deployment.ApplicationContainer;
+import org.glassfish.api.deployment.ApplicationContext;
+import org.glassfish.api.deployment.DeploymentContext;
+
+public abstract class MicroProfileApplicationContainer implements ApplicationContainer