Thursday 20 September 2018

JBoss- Remote JMX Connection (jvisualvm)

Java VisualVM is a tool that provides a visual interface for viewing detailed information about Java technology-based applications (Java applications) while they are running on a Java Virtual Machine (JVM).

ava VisualVM can be used by Java application developers/administrator to troubleshoot applications and to monitor and improve the applications' performance. Java VisualVM can allow developers to generate and analyse heap dumps, track down memory leaks, browse the platform's MBeans and perform operations on those MBeans, perform and monitor garbage collection, and perform lightweight memory and CPU profiling.

Step 1: Navigate to $JBOSS_Home/bin and edit standalone.conf.bat

Step 2: Add below configuration on standalone.conf.bat file.

set "JAVA_OPTS=%JAVA_OPTS% -Djboss.platform.mbeanserver"

set "JAVA_OPTS=%JAVA_OPTS% -Xbootclasspath/p:D:\JBOSS\jboss-as-7.1.1.Final\modules\org\jboss\logmanager\main\jboss-logmanager-1.2.2.GA.jar -Xbootclasspath/p:D:\JBOSS\jboss-as-7.1.1.Final\modules\org\jboss\logmanager\log4j\main\jboss-logmanager-log4j-1.0.0.GA.jar -Xbootclasspath/p:D:\JBOSS\jboss-as-7.1.1.Final\modules\org\apache\log4j\main\log4j-1.2.16.jar"

set "JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.manager=org.jboss.logmanager.LogManager"

set "JAVA_OPTS=%JAVA_OPTS% -Djboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager"



set "JAVA_OPTS=%JAVA_OPTS% -Djava.rmi.server.hostname=192.168.XXX.XXX"


           You can change port numbers & host name IP.


Step 3:  Navigate to $JAVA_HOME/bin of remote machine & open jvisualvm application as an administrator.

Step 4: Right Click on Remote & Add Remote Host (IP).

Step 5:  Add JMX connection using port number (9002) used on standalone.conf.bat, OK

Step 6: Open the connection & click on  Monitor.

Thanks :-)

No comments:

Post a Comment