How to enable JMX on JBoss 6x / JBoss 4x?

You will need following entries in your run.conf/run.sh JBoss files:

In run.conf (example on windows – change appropriately for unix):

set "JAVA_OPTS=%JAVA_OPTS% -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl"
set "JAVA_OPTS=%JAVA_OPTS% -Djboss.platform.mbeanserver"
set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.port=19999"
set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.authenticate=false"
set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.ssl=false"
set "JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Dorg.jboss.logging.Logger.pluginClass=org.jboss.logging.logmanager.LoggerPluginImpl"

In run.bat – Add following to JBOSS_CLASSPATH:
set JBOSS_CLASSPATH=%JBOSS_CLASSPATH%;%JBOSS_HOME%\lib\jboss-logmanager.jar;

Note that in JBoss 4x adding following to JAVA_OPTS is enough:
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=59999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false

To Enable JMX (Password) Authentication

You can set -Dcom.sun.management.jmxremote.authenticate to true to enable authentication (this is also the default). This requires you to do some additional steps as noted here: http://docs.oracle.com/javase/1.5.0/docs/guide/management/agent.html#auth

Advertisements

One response

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: