JConsole remote connection to JBoss EAP

27,491

Solution 1

I have found the answer - well at least a solution.

Having read through the new JBOSS release notes herefor EAP 6.3 I found the following;

Restored ServiceMBean Helper Classes The org.jboss.as.system-jmx module has been introduced to restore helper classes available in earlier versions of JBoss EAP that assist users in creating MBeans.

What we did was deploy a new standalone instance - clean install of 6.3 and then followed this guide;

https://planet.jboss.org/post/jmx_connections_to_jboss_as

We needed no optional parameters to be added, no modifications to standalone.sh and no modifications for standalone.xml.

I see someone has 5 up votes for an incorrect answer - is this just so the bounty is awarded?!

Solution 2

Follow the instructions mentioned below to enable remote JMX monitoring in JBoss

JBoss 4.2.3.GA

Modify run.conf file available in bin directory of JBoss and add below lines-

JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=<PORT>"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"
JAVA_OPTS="$JAVA_OPTS -Djboss.platform.mbeanserver"
JAVA_OPTS="$JAVA_OPTS -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl"

JBoss 5.1.0.GA

JMX port cannot be configured in JBoss 5.1 due to an existing bug (https://issues.jboss.org/browse/JBAS-6185) in JBoss which has been fixed in JBoss 6.0 version.

JBoss 6.1.0.Final

Modify run.conf file available in bin directory of JBoss and add below lines-

JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
JAVA_ARGS="$JAVA_OPTS -Dorg.jboss.logging.Logger.pluginClass=org.jboss.logging.logmanager.LoggerPluginImpl"
JBOSS_CLASSPATH="../lib/jboss-logmanager.jar"

JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=<PORT>"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"
JAVA_OPTS="$JAVA_OPTS -Djboss.platform.mbeanserver"
JAVA_OPTS="$JAVA_OPTS -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl"
JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.hostname=<IP_ADDRESS>"

JBoss 7.1.1.Final

Modify standalone.conf file available in bin directory of JBoss and add below lines-

JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=<PORT>"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"
JAVA_OPTS="$JAVA_OPTS -Djboss.platform.mbeanserver"
JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.hostname=<IP_ADDRESS>"
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/p:../modules/org/jboss/logmanager/main/jboss-logmanager-1.2.2.GA.jar  -Xbootclasspath/p:../modules/org/jboss/logmanager/log4j/main/jboss-logmanager-log4j-1.0.0.GA.jar -Xbootclasspath/p:../modules/org/apache/log4j/main/log4j-1.2.16.jar"
JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=org.jboss.logmanager"

NOTE: Modify and according to your requirements.

Reference:

https://community.jboss.org/wiki/JBossMBeansInJConsole

http://abh1sh3k.blogspot.in/2013/12/jmx-configuration-in-different-versions.html

Solution 3

Ok... This was really an issue for me and is important for you to know that if you jave JConsole and JBoss on different machines, the JConsole that comes with Java DOES NOT WORK... You have to download a copy of JBoss on the machine you have JConsole and on the bin folder look for the jconsole.bat file.

I took it from here: http://www.java-redefined.com/2014/02/jboss-7-with-jconsole.html

Share:
27,491
Biscuit128
Author by

Biscuit128

public static void main

Updated on June 23, 2020

Comments

  • Biscuit128
    Biscuit128 almost 4 years

    I am trying to connect to a remote jboss instance running on a server. I am using the following connection URL

    service:jmx:remoting-jmx://90.214.64.170:9999

    When i do this i get the following 2 errors in the console window

    enter image description here

    After selecting insecure i am presented with this

    enter image description here

    I have, prior to connecting via jconsole also gone to the bin directory of my jboss server and run ./jconsole.sh which outputs the following to the command line

    CLASSPATH /usr/bin/java/jdk1.8.0_11/lib/jconsole.jar:/usr/bin/java/jdk1.8.0_11/lib/tools.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/remoting-jmx/main/remoting-jmx-1.1.2.Final-redhat-1.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/remoting3/main/jboss-remoting-3.2.18.GA-redhat-1.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/logging/main/jboss-logging-3.1.2.GA-redhat-1.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/xnio/main/xnio-api-3.0.7.GA-redhat-1.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/xnio/nio/main/xnio-nio-3.0.7.GA-redhat-1.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/sasl/main/jboss-sasl-1.0.3.Final-redhat-1.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/marshalling/main/jboss-marshalling-1.4.2.Final-redhat-1.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/marshalling/river/main/jboss-marshalling-river-1.4.2.Final-redhat-1.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/as/cli/main/jboss-as-cli-7.3.0.Final-redhat-14.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/staxmapper/main/staxmapper-1.1.0.Final-redhat-2.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/as/protocol/main/jboss-as-protocol-7.3.0.Final-redhat-14.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/dmr/main/jboss-dmr-1.2.0.Final-redhat-1.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/as/controller-client/main/jboss-as-controller-client-7.3.0.Final-redhat-14.jar:/var/opt/jboss/modules/system/layers/base/org/jboss/threads/main/jboss-threads-2.1.1.Final-redhat-1.jar
    

    I am not sure what else i can try (having also opened port 9999) to get this to work, does anyone have any advice or hints that might help resolve this?

    Thanks

    EDIT

    Having modified my standalone.conf file to this

    #
    # Specify options to pass to the Java VM.
    #
    if [ "x$JAVA_OPTS" = "x" ]; then
       JAVA_OPTS="-Xms1303m -Xmx1303m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true"
       JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS -Djava.awt.headless=true"
       JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote"
       JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=9999"
       JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"
       JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
    else
       echo "JAVA_OPTS already set in environment; overriding default settings with values: $JAVA_OPTS"
    fi
    

    I am still unable to connect - with the same errors as above

  • Biscuit128
    Biscuit128 over 9 years
    do i need these as well as the others in my original post or just these?
  • Biscuit128
    Biscuit128 over 9 years
    if i add a combination of both i get the following error Exception thrown by the agent : javax.management.JMRuntimeException: Failed to load MBeanServerBuilder class org.jboss.system.server.jmx.MBeanServerBuilderImpl: java.lang.ClassNotFoundException: org.jboss.system.server.jmx.MBeanServerBuilderImpl
  • SANN3
    SANN3 over 9 years
    Add these with other params. Did you added your ip address instead of <host ip> ?
  • Biscuit128
    Biscuit128 over 9 years
    yes - added my ip address in place of <host ip> - i added my local host address (the ip on the internal network 192.168.0.value) opposed to the external ip
  • SANN3
    SANN3 over 9 years
    I also got that exception. But after adding this params worked. For @ashokramcse also working i think. But i am using JBoss 4.0.
  • Biscuit128
    Biscuit128 over 9 years
    none of the above applies to EAP 6.2 as 1) the MBeanServerBuilderImpl is not packaged any more and 2) these are all settings for non eap jboss
  • mchinaloy
    mchinaloy over 9 years
    Ahh, been struggling with this issue for the past few days too. Just upgraded my install to 6.3 and followed the guide you posted. JConsole appears to be working fine now! Thanks.