Using VisualVM with WildFly: Difference between revisions
No edit summary |
|||
Line 25: | Line 25: | ||
==VisualVM Classpath and Startup Options== | ==VisualVM Classpath and Startup Options== | ||
In order to be able to access the JBoss native management interface directly, Visual VM needs specific JBoss client libraries in its classpath. It also needs the <tt>-Dmodule.path</tt> system property, as specified below. | |||
== | ===Linux and Mac=== | ||
<pre> | <pre> | ||
</pre> | </pre> | ||
===Windows=== | ===Windows=== | ||
Line 53: | Line 43: | ||
"%JAVA_HOME%\bin\jvisualvm.exe" -cp:a %JBOSS_MODULES%\org\jboss\remoting3\remoting-jmx\main\remoting-jmx-1.0.2.Final.jar;%JBOSS_MODULES%\org\jboss\remoting3\main\jboss-remoting-3.2.3.GA.jar;%JBOSS_MODULES%\org\jboss\logging\main\jboss-logging-3.1.0.GA.jar;%JBOSS_MODULES%\org\jboss\xnio\main\xnio-api-3.0.3.GA.jar;%JBOSS_MODULES%\org\jboss\xnio\nio\main\xnio-nio-3.0.3.GA.jar;%JBOSS_MODULES%\org\jboss\sasl\main\jboss-sasl-1.0.0.Final.jar;%JBOSS_MODULES%\org\jboss\marshalling\main\jboss-marshalling-1.3.11.GA.jar;%JBOSS_MODULES%\org\jboss\marshalling\river\main\jboss-marshalling-river-1.3.11.GA.jar | "%JAVA_HOME%\bin\jvisualvm.exe" -cp:a %JBOSS_MODULES%\org\jboss\remoting3\remoting-jmx\main\remoting-jmx-1.0.2.Final.jar;%JBOSS_MODULES%\org\jboss\remoting3\main\jboss-remoting-3.2.3.GA.jar;%JBOSS_MODULES%\org\jboss\logging\main\jboss-logging-3.1.0.GA.jar;%JBOSS_MODULES%\org\jboss\xnio\main\xnio-api-3.0.3.GA.jar;%JBOSS_MODULES%\org\jboss\xnio\nio\main\xnio-nio-3.0.3.GA.jar;%JBOSS_MODULES%\org\jboss\sasl\main\jboss-sasl-1.0.0.Final.jar;%JBOSS_MODULES%\org\jboss\marshalling\main\jboss-marshalling-1.3.11.GA.jar;%JBOSS_MODULES%\org\jboss\marshalling\river\main\jboss-marshalling-river-1.3.11.GA.jar | ||
</pre> | </pre> | ||
<font color=red>TODO: This script worked, but modify it and test it to use jboss</font> | |||
==Configuring Access to the JBoss Instance== | ==Configuring Access to the JBoss Instance== |
Revision as of 21:25, 18 October 2016
External
Internal
Overview
A JBoss instance can be configured to allow a direct VisualVM remote JMX connection into it. This article explains how to configure JBoss and VisualVM in order to achieve this.
JBoss Configuration
The JBoss instance configuration required to allow a VisualVM connection is described in the following articles:
Configuring VisualVM to Connect over JMX to a JBoss Instance
VisualVM Classpath and Startup Options
In order to be able to access the JBoss native management interface directly, Visual VM needs specific JBoss client libraries in its classpath. It also needs the -Dmodule.path system property, as specified below.
Linux and Mac
Windows
@echo off set JBOSS_HOME=C:\ovidiu\jboss-as-7.1.1.Final set JBOSS_MODULES=%JBOSS_HOME%\modules set JAVA_HOME="C:\Program Files\Java\jdk1.7.0_79" "%JAVA_HOME%\bin\jvisualvm.exe" -cp:a %JBOSS_MODULES%\org\jboss\remoting3\remoting-jmx\main\remoting-jmx-1.0.2.Final.jar;%JBOSS_MODULES%\org\jboss\remoting3\main\jboss-remoting-3.2.3.GA.jar;%JBOSS_MODULES%\org\jboss\logging\main\jboss-logging-3.1.0.GA.jar;%JBOSS_MODULES%\org\jboss\xnio\main\xnio-api-3.0.3.GA.jar;%JBOSS_MODULES%\org\jboss\xnio\nio\main\xnio-nio-3.0.3.GA.jar;%JBOSS_MODULES%\org\jboss\sasl\main\jboss-sasl-1.0.0.Final.jar;%JBOSS_MODULES%\org\jboss\marshalling\main\jboss-marshalling-1.3.11.GA.jar;%JBOSS_MODULES%\org\jboss\marshalling\river\main\jboss-marshalling-river-1.3.11.GA.jar
TODO: This script worked, but modify it and test it to use jboss
Configuring Access to the JBoss Instance
Explicit JMX Connection
Start VisualVM with the script describe above.
Then go to "Application" left tab, right click on "Remote" and "Add Remote Host...".
Use the remote host IP address (or host name).
Right-click on the newly added "remote host" and "Add JMX Connection..."
If the JVM to be connected to over JMX runs on the local host, right click on the "Local" node, then right-click and then "Add JMX Connection"
As "Connection" use:
service:jmx:remoting-jmx://<your-server-ip-address>:9999
replacing <your-server-ip-address> with the actual address.
Select "Use Security Credentials"
Use an user name and a password that was previously added to the "ManagementRealm" of the application server.
Optionally "Save security credentials"
and then check "Do not require SSL connection".
Alternative JMX Connection using Attach API
Install the VisualVM-MBeans as described below.
If the JBoss instance we want to inspect runs on the local host, it will be available under the "Local" node:
Double click on it, the MBean access should be available in the MBeans tab:
JMX MBean Access
In order to access JMX interfaces of MBeans, you will need to install the "VisualVM-MBeans" VisualVM plugin.
A plugin can be installed as follows:
Tools -> Plugins -> Available Plugins -> Check the plugin to be installed -> Install.