Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JConsole remote connection to JBoss EAP

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

like image 630
Biscuit128 Avatar asked Jul 30 '14 20:07

Biscuit128


2 Answers

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

like image 176
SANN3 Avatar answered Oct 03 '22 23:10

SANN3


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?!

like image 21
Biscuit128 Avatar answered Oct 04 '22 00:10

Biscuit128