JBoss.orgCommunity Documentation

JMX Tools Reference Guide

Version: 4.0.0


1. Introduction
1.1. What is JMX Tools?
1.2. Key Features of JMX Tools
2. JMX Tools Tasks
2.1. Quick Start
2.2. Managing Application
2.3. Tomcat Managing
2.4. Managing a JBoss application server Remotely
2.5. Extension Task
2.5.1. Why you extend the framework
2.5.2. Core Extensions
2.5.3. UI Extensions
2.6. Connections Creation Task
2.6.1. Establishing Connection
3. References
3.1. MBean Explorer
3.2. MBean Editor
3.2.1. Notifications Page
4. Summary
4.1. Other relevant resources on the topic

JBoss Tools' JMX project is a fork of eclipse-jmx, a project by Jeff Mesnil. It was forked with permission.

This chapter will provide answers to common questions asked by JMX plugin users.

In this section we will show you how to get connected to a sample Java application and run the sayHello() method remotely from inside of the MBean Explorer.

  1. Save the bundle of JMX API sample classes, jmx_examples.zip, to your working directory.

  2. Unzip the bundle of sample classes.

  3. Compile the example Java classes from within where you unpacked the files directory.

    javac com/example/*.java
  4. Start the Main application, specifying the properties that expose Main for remote management:

             
    java -Dcom.sun.management.jmxremote.port=9999 \
    -Dcom.sun.management.jmxremote.authenticate=false \
    -Dcom.sun.management.jmxremote.ssl=false \
    com.example.Main
     

    If everything was done correctly you will see the

    Waiting for incoming requests...

    message on the screen.

  5. Now launch the Eclipse IDE, in Eclipse open the MBean Explorer. Go to WindowShow ViewOther, select MBean Explorer, and then click the OK button)

  6. Click the New Connection icon in the MBean Explorer menu bar.

  7. In the Create JMX Connection dialog, click the Next button and then click the Advanced tab.

  8. In the JMX URL input field enter the following URL:

    service:jmx:rmi:///jndi/rmi://:9999/jmxrmi

  9. Click the Finish button to establish the connection with the application.

  10. Now expand the connection you have just created, open the com.example package, and click the sayHello() method.

    Once the sayHello() method is selected the MBean Editor is activated.

  11. In the MBean Editor go to the Operation Details section and click the sayHello() button.

    You will get the "Operation invoked successfully" message.


  12. The final step is to make sure the application worked as expected. Open the terminal where you launched the application in step 3. You should see output similar to the following:

    [matthew@localhost jmx_examples]$ java -Dcom.sun.management.jmxremote.port=9999 \
    > -Dcom.sun.management.jmxremote.authenticate=false \
    > -Dcom.sun.management.jmxremote.ssl=false \
    > com.example.Main
    Waiting for incoming requests...
    hello, world

This section will outline how to contribute your own Server type with some default behavior.

The MBean Explorer supports several different types of connections. The tooling itself comes only with a default connection type, however other adopters can provide additional connection types that may require additional or non-spec behavior. Connections can be in either the connected state or the disconnected state. Some connection types (such as the default connection type) allow you to control the current state. Other connection types may not.

Similarly, some connection types may be able to be created, and others may not. The default connection type, for example, can be created and deleted at will. The AS Tools connection type, which represents a JBoss server, does not allow you this level of control. A JBoss JMX connection is created when a JBoss server is created in the server's view, and deleted when said server is deleted. The JMX connection for this server is in the connected state only when the server is started.

This document has provided an overview of the functionality included with JXM Tools, as well as walking you through the steps on managing Tomcat, Eclipse Equinox or JBoss Instances and how to create new JMX connections. If you have questions or suggestions concerned both the documentation and tools behavior, you are welcome to JBoss Tools Users forum. Please, use Jira to report bugs and requests on documentation.

You can find the JBoss Developer Studio/JBoss Tools release documentation at http://docs.jboss.org/tools in the corresponding release directory.

The latest documentation builds are available at http://download.jboss.org/jbosstools/nightly-docs.

The JBoss JXM Wiki can be found at http://www.jboss.org/community/wiki/JBossMX

For more information about JMX technology please visit JMX Technology Home Page