Enable JMX in Wildfly 10.1

This post will be short and give very quick information about how to enable JMX in Wildfy 10.1.

When I was consulting for a project, one of the application that they showed me was using JMX to perform some run time operation on JVM instances. It was running in JBOSS 5x and after migrating their application to Wildlfy 10.1, they got stuck as they were not able to invoke the remote method via JMX API.

For those in similar situation can use following code in the standalone.conf to enable JMX,

# JMX Specific initialization settings
if [ "x$JBOSS_HOME" = "x" ]; then
JBOSS_LOG_MANAGER_LIB="$(echo ../modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-*.jar)"
JBOSS_LOG_MANAGER_LIB="$(echo $JBOSS_HOME/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-*.jar)"

if [ "x$JAVA_OPTS" = "x" ]; then
JAVA_OPTS="-Xbootclasspath/p:$JBOSS_LOG_MANAGER_LIB -Djboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager \
-Djava.util.logging.manager=org.jboss.logmanager.LogManager \
-Dcom.sun.management.jmxremote.access.file=$JAVA_HOME/lib/management/jmxremote.access \
echo "JAVA_OPTS already set in this environment..."


WP2Social Auto Publish Powered By : XYZScripts.com