Repository: pinpoint-apm/pinpoint
Issue: Allow conditional registration of transformers for when JBoss and Tomcat plugins are both enabled
Labels: enhancement

JBoss and Tomcat plugins both add transformers for `org.apache.catalina.core.StandardHostValve`.  
When both plugins are enabled, the agent throws an exception, complaining that there are more than 1 transformer for the class and it does not know which one to use for instrumentation.

The best solution would be to have the agent "automagically" figure out which transformer to use when the class is loaded, but this is currently out of reach.
Instead, we'll simply (and crudely) add conditional checks that does the following:
- If the application is a Tomcat application, or a SpringBoot application (launched by their respective main-classes), add Tomcat transformers.
- If the application is a JBoss application, add JBoss transformers.

There should also be an option that disables these checks completely in _pinpoint.config_ - `profiler.tomcat.conditional.transform`, `profiler.jboss.conditional.transform`.

One drawback to the solution above would be that standalone applications that run embedded Tomcat (or SpringBoot applications running Tomcat launched from an IDE) will not automatically register Tomcat transformers for their relevant classes. For such cases, `profiler.tomcat.conditional.transform` should be set to `false`.


Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/agent/src/main/resources-local/pinpoint.config b/agent/src/main/resources-local/pinpoint.config
index 265767ad7530..54a256029d61 100644
--- a/agent/src/main/resources-local/pinpoint.config
+++ b/agent/src/main/resources-local/pinpoint.config
@@ -120,9 +120,17 @@ profiler.entrypoint=
 profiler.tomcat.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.tomcat.bootstrap.main=org.apache.catalina.startup.Bootstrap
+# Check pre-conditions when registering class file transformers mainly due to JBoss plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.apache.catalina.startup.Bootstrap,
+# or SpringBoot's launchers.
+# Set this to false to bypass this check entirely (such as when launching standalone applications running embedded Tomcat).
+profiler.tomcat.conditional.transform=true
 # Hide pinpoint headers.
 profiler.tomcat.hidepinpointheader=true
+# URLs to exclude from tracing
 profiler.tomcat.excludeurl=/aa/test.html, /bb/exclude.html
+# HTTP Request methods to exclude from tracing
+#profiler.tomcat.excludemethod=
 profiler.tomcat.tracerequestparam=true
 
 # original IP address header
@@ -140,6 +148,7 @@ profiler.tomcat.tracerequestparam=true
 profiler.jetty.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jetty.bootstrap.main=org.eclipse.jetty.start.Main
+# URLs to exclude from tracing
 profiler.jetty.excludeUrl=
 
 
@@ -154,9 +163,28 @@ profiler.dubbo.bootstrap.main=com.alibaba.dubbo.container.Main
 ###########################################################
 # JBOSS                                                   #
 ###########################################################
-profiler.jboss.enable=false
+profiler.jboss.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jboss.bootstrap.main=org.jboss.modules.Main
+# Check pre-conditions when registering class file transformers mainly due to Tomcat plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.jboss.modules.Main.
+# Set this to false to bypass this check entirely.
+profiler.jboss.conditional.transform=true
+# Hide pinpoint headers.
+profiler.jboss.hidepinpointheader=true
+# URLs to exclude from tracing
+profiler.jboss.excludeurl=
+# HTTP Request methods to exclude from tracing
+#profiler.jboss.excludemethod=
+profiler.jboss.tracerequestparam=true
+
+# original IP address header
+# https://en.wikipedia.org/wiki/X-Forwarded-For
+#profiler.jboss.realipheader=X-Forwarded-For
+# nginx real ip header
+#profiler.jboss.realipheader=X-Real-IP
+# optional parameter, If the header value is ${profiler.jboss.realipemptyvalue}, Ignore header value.
+#profiler.jboss.realipemptyvalue=unknown
 
 
 ###########################################################
diff --git a/agent/src/main/resources-release/pinpoint.config b/agent/src/main/resources-release/pinpoint.config
index 4ebec25be7f5..d0e655c8d090 100644
--- a/agent/src/main/resources-release/pinpoint.config
+++ b/agent/src/main/resources-release/pinpoint.config
@@ -116,8 +116,14 @@ profiler.entrypoint=
 profiler.tomcat.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.tomcat.bootstrap.main=org.apache.catalina.startup.Bootstrap
+# Check pre-conditions when registering class file transformers mainly due to JBoss plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.apache.catalina.startup.Bootstrap,
+# or SpringBoot's launchers.
+# Set this to false to bypass this check entirely (such as when launching standalone applications running embedded Tomcat).
+profiler.tomcat.conditional.transform=true
 # Hide pinpoint headers.
 profiler.tomcat.hidepinpointheader=true
+# URLs to exclude from tracing
 profiler.tomcat.excludeurl=/aa/test.html, /bb/exclude.html
 profiler.tomcat.tracerequestparam=true
 
@@ -136,6 +142,7 @@ profiler.tomcat.tracerequestparam=true
 profiler.jetty.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jetty.bootstrap.main=org.eclipse.jetty.start.Main
+# URLs to exclude from tracing
 profiler.jetty.excludeUrl=
 
 
@@ -150,9 +157,28 @@ profiler.dubbo.bootstrap.main=com.alibaba.dubbo.container.Main
 ###########################################################
 # JBOSS                                                   #
 ###########################################################
-profiler.jboss.enable=false
+profiler.jboss.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jboss.bootstrap.main=org.jboss.modules.Main
+# Check pre-conditions when registering class file transformers mainly due to Tomcat plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.jboss.modules.Main.
+# Set this to false to bypass this check entirely.
+profiler.jboss.conditional.transform=true
+# Hide pinpoint headers.
+profiler.jboss.hidepinpointheader=true
+# URLs to exclude from tracing
+profiler.jboss.excludeurl=
+# HTTP Request methods to exclude from tracing
+#profiler.jboss.excludemethod=
+profiler.jboss.tracerequestparam=true
+
+# original IP address header
+# https://en.wikipedia.org/wiki/X-Forwarded-For
+#profiler.jboss.realipheader=X-Forwarded-For
+# nginx real ip header
+#profiler.jboss.realipheader=X-Real-IP
+# optional parameter, If the header value is ${profiler.jboss.realipemptyvalue}, Ignore header value.
+#profiler.jboss.realipemptyvalue=unknown
 
 
 ###########################################################
diff --git a/agent/src/main/resources/pinpoint-real-env-lowoverhead-sample.config b/agent/src/main/resources/pinpoint-real-env-lowoverhead-sample.config
index 44faab44b9b5..f7189b224f9b 100644
--- a/agent/src/main/resources/pinpoint-real-env-lowoverhead-sample.config
+++ b/agent/src/main/resources/pinpoint-real-env-lowoverhead-sample.config
@@ -107,8 +107,14 @@ profiler.entrypoint=
 profiler.tomcat.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.tomcat.bootstrap.main=org.apache.catalina.startup.Bootstrap
+# Check pre-conditions when registering class file transformers mainly due to JBoss plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.apache.catalina.startup.Bootstrap,
+# or SpringBoot's launchers.
+# Set this to false to bypass this check entirely (such as when launching standalone applications running embedded Tomcat).
+profiler.tomcat.conditional.transform=true
 # Hide pinpoint headers.
 profiler.tomcat.hidepinpointheader=true
+# URLs to exclude from tracing
 profiler.tomcat.excludeurl=/aa/test.html, /bb/exclude.html
 profiler.tomcat.tracerequestparam=true
 
@@ -127,6 +133,7 @@ profiler.tomcat.tracerequestparam=true
 profiler.jetty.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jetty.bootstrap.main=org.eclipse.jetty.start.Main
+# URLs to exclude from tracing
 profiler.jetty.excludeUrl=
 
 
@@ -141,9 +148,28 @@ profiler.dubbo.bootstrap.main=com.alibaba.dubbo.container.Main
 ###########################################################
 # JBOSS                                                   #
 ###########################################################
-profiler.jboss.enable=false
+profiler.jboss.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jboss.bootstrap.main=org.jboss.modules.Main
+# Check pre-conditions when registering class file transformers mainly due to Tomcat plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.jboss.modules.Main.
+# Set this to false to bypass this check entirely.
+profiler.jboss.conditional.transform=true
+# Hide pinpoint headers.
+profiler.jboss.hidepinpointheader=true
+# URLs to exclude from tracing
+profiler.jboss.excludeurl=
+# HTTP Request methods to exclude from tracing
+#profiler.jboss.excludemethod=
+profiler.jboss.tracerequestparam=true
+
+# original IP address header
+# https://en.wikipedia.org/wiki/X-Forwarded-For
+#profiler.jboss.realipheader=X-Forwarded-For
+# nginx real ip header
+#profiler.jboss.realipheader=X-Real-IP
+# optional parameter, If the header value is ${profiler.jboss.realipemptyvalue}, Ignore header value.
+#profiler.jboss.realipemptyvalue=unknown
 
 
 ###########################################################
diff --git a/plugins/jboss/src/main/java/com/navercorp/pinpoint/plugin/jboss/JbossConfig.java b/plugins/jboss/src/main/java/com/navercorp/pinpoint/plugin/jboss/JbossConfig.java
index dd7ab00fcdad..548ff6fd041f 100644
--- a/plugins/jboss/src/main/java/com/navercorp/pinpoint/plugin/jboss/JbossConfig.java
+++ b/plugins/jboss/src/main/java/com/navercorp/pinpoint/plugin/jboss/JbossConfig.java
@@ -42,6 +42,7 @@ public class JbossConfig {
     private final boolean jbossEnable;
 
     private final List<String> jbossBootstrapMains;
+    private final boolean jbossConditionalTransformEnable;
 
     private final String jbossRealIpHeader;
     private final String jbossRealIpEmptyValue;
@@ -58,6 +59,7 @@ public JbossConfig(final ProfilerConfig config) {
         this.jbossTraceEjb = config.readBoolean("profiler.jboss.traceEjb", false);
 
         this.jbossBootstrapMains = config.readList("profiler.jboss.bootstrap.main");
+        this.jbossConditionalTransformEnable = config.readBoolean("profiler.jboss.conditional.transform", true);
         this.jbossHidePinpointHeader = config.readBoolean("profiler.jboss.hidepinpointheader", true);
 
         this.jbossTraceRequestParam = config.readBoolean("profiler.jboss.tracerequestparam", true);
@@ -86,6 +88,10 @@ public List<String> getJbossBootstrapMains() {
         return jbossBootstrapMains;
     }
 
+    public boolean isJbossConditionalTransformEnable() {
+        return jbossConditionalTransformEnable;
+    }
+
     /**
      * Checks if is jboss hide pinpoint header.
      *
diff --git a/plugins/jboss/src/main/java/com/navercorp/pinpoint/plugin/jboss/JbossPlugin.java b/plugins/jboss/src/main/java/com/navercorp/pinpoint/plugin/jboss/JbossPlugin.java
index e9388f596ea8..e071ebbd21f8 100644
--- a/plugins/jboss/src/main/java/com/navercorp/pinpoint/plugin/jboss/JbossPlugin.java
+++ b/plugins/jboss/src/main/java/com/navercorp/pinpoint/plugin/jboss/JbossPlugin.java
@@ -28,6 +28,7 @@
 import com.navercorp.pinpoint.bootstrap.logging.PLoggerFactory;
 import com.navercorp.pinpoint.bootstrap.plugin.ProfilerPlugin;
 import com.navercorp.pinpoint.bootstrap.plugin.ProfilerPluginSetupContext;
+import com.navercorp.pinpoint.bootstrap.resolver.ConditionProvider;
 
 /**
  * The Class JbossPlugin.
@@ -61,6 +62,26 @@ public void setup(final ProfilerPluginSetupContext context) {
         JbossDetector jbossDetector = new JbossDetector(jbossConfig.getJbossBootstrapMains());
         context.addApplicationTypeDetector(jbossDetector);
 
+        if (shouldAddTransformers(jbossConfig)) {
+            logger.info("Adding JBoss transformers");
+            addTransformers(jbossConfig);
+        } else {
+            logger.info("Not adding JBoss transformers");
+        }
+    }
+
+    private boolean shouldAddTransformers(JbossConfig jbossConfig) {
+        // Transform if conditional check is disabled
+        if (!jbossConfig.isJbossConditionalTransformEnable()) {
+            return true;
+        }
+        // Only transform if it's a JBoss application
+        ConditionProvider conditionProvider = ConditionProvider.DEFAULT_CONDITION_PROVIDER;
+        boolean isJbossApplication = conditionProvider.checkMainClass(jbossConfig.getJbossBootstrapMains());
+        return isJbossApplication;
+    }
+
+    private void addTransformers(JbossConfig jbossConfig) {
         // Instrumenting class on the base of ejb based application or rest based application.
         if (jbossConfig.isJbossTraceEjb()) {
             addMethodInvocationMessageHandlerEditor();
diff --git a/plugins/tomcat/src/main/java/com/navercorp/pinpoint/plugin/tomcat/TomcatConfig.java b/plugins/tomcat/src/main/java/com/navercorp/pinpoint/plugin/tomcat/TomcatConfig.java
index 87d7ad6a37dd..56c63e8eed04 100644
--- a/plugins/tomcat/src/main/java/com/navercorp/pinpoint/plugin/tomcat/TomcatConfig.java
+++ b/plugins/tomcat/src/main/java/com/navercorp/pinpoint/plugin/tomcat/TomcatConfig.java
@@ -32,6 +32,7 @@ public class TomcatConfig {
 
     private final boolean tomcatEnable;
     private final List<String> tomcatBootstrapMains;
+    private final boolean tomcatConditionalTransformEnable;
     private final boolean tomcatHidePinpointHeader;
 
     private final boolean tomcatTraceRequestParam;
@@ -40,6 +41,9 @@ public class TomcatConfig {
     private final String tomcatRealIpEmptyValue;
     private final Filter<String> tomcatExcludeProfileMethodFilter;
 
+    // for transform conditional check
+    private final List<String> springBootBootstrapMains;
+
     public TomcatConfig(ProfilerConfig config) {
         if (config == null) {
             throw new NullPointerException("config must not be null");
@@ -48,6 +52,7 @@ public TomcatConfig(ProfilerConfig config) {
         // plugin
         this.tomcatEnable = config.readBoolean("profiler.tomcat.enable", true);
         this.tomcatBootstrapMains = config.readList("profiler.tomcat.bootstrap.main");
+        this.tomcatConditionalTransformEnable = config.readBoolean("profiler.tomcat.conditional.transform", true);
         this.tomcatHidePinpointHeader = config.readBoolean("profiler.tomcat.hidepinpointheader", true);
 
         // runtime
@@ -67,6 +72,8 @@ public TomcatConfig(ProfilerConfig config) {
         } else {
             this.tomcatExcludeProfileMethodFilter = new SkipFilter<String>();
         }
+
+        this.springBootBootstrapMains = config.readList("profiler.springboot.bootstrap.main");
     }
 
     public boolean isTomcatEnable() {
@@ -77,6 +84,10 @@ public List<String> getTomcatBootstrapMains() {
         return tomcatBootstrapMains;
     }
 
+    public boolean isTomcatConditionalTransformEnable() {
+        return tomcatConditionalTransformEnable;
+    }
+
     public boolean isTomcatHidePinpointHeader() {
         return tomcatHidePinpointHeader;
     }
@@ -101,12 +112,16 @@ public Filter<String> getTomcatExcludeProfileMethodFilter() {
         return tomcatExcludeProfileMethodFilter;
     }
 
+    public List<String> getSpringBootBootstrapMains() {
+        return springBootBootstrapMains;
+    }
 
     @Override
     public String toString() {
         final StringBuilder sb = new StringBuilder("TomcatConfig{");
         sb.append("tomcatEnable=").append(tomcatEnable);
         sb.append(", tomcatBootstrapMains=").append(tomcatBootstrapMains);
+        sb.append(", tomcatConditionalTransformEnable=").append(tomcatConditionalTransformEnable);
         sb.append(", tomcatHidePinpointHeader=").append(tomcatHidePinpointHeader);
         sb.append(", tomcatTraceRequestParam=").append(tomcatTraceRequestParam);
         sb.append(", tomcatExcludeUrlFilter=").append(tomcatExcludeUrlFilter);
diff --git a/plugins/tomcat/src/main/java/com/navercorp/pinpoint/plugin/tomcat/TomcatPlugin.java b/plugins/tomcat/src/main/java/com/navercorp/pinpoint/plugin/tomcat/TomcatPlugin.java
index fe3344b7c1b3..308c07e80584 100644
--- a/plugins/tomcat/src/main/java/com/navercorp/pinpoint/plugin/tomcat/TomcatPlugin.java
+++ b/plugins/tomcat/src/main/java/com/navercorp/pinpoint/plugin/tomcat/TomcatPlugin.java
@@ -29,6 +29,7 @@
 import com.navercorp.pinpoint.bootstrap.logging.PLoggerFactory;
 import com.navercorp.pinpoint.bootstrap.plugin.ProfilerPlugin;
 import com.navercorp.pinpoint.bootstrap.plugin.ProfilerPluginSetupContext;
+import com.navercorp.pinpoint.bootstrap.resolver.ConditionProvider;
 
 /**
  * @author Jongho Moon
@@ -61,6 +62,27 @@ public void setup(ProfilerPluginSetupContext context) {
         TomcatDetector tomcatDetector = new TomcatDetector(config.getTomcatBootstrapMains());
         context.addApplicationTypeDetector(tomcatDetector);
 
+        if (shouldAddTransformers(config)) {
+            logger.info("Adding Tomcat transformers");
+            addTransformers(config);
+        } else {
+            logger.info("Not adding Tomcat transfomers");
+        }
+    }
+
+    private boolean shouldAddTransformers(TomcatConfig config) {
+        // Transform if conditional check is disabled
+        if (!config.isTomcatConditionalTransformEnable()) {
+            return true;
+        }
+        // Only transform if it's a Tomcat application or SpringBoot application
+        ConditionProvider conditionProvider = ConditionProvider.DEFAULT_CONDITION_PROVIDER;
+        boolean isTomcatApplication = conditionProvider.checkMainClass(config.getTomcatBootstrapMains());
+        boolean isSpringBootApplication = conditionProvider.checkMainClass(config.getSpringBootBootstrapMains());
+        return isTomcatApplication || isSpringBootApplication;
+}
+
+    private void addTransformers(TomcatConfig config) {
         if (config.isTomcatHidePinpointHeader()) {
             addRequestFacadeEditor();
         }
diff --git a/quickstart/agent/src/main/resources/pinpoint.config b/quickstart/agent/src/main/resources/pinpoint.config
index e08a6947c0b5..965997a52c8a 100644
--- a/quickstart/agent/src/main/resources/pinpoint.config
+++ b/quickstart/agent/src/main/resources/pinpoint.config
@@ -74,8 +74,14 @@ profiler.entrypoint=
 profiler.tomcat.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.tomcat.bootstrap.main=org.apache.catalina.startup.Bootstrap
+# Check pre-conditions when registering class file transformers mainly due to JBoss plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.apache.catalina.startup.Bootstrap,
+# or SpringBoot's launchers.
+# Set this to false to bypass this check entirely (such as when launching standalone applications running embedded Tomcat).
+profiler.tomcat.conditional.transform=true
 # Hide pinpoint headers.
 profiler.tomcat.hidepinpointheader=true
+# URLs to exclude from tracing
 profiler.tomcat.excludeurl=/aa/test.html, /bb/exclude.html
 profiler.tomcat.tracerequestparam=true
 
@@ -94,6 +100,7 @@ profiler.tomcat.tracerequestparam=true
 profiler.jetty.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jetty.bootstrap.main=org.eclipse.jetty.start.Main
+# URLs to exclude from tracing
 profiler.jetty.excludeUrl=
 
 
@@ -108,9 +115,28 @@ profiler.dubbo.bootstrap.main=com.alibaba.dubbo.container.Main
 ###########################################################
 # JBOSS                                                   #
 ###########################################################
-profiler.jboss.enable=false
+profiler.jboss.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jboss.bootstrap.main=org.jboss.modules.Main
+# Check pre-conditions when registering class file transformers mainly due to Tomcat plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.jboss.modules.Main.
+# Set this to false to bypass this check entirely.
+profiler.jboss.conditional.transform=true
+# Hide pinpoint headers.
+profiler.jboss.hidepinpointheader=true
+# URLs to exclude from tracing
+profiler.jboss.excludeurl=
+# HTTP Request methods to exclude from tracing
+#profiler.jboss.excludemethod=
+profiler.jboss.tracerequestparam=true
+
+# original IP address header
+# https://en.wikipedia.org/wiki/X-Forwarded-For
+#profiler.jboss.realipheader=X-Forwarded-For
+# nginx real ip header
+#profiler.jboss.realipheader=X-Real-IP
+# optional parameter, If the header value is ${profiler.jboss.realipemptyvalue}, Ignore header value.
+#profiler.jboss.realipemptyvalue=unknown
 
 
 ###########################################################
diff --git a/quickstart/conf/pinpoint.config b/quickstart/conf/pinpoint.config
index bb3ec20b4973..271de615831e 100644
--- a/quickstart/conf/pinpoint.config
+++ b/quickstart/conf/pinpoint.config
@@ -73,8 +73,14 @@ profiler.include=
 profiler.tomcat.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.tomcat.bootstrap.main=org.apache.catalina.startup.Bootstrap
+# Check pre-conditions when registering class file transformers mainly due to JBoss plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.apache.catalina.startup.Bootstrap,
+# or SpringBoot's launchers.
+# Set this to false to bypass this check entirely (such as when launching standalone applications running embedded Tomcat).
+profiler.tomcat.conditional.transform=true
 # Hide pinpoint headers.
 profiler.tomcat.hidepinpointheader=true
+# URLs to exclude from tracing
 profiler.tomcat.excludeurl=/aa/test.html, /bb/exclude.html
 profiler.tomcat.tracerequestparam=true
 
@@ -93,6 +99,7 @@ profiler.tomcat.tracerequestparam=true
 profiler.jetty.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jetty.bootstrap.main=org.eclipse.jetty.start.Main
+# URLs to exclude from tracing
 profiler.jetty.excludeUrl=
 
 
@@ -107,9 +114,28 @@ profiler.dubbo.bootstrap.main=com.alibaba.dubbo.container.Main
 ###########################################################
 # JBOSS                                                   #
 ###########################################################
-profiler.jboss.enable=false
+profiler.jboss.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jboss.bootstrap.main=org.jboss.modules.Main
+# Check pre-conditions when registering class file transformers mainly due to Tomcat plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.jboss.modules.Main.
+# Set this to false to bypass this check entirely.
+profiler.jboss.conditional.transform=true
+# Hide pinpoint headers.
+profiler.jboss.hidepinpointheader=true
+# URLs to exclude from tracing
+profiler.jboss.excludeurl=
+# HTTP Request methods to exclude from tracing
+#profiler.jboss.excludemethod=
+profiler.jboss.tracerequestparam=true
+
+# original IP address header
+# https://en.wikipedia.org/wiki/X-Forwarded-For
+#profiler.jboss.realipheader=X-Forwarded-For
+# nginx real ip header
+#profiler.jboss.realipheader=X-Real-IP
+# optional parameter, If the header value is ${profiler.jboss.realipemptyvalue}, Ignore header value.
+#profiler.jboss.realipemptyvalue=unknown
 
 
 ###########################################################


Test patch:
diff --git a/agent/src/test/resources/activemq/client/pinpoint-activemq-client.config b/agent/src/test/resources/activemq/client/pinpoint-activemq-client.config
index b63689c79753..4714a421dad8 100644
--- a/agent/src/test/resources/activemq/client/pinpoint-activemq-client.config
+++ b/agent/src/test/resources/activemq/client/pinpoint-activemq-client.config
@@ -101,8 +101,14 @@ profiler.entrypoint=
 profiler.tomcat.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.tomcat.bootstrap.main=org.apache.catalina.startup.Bootstrap
+# Check pre-conditions when registering class file transformers mainly due to JBoss plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.apache.catalina.startup.Bootstrap,
+# or SpringBoot's launchers.
+# Set this to false to bypass this check entirely (such as when launching standalone applications running embedded Tomcat).
+profiler.tomcat.conditional.transform=true
 # Hide pinpoint headers.
 profiler.tomcat.hidepinpointheader=true
+# URLs to exclude from tracing
 profiler.tomcat.excludeurl=/aa/test.html, /bb/exclude.html
 profiler.tomcat.tracerequestparam=true
 
@@ -121,6 +127,7 @@ profiler.tomcat.tracerequestparam=true
 profiler.jetty.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jetty.bootstrap.main=org.eclipse.jetty.start.Main
+# URLs to exclude from tracing
 profiler.jetty.excludeUrl=
 
 
@@ -135,9 +142,28 @@ profiler.dubbo.bootstrap.main=com.alibaba.dubbo.container.Main
 ###########################################################
 # JBOSS                                                   #
 ###########################################################
-profiler.jboss.enable=false
+profiler.jboss.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jboss.bootstrap.main=org.jboss.modules.Main
+# Check pre-conditions when registering class file transformers mainly due to Tomcat plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.jboss.modules.Main.
+# Set this to false to bypass this check entirely.
+profiler.jboss.conditional.transform=true
+# Hide pinpoint headers.
+profiler.jboss.hidepinpointheader=true
+# URLs to exclude from tracing
+profiler.jboss.excludeurl=
+# HTTP Request methods to exclude from tracing
+#profiler.jboss.excludemethod=
+profiler.jboss.tracerequestparam=true
+
+# original IP address header
+# https://en.wikipedia.org/wiki/X-Forwarded-For
+#profiler.jboss.realipheader=X-Forwarded-For
+# nginx real ip header
+#profiler.jboss.realipheader=X-Real-IP
+# optional parameter, If the header value is ${profiler.jboss.realipemptyvalue}, Ignore header value.
+#profiler.jboss.realipemptyvalue=unknown
 
 
 ###########################################################
diff --git a/agent/src/test/resources/pinpoint-disabled-plugin-test.config b/agent/src/test/resources/pinpoint-disabled-plugin-test.config
index bfebde28776e..26d06b8aacdf 100644
--- a/agent/src/test/resources/pinpoint-disabled-plugin-test.config
+++ b/agent/src/test/resources/pinpoint-disabled-plugin-test.config
@@ -78,8 +78,14 @@ profiler.include=
 profiler.tomcat.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.tomcat.bootstrap.main=org.apache.catalina.startup.Bootstrap
+# Check pre-conditions when registering class file transformers mainly due to JBoss plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.apache.catalina.startup.Bootstrap,
+# or SpringBoot's launchers.
+# Set this to false to bypass this check entirely (such as when launching standalone applications running embedded Tomcat).
+profiler.tomcat.conditional.transform=true
 # Hide pinpoint headers.
 profiler.tomcat.hidepinpointheader=true
+# URLs to exclude from tracing
 profiler.tomcat.excludeurl=/aa/test.html, /bb/exclude.html
 profiler.tomcat.tracerequestparam=true
 
@@ -98,6 +104,7 @@ profiler.tomcat.tracerequestparam=true
 profiler.jetty.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jetty.bootstrap.main=org.eclipse.jetty.start.Main
+# URLs to exclude from tracing
 profiler.jetty.excludeUrl=
 
 
@@ -112,9 +119,28 @@ profiler.dubbo.bootstrap.main=com.alibaba.dubbo.container.Main
 ###########################################################
 # JBOSS                                                   #
 ###########################################################
-profiler.jboss.enable=false
+profiler.jboss.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jboss.bootstrap.main=org.jboss.modules.Main
+# Check pre-conditions when registering class file transformers mainly due to Tomcat plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.jboss.modules.Main.
+# Set this to false to bypass this check entirely.
+profiler.jboss.conditional.transform=true
+# Hide pinpoint headers.
+profiler.jboss.hidepinpointheader=true
+# URLs to exclude from tracing
+profiler.jboss.excludeurl=
+# HTTP Request methods to exclude from tracing
+#profiler.jboss.excludemethod=
+profiler.jboss.tracerequestparam=true
+
+# original IP address header
+# https://en.wikipedia.org/wiki/X-Forwarded-For
+#profiler.jboss.realipheader=X-Forwarded-For
+# nginx real ip header
+#profiler.jboss.realipheader=X-Real-IP
+# optional parameter, If the header value is ${profiler.jboss.realipemptyvalue}, Ignore header value.
+#profiler.jboss.realipemptyvalue=unknown
 
 
 ###########################################################
diff --git a/agent/src/test/resources/pinpoint-spring-bean-test.config b/agent/src/test/resources/pinpoint-spring-bean-test.config
index 570e16c0b06f..8293feca11d2 100644
--- a/agent/src/test/resources/pinpoint-spring-bean-test.config
+++ b/agent/src/test/resources/pinpoint-spring-bean-test.config
@@ -77,8 +77,14 @@ profiler.include=
 profiler.tomcat.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.tomcat.bootstrap.main=org.apache.catalina.startup.Bootstrap
+# Check pre-conditions when registering class file transformers mainly due to JBoss plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.apache.catalina.startup.Bootstrap,
+# or SpringBoot's launchers.
+# Set this to false to bypass this check entirely (such as when launching standalone applications running embedded Tomcat).
+profiler.tomcat.conditional.transform=true
 # Hide pinpoint headers.
 profiler.tomcat.hidepinpointheader=true
+# URLs to exclude from tracing
 profiler.tomcat.excludeurl=/aa/test.html, /bb/exclude.html
 profiler.tomcat.tracerequestparam=true
 
@@ -97,6 +103,7 @@ profiler.tomcat.tracerequestparam=true
 profiler.jetty.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jetty.bootstrap.main=org.eclipse.jetty.start.Main
+# URLs to exclude from tracing
 profiler.jetty.excludeUrl=
 
 
@@ -111,9 +118,28 @@ profiler.dubbo.bootstrap.main=com.alibaba.dubbo.container.Main
 ###########################################################
 # JBOSS                                                   #
 ###########################################################
-profiler.jboss.enable=false
+profiler.jboss.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jboss.bootstrap.main=org.jboss.modules.Main
+# Check pre-conditions when registering class file transformers mainly due to Tomcat plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.jboss.modules.Main.
+# Set this to false to bypass this check entirely.
+profiler.jboss.conditional.transform=true
+# Hide pinpoint headers.
+profiler.jboss.hidepinpointheader=true
+# URLs to exclude from tracing
+profiler.jboss.excludeurl=
+# HTTP Request methods to exclude from tracing
+#profiler.jboss.excludemethod=
+profiler.jboss.tracerequestparam=true
+
+# original IP address header
+# https://en.wikipedia.org/wiki/X-Forwarded-For
+#profiler.jboss.realipheader=X-Forwarded-For
+# nginx real ip header
+#profiler.jboss.realipheader=X-Real-IP
+# optional parameter, If the header value is ${profiler.jboss.realipemptyvalue}, Ignore header value.
+#profiler.jboss.realipemptyvalue=unknown
 
 
 ###########################################################
diff --git a/plugins/google-httpclient/src/test/resources/pinpoint.config b/plugins/google-httpclient/src/test/resources/pinpoint.config
index 65785e99a9a2..9aa7a20f71ac 100644
--- a/plugins/google-httpclient/src/test/resources/pinpoint.config
+++ b/plugins/google-httpclient/src/test/resources/pinpoint.config
@@ -67,8 +67,14 @@ profiler.include=com.navercorp.pinpoint.testweb.controller.*,com.navercorp.pinpo
 profiler.tomcat.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.tomcat.bootstrap.main=org.apache.catalina.startup.Bootstrap
+# Check pre-conditions when registering class file transformers mainly due to JBoss plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.apache.catalina.startup.Bootstrap,
+# or SpringBoot's launchers.
+# Set this to false to bypass this check entirely (such as when launching standalone applications running embedded Tomcat).
+profiler.tomcat.conditional.transform=true
 # Hide pinpoint headers.
 profiler.tomcat.hidepinpointheader=true
+# URLs to exclude from tracing
 profiler.tomcat.excludeurl=/aa/test.html, /bb/exclude.html
 profiler.tomcat.tracerequestparam=true
 
@@ -87,6 +93,7 @@ profiler.tomcat.tracerequestparam=true
 profiler.jetty.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jetty.bootstrap.main=org.eclipse.jetty.start.Main
+# URLs to exclude from tracing
 profiler.jetty.excludeUrl=
 
 
@@ -101,9 +108,28 @@ profiler.dubbo.bootstrap.main=com.alibaba.dubbo.container.Main
 ###########################################################
 # JBOSS                                                   #
 ###########################################################
-profiler.jboss.enable=false
+profiler.jboss.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jboss.bootstrap.main=org.jboss.modules.Main
+# Check pre-conditions when registering class file transformers mainly due to Tomcat plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.jboss.modules.Main.
+# Set this to false to bypass this check entirely.
+profiler.jboss.conditional.transform=true
+# Hide pinpoint headers.
+profiler.jboss.hidepinpointheader=true
+# URLs to exclude from tracing
+profiler.jboss.excludeurl=
+# HTTP Request methods to exclude from tracing
+#profiler.jboss.excludemethod=
+profiler.jboss.tracerequestparam=true
+
+# original IP address header
+# https://en.wikipedia.org/wiki/X-Forwarded-For
+#profiler.jboss.realipheader=X-Forwarded-For
+# nginx real ip header
+#profiler.jboss.realipheader=X-Real-IP
+# optional parameter, If the header value is ${profiler.jboss.realipemptyvalue}, Ignore header value.
+#profiler.jboss.realipemptyvalue=unknown
 
 
 ###########################################################
diff --git a/plugins/httpclient3/src/test/resources/pinpoint.config b/plugins/httpclient3/src/test/resources/pinpoint.config
index b1d906d2a2d2..d9341029f156 100644
--- a/plugins/httpclient3/src/test/resources/pinpoint.config
+++ b/plugins/httpclient3/src/test/resources/pinpoint.config
@@ -67,8 +67,14 @@ profiler.include=com.navercorp.pinpoint.testweb.controller.*,com.navercorp.pinpo
 profiler.tomcat.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.tomcat.bootstrap.main=org.apache.catalina.startup.Bootstrap
+# Check pre-conditions when registering class file transformers mainly due to JBoss plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.apache.catalina.startup.Bootstrap,
+# or SpringBoot's launchers.
+# Set this to false to bypass this check entirely (such as when launching standalone applications running embedded Tomcat).
+profiler.tomcat.conditional.transform=true
 # Hide pinpoint headers.
 profiler.tomcat.hidepinpointheader=true
+# URLs to exclude from tracing
 profiler.tomcat.excludeurl=/aa/test.html, /bb/exclude.html
 profiler.tomcat.tracerequestparam=true
 
@@ -87,6 +93,7 @@ profiler.tomcat.tracerequestparam=true
 profiler.jetty.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jetty.bootstrap.main=org.eclipse.jetty.start.Main
+# URLs to exclude from tracing
 profiler.jetty.excludeUrl=
 
 
@@ -101,9 +108,28 @@ profiler.dubbo.bootstrap.main=com.alibaba.dubbo.container.Main
 ###########################################################
 # JBOSS                                                   #
 ###########################################################
-profiler.jboss.enable=false
+profiler.jboss.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jboss.bootstrap.main=org.jboss.modules.Main
+# Check pre-conditions when registering class file transformers mainly due to Tomcat plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.jboss.modules.Main.
+# Set this to false to bypass this check entirely.
+profiler.jboss.conditional.transform=true
+# Hide pinpoint headers.
+profiler.jboss.hidepinpointheader=true
+# URLs to exclude from tracing
+profiler.jboss.excludeurl=
+# HTTP Request methods to exclude from tracing
+#profiler.jboss.excludemethod=
+profiler.jboss.tracerequestparam=true
+
+# original IP address header
+# https://en.wikipedia.org/wiki/X-Forwarded-For
+#profiler.jboss.realipheader=X-Forwarded-For
+# nginx real ip header
+#profiler.jboss.realipheader=X-Real-IP
+# optional parameter, If the header value is ${profiler.jboss.realipemptyvalue}, Ignore header value.
+#profiler.jboss.realipemptyvalue=unknown
 
 
 ###########################################################
diff --git a/plugins/httpclient4/src/test/resources/pinpoint.config b/plugins/httpclient4/src/test/resources/pinpoint.config
index b1d906d2a2d2..d9341029f156 100644
--- a/plugins/httpclient4/src/test/resources/pinpoint.config
+++ b/plugins/httpclient4/src/test/resources/pinpoint.config
@@ -67,8 +67,14 @@ profiler.include=com.navercorp.pinpoint.testweb.controller.*,com.navercorp.pinpo
 profiler.tomcat.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.tomcat.bootstrap.main=org.apache.catalina.startup.Bootstrap
+# Check pre-conditions when registering class file transformers mainly due to JBoss plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.apache.catalina.startup.Bootstrap,
+# or SpringBoot's launchers.
+# Set this to false to bypass this check entirely (such as when launching standalone applications running embedded Tomcat).
+profiler.tomcat.conditional.transform=true
 # Hide pinpoint headers.
 profiler.tomcat.hidepinpointheader=true
+# URLs to exclude from tracing
 profiler.tomcat.excludeurl=/aa/test.html, /bb/exclude.html
 profiler.tomcat.tracerequestparam=true
 
@@ -87,6 +93,7 @@ profiler.tomcat.tracerequestparam=true
 profiler.jetty.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jetty.bootstrap.main=org.eclipse.jetty.start.Main
+# URLs to exclude from tracing
 profiler.jetty.excludeUrl=
 
 
@@ -101,9 +108,28 @@ profiler.dubbo.bootstrap.main=com.alibaba.dubbo.container.Main
 ###########################################################
 # JBOSS                                                   #
 ###########################################################
-profiler.jboss.enable=false
+profiler.jboss.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jboss.bootstrap.main=org.jboss.modules.Main
+# Check pre-conditions when registering class file transformers mainly due to Tomcat plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.jboss.modules.Main.
+# Set this to false to bypass this check entirely.
+profiler.jboss.conditional.transform=true
+# Hide pinpoint headers.
+profiler.jboss.hidepinpointheader=true
+# URLs to exclude from tracing
+profiler.jboss.excludeurl=
+# HTTP Request methods to exclude from tracing
+#profiler.jboss.excludemethod=
+profiler.jboss.tracerequestparam=true
+
+# original IP address header
+# https://en.wikipedia.org/wiki/X-Forwarded-For
+#profiler.jboss.realipheader=X-Forwarded-For
+# nginx real ip header
+#profiler.jboss.realipheader=X-Real-IP
+# optional parameter, If the header value is ${profiler.jboss.realipemptyvalue}, Ignore header value.
+#profiler.jboss.realipemptyvalue=unknown
 
 
 ###########################################################
diff --git a/plugins/jboss/src/test/resources/pinpoint.config b/plugins/jboss/src/test/resources/pinpoint.config
index 0bcbaf8c550f..d9a73913980f 100644
--- a/plugins/jboss/src/test/resources/pinpoint.config
+++ b/plugins/jboss/src/test/resources/pinpoint.config
@@ -71,8 +71,14 @@ profiler.include=com.navercorp.pinpoint.testweb.controller.*,com.navercorp.pinpo
 profiler.tomcat.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.tomcat.bootstrap.main=org.apache.catalina.startup.Bootstrap
+# Check pre-conditions when registering class file transformers mainly due to JBoss plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.apache.catalina.startup.Bootstrap,
+# or SpringBoot's launchers.
+# Set this to false to bypass this check entirely (such as when launching standalone applications running embedded Tomcat).
+profiler.tomcat.conditional.transform=true
 # Hide pinpoint headers.
 profiler.tomcat.hidepinpointheader=true
+# URLs to exclude from tracing
 profiler.tomcat.excludeurl=/aa/test.html, /bb/exclude.html
 profiler.tomcat.tracerequestparam=true
 
@@ -91,6 +97,7 @@ profiler.tomcat.tracerequestparam=true
 profiler.jetty.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jetty.bootstrap.main=org.eclipse.jetty.start.Main
+# URLs to exclude from tracing
 profiler.jetty.excludeUrl=
 
 
@@ -108,6 +115,25 @@ profiler.dubbo.bootstrap.main=com.alibaba.dubbo.container.Main
 profiler.jboss.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jboss.bootstrap.main=org.jboss.modules.Main
+# Check pre-conditions when registering class file transformers mainly due to Tomcat plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.jboss.modules.Main.
+# Set this to false to bypass this check entirely.
+profiler.jboss.conditional.transform=false
+# Hide pinpoint headers.
+profiler.jboss.hidepinpointheader=true
+# URLs to exclude from tracing
+profiler.jboss.excludeurl=
+# HTTP Request methods to exclude from tracing
+#profiler.jboss.excludemethod=
+profiler.jboss.tracerequestparam=true
+
+# original IP address header
+# https://en.wikipedia.org/wiki/X-Forwarded-For
+#profiler.jboss.realipheader=X-Forwarded-For
+# nginx real ip header
+#profiler.jboss.realipheader=X-Real-IP
+# optional parameter, If the header value is ${profiler.jboss.realipemptyvalue}, Ignore header value.
+#profiler.jboss.realipemptyvalue=unknown
 
 
 ###########################################################
diff --git a/plugins/redis/src/test/resources/pinpoint.config b/plugins/redis/src/test/resources/pinpoint.config
index b1d906d2a2d2..d9341029f156 100644
--- a/plugins/redis/src/test/resources/pinpoint.config
+++ b/plugins/redis/src/test/resources/pinpoint.config
@@ -67,8 +67,14 @@ profiler.include=com.navercorp.pinpoint.testweb.controller.*,com.navercorp.pinpo
 profiler.tomcat.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.tomcat.bootstrap.main=org.apache.catalina.startup.Bootstrap
+# Check pre-conditions when registering class file transformers mainly due to JBoss plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.apache.catalina.startup.Bootstrap,
+# or SpringBoot's launchers.
+# Set this to false to bypass this check entirely (such as when launching standalone applications running embedded Tomcat).
+profiler.tomcat.conditional.transform=true
 # Hide pinpoint headers.
 profiler.tomcat.hidepinpointheader=true
+# URLs to exclude from tracing
 profiler.tomcat.excludeurl=/aa/test.html, /bb/exclude.html
 profiler.tomcat.tracerequestparam=true
 
@@ -87,6 +93,7 @@ profiler.tomcat.tracerequestparam=true
 profiler.jetty.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jetty.bootstrap.main=org.eclipse.jetty.start.Main
+# URLs to exclude from tracing
 profiler.jetty.excludeUrl=
 
 
@@ -101,9 +108,28 @@ profiler.dubbo.bootstrap.main=com.alibaba.dubbo.container.Main
 ###########################################################
 # JBOSS                                                   #
 ###########################################################
-profiler.jboss.enable=false
+profiler.jboss.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jboss.bootstrap.main=org.jboss.modules.Main
+# Check pre-conditions when registering class file transformers mainly due to Tomcat plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.jboss.modules.Main.
+# Set this to false to bypass this check entirely.
+profiler.jboss.conditional.transform=true
+# Hide pinpoint headers.
+profiler.jboss.hidepinpointheader=true
+# URLs to exclude from tracing
+profiler.jboss.excludeurl=
+# HTTP Request methods to exclude from tracing
+#profiler.jboss.excludemethod=
+profiler.jboss.tracerequestparam=true
+
+# original IP address header
+# https://en.wikipedia.org/wiki/X-Forwarded-For
+#profiler.jboss.realipheader=X-Forwarded-For
+# nginx real ip header
+#profiler.jboss.realipheader=X-Real-IP
+# optional parameter, If the header value is ${profiler.jboss.realipemptyvalue}, Ignore header value.
+#profiler.jboss.realipemptyvalue=unknown
 
 
 ###########################################################
diff --git a/plugins/tomcat/src/test/resources/pinpoint.config b/plugins/tomcat/src/test/resources/pinpoint.config
index dfb1d942a132..8dc31e670045 100644
--- a/plugins/tomcat/src/test/resources/pinpoint.config
+++ b/plugins/tomcat/src/test/resources/pinpoint.config
@@ -71,8 +71,14 @@ profiler.include=com.navercorp.pinpoint.testweb.controller.*,com.navercorp.pinpo
 profiler.tomcat.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.tomcat.bootstrap.main=org.apache.catalina.startup.Bootstrap
+# Check pre-conditions when registering class file transformers mainly due to JBoss plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.apache.catalina.startup.Bootstrap,
+# or SpringBoot's launchers.
+# Set this to false to bypass this check entirely (such as when launching standalone applications running embedded Tomcat).
+profiler.tomcat.conditional.transform=false
 # Hide pinpoint headers.
 profiler.tomcat.hidepinpointheader=true
+# URLs to exclude from tracing
 profiler.tomcat.excludeurl=/aa/test.html, /bb/exclude.html
 profiler.tomcat.tracerequestparam=true
 
@@ -91,6 +97,7 @@ profiler.tomcat.tracerequestparam=true
 profiler.jetty.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jetty.bootstrap.main=org.eclipse.jetty.start.Main
+# URLs to exclude from tracing
 profiler.jetty.excludeUrl=
 
 
@@ -105,9 +112,28 @@ profiler.dubbo.bootstrap.main=com.alibaba.dubbo.container.Main
 ###########################################################
 # JBOSS                                                   #
 ###########################################################
-profiler.jboss.enable=false
+profiler.jboss.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jboss.bootstrap.main=org.jboss.modules.Main
+# Check pre-conditions when registering class file transformers mainly due to Tomcat plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.jboss.modules.Main.
+# Set this to false to bypass this check entirely.
+profiler.jboss.conditional.transform=true
+# Hide pinpoint headers.
+profiler.jboss.hidepinpointheader=true
+# URLs to exclude from tracing
+profiler.jboss.excludeurl=
+# HTTP Request methods to exclude from tracing
+#profiler.jboss.excludemethod=
+profiler.jboss.tracerequestparam=true
+
+# original IP address header
+# https://en.wikipedia.org/wiki/X-Forwarded-For
+#profiler.jboss.realipheader=X-Forwarded-For
+# nginx real ip header
+#profiler.jboss.realipheader=X-Real-IP
+# optional parameter, If the header value is ${profiler.jboss.realipemptyvalue}, Ignore header value.
+#profiler.jboss.realipemptyvalue=unknown
 
 
 ###########################################################
diff --git a/plugins/user/src/test/resources/pinpoint.config b/plugins/user/src/test/resources/pinpoint.config
index b1d906d2a2d2..d9341029f156 100644
--- a/plugins/user/src/test/resources/pinpoint.config
+++ b/plugins/user/src/test/resources/pinpoint.config
@@ -67,8 +67,14 @@ profiler.include=com.navercorp.pinpoint.testweb.controller.*,com.navercorp.pinpo
 profiler.tomcat.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.tomcat.bootstrap.main=org.apache.catalina.startup.Bootstrap
+# Check pre-conditions when registering class file transformers mainly due to JBoss plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.apache.catalina.startup.Bootstrap,
+# or SpringBoot's launchers.
+# Set this to false to bypass this check entirely (such as when launching standalone applications running embedded Tomcat).
+profiler.tomcat.conditional.transform=true
 # Hide pinpoint headers.
 profiler.tomcat.hidepinpointheader=true
+# URLs to exclude from tracing
 profiler.tomcat.excludeurl=/aa/test.html, /bb/exclude.html
 profiler.tomcat.tracerequestparam=true
 
@@ -87,6 +93,7 @@ profiler.tomcat.tracerequestparam=true
 profiler.jetty.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jetty.bootstrap.main=org.eclipse.jetty.start.Main
+# URLs to exclude from tracing
 profiler.jetty.excludeUrl=
 
 
@@ -101,9 +108,28 @@ profiler.dubbo.bootstrap.main=com.alibaba.dubbo.container.Main
 ###########################################################
 # JBOSS                                                   #
 ###########################################################
-profiler.jboss.enable=false
+profiler.jboss.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jboss.bootstrap.main=org.jboss.modules.Main
+# Check pre-conditions when registering class file transformers mainly due to Tomcat plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.jboss.modules.Main.
+# Set this to false to bypass this check entirely.
+profiler.jboss.conditional.transform=true
+# Hide pinpoint headers.
+profiler.jboss.hidepinpointheader=true
+# URLs to exclude from tracing
+profiler.jboss.excludeurl=
+# HTTP Request methods to exclude from tracing
+#profiler.jboss.excludemethod=
+profiler.jboss.tracerequestparam=true
+
+# original IP address header
+# https://en.wikipedia.org/wiki/X-Forwarded-For
+#profiler.jboss.realipheader=X-Forwarded-For
+# nginx real ip header
+#profiler.jboss.realipheader=X-Real-IP
+# optional parameter, If the header value is ${profiler.jboss.realipemptyvalue}, Ignore header value.
+#profiler.jboss.realipemptyvalue=unknown
 
 
 ###########################################################
diff --git a/profiler-optional/profiler-optional-jdk8/src/test/resources/pinpoint-lambda-test.config b/profiler-optional/profiler-optional-jdk8/src/test/resources/pinpoint-lambda-test.config
index 6a9bde2f1117..0ba404b6aa40 100644
--- a/profiler-optional/profiler-optional-jdk8/src/test/resources/pinpoint-lambda-test.config
+++ b/profiler-optional/profiler-optional-jdk8/src/test/resources/pinpoint-lambda-test.config
@@ -74,8 +74,14 @@ profiler.include=
 profiler.tomcat.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.tomcat.bootstrap.main=org.apache.catalina.startup.Bootstrap
+# Check pre-conditions when registering class file transformers mainly due to JBoss plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.apache.catalina.startup.Bootstrap,
+# or SpringBoot's launchers.
+# Set this to false to bypass this check entirely (such as when launching standalone applications running embedded Tomcat).
+profiler.tomcat.conditional.transform=true
 # Hide pinpoint headers.
 profiler.tomcat.hidepinpointheader=true
+# URLs to exclude from tracing
 profiler.tomcat.excludeurl=/aa/test.html, /bb/exclude.html
 profiler.tomcat.tracerequestparam=true
 
@@ -94,6 +100,7 @@ profiler.tomcat.tracerequestparam=true
 profiler.jetty.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jetty.bootstrap.main=org.eclipse.jetty.start.Main
+# URLs to exclude from tracing
 profiler.jetty.excludeUrl=
 
 
@@ -108,9 +115,28 @@ profiler.dubbo.bootstrap.main=com.alibaba.dubbo.container.Main
 ###########################################################
 # JBOSS                                                   #
 ###########################################################
-profiler.jboss.enable=false
+profiler.jboss.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jboss.bootstrap.main=org.jboss.modules.Main
+# Check pre-conditions when registering class file transformers mainly due to Tomcat plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.jboss.modules.Main.
+# Set this to false to bypass this check entirely.
+profiler.jboss.conditional.transform=true
+# Hide pinpoint headers.
+profiler.jboss.hidepinpointheader=true
+# URLs to exclude from tracing
+profiler.jboss.excludeurl=
+# HTTP Request methods to exclude from tracing
+#profiler.jboss.excludemethod=
+profiler.jboss.tracerequestparam=true
+
+# original IP address header
+# https://en.wikipedia.org/wiki/X-Forwarded-For
+#profiler.jboss.realipheader=X-Forwarded-For
+# nginx real ip header
+#profiler.jboss.realipheader=X-Real-IP
+# optional parameter, If the header value is ${profiler.jboss.realipemptyvalue}, Ignore header value.
+#profiler.jboss.realipemptyvalue=unknown
 
 
 ###########################################################
diff --git a/profiler/src/test/resources/pinpoint-spring-bean-test.config b/profiler/src/test/resources/pinpoint-spring-bean-test.config
index 7b0edc0ac9af..34bd2d4a14ce 100644
--- a/profiler/src/test/resources/pinpoint-spring-bean-test.config
+++ b/profiler/src/test/resources/pinpoint-spring-bean-test.config
@@ -72,8 +72,14 @@ profiler.include=
 profiler.tomcat.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.tomcat.bootstrap.main=org.apache.catalina.startup.Bootstrap
+# Check pre-conditions when registering class file transformers mainly due to JBoss plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.apache.catalina.startup.Bootstrap,
+# or SpringBoot's launchers.
+# Set this to false to bypass this check entirely (such as when launching standalone applications running embedded Tomcat).
+profiler.tomcat.conditional.transform=true
 # Hide pinpoint headers.
 profiler.tomcat.hidepinpointheader=true
+# URLs to exclude from tracing
 profiler.tomcat.excludeurl=/aa/test.html, /bb/exclude.html
 profiler.tomcat.tracerequestparam=true
 
@@ -92,6 +98,7 @@ profiler.tomcat.tracerequestparam=true
 profiler.jetty.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jetty.bootstrap.main=org.eclipse.jetty.start.Main
+# URLs to exclude from tracing
 profiler.jetty.excludeUrl=
 
 
@@ -106,9 +113,28 @@ profiler.dubbo.bootstrap.main=com.alibaba.dubbo.container.Main
 ###########################################################
 # JBOSS                                                   #
 ###########################################################
-profiler.jboss.enable=false
+profiler.jboss.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jboss.bootstrap.main=org.jboss.modules.Main
+# Check pre-conditions when registering class file transformers mainly due to Tomcat plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.jboss.modules.Main.
+# Set this to false to bypass this check entirely.
+profiler.jboss.conditional.transform=true
+# Hide pinpoint headers.
+profiler.jboss.hidepinpointheader=true
+# URLs to exclude from tracing
+profiler.jboss.excludeurl=
+# HTTP Request methods to exclude from tracing
+#profiler.jboss.excludemethod=
+profiler.jboss.tracerequestparam=true
+
+# original IP address header
+# https://en.wikipedia.org/wiki/X-Forwarded-For
+#profiler.jboss.realipheader=X-Forwarded-For
+# nginx real ip header
+#profiler.jboss.realipheader=X-Real-IP
+# optional parameter, If the header value is ${profiler.jboss.realipemptyvalue}, Ignore header value.
+#profiler.jboss.realipemptyvalue=unknown
 
 
 ###########################################################
diff --git a/profiler/src/test/resources/pinpoint.config b/profiler/src/test/resources/pinpoint.config
index 8b2f50cd30fe..03a3760e963a 100644
--- a/profiler/src/test/resources/pinpoint.config
+++ b/profiler/src/test/resources/pinpoint.config
@@ -71,8 +71,14 @@ profiler.include=com.navercorp.pinpoint.testweb.controller.*,com.navercorp.pinpo
 profiler.tomcat.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.tomcat.bootstrap.main=org.apache.catalina.startup.Bootstrap
+# Check pre-conditions when registering class file transformers mainly due to JBoss plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.apache.catalina.startup.Bootstrap,
+# or SpringBoot's launchers.
+# Set this to false to bypass this check entirely (such as when launching standalone applications running embedded Tomcat).
+profiler.tomcat.conditional.transform=true
 # Hide pinpoint headers.
 profiler.tomcat.hidepinpointheader=true
+# URLs to exclude from tracing
 profiler.tomcat.excludeurl=/aa/test.html, /bb/exclude.html
 profiler.tomcat.tracerequestparam=true
 
@@ -91,6 +97,7 @@ profiler.tomcat.tracerequestparam=true
 profiler.jetty.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jetty.bootstrap.main=org.eclipse.jetty.start.Main
+# URLs to exclude from tracing
 profiler.jetty.excludeUrl=
 
 
@@ -105,9 +112,28 @@ profiler.dubbo.bootstrap.main=com.alibaba.dubbo.container.Main
 ###########################################################
 # JBOSS                                                   #
 ###########################################################
-profiler.jboss.enable=false
+profiler.jboss.enable=true
 # Classes for detecting application server type. Comma separated list of fully qualified class names. Wildcard not supported.
 profiler.jboss.bootstrap.main=org.jboss.modules.Main
+# Check pre-conditions when registering class file transformers mainly due to Tomcat plugin transforming the same class.
+# Setting this to true currently adds transformers only if the application was launched via org.jboss.modules.Main.
+# Set this to false to bypass this check entirely.
+profiler.jboss.conditional.transform=true
+# Hide pinpoint headers.
+profiler.jboss.hidepinpointheader=true
+# URLs to exclude from tracing
+profiler.jboss.excludeurl=
+# HTTP Request methods to exclude from tracing
+#profiler.jboss.excludemethod=
+profiler.jboss.tracerequestparam=true
+
+# original IP address header
+# https://en.wikipedia.org/wiki/X-Forwarded-For
+#profiler.jboss.realipheader=X-Forwarded-For
+# nginx real ip header
+#profiler.jboss.realipheader=X-Real-IP
+# optional parameter, If the header value is ${profiler.jboss.realipemptyvalue}, Ignore header value.
+#profiler.jboss.realipemptyvalue=unknown
 
 
 ###########################################################