Create new JBoss Tools Documentation Jira issue

This will launch the Jboss Tools Jira page - to complete your feedback please login if needed, and submit the Jira.

JBoss.orgCommunity Documentation

Chapter 2. JMX Tools Tasks

2.1. Quick Start
2.2. Managing Application
2.3. Tomcat Managing
2.4. Eclipse Equinox Managing
2.5. Managing JBoss AS
2.6. Managing JBoss AS Remotely
2.7. Extension Task
2.7.1. Why we should do that?
2.7.2. Core Extensions
2.7.3. UI Extensions
2.8. Connections Creation Task
2.8.1. Establishing Connection

This chapter will give you answers on most popular questions asked by JMX plugin users.

To start using the JMX Tools it's necessary to open MBean Explorer. Go to Window > Show View > Other and then select MBean Explorer and click OK.

The MBean Explorer lists all the domains, mbeans, attributes, and operations inside a connection. When you double-click a MBean in the MBean Explorer, it opens a multi-page editor to manage the MBean. The MBean Editor is composed of these pages:

As it's been said earlier in the guide the JMX technology allows to monitor and manage Java applications. 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 Window > Show View > Other and then select MBean Explorer and click OK)

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

  7. In the Create JMX Connection dialog, hit Next 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. Press Finish to esteblish the connection with the application.

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

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

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

    You will get the "Operation inoked successfully" message.


  12. The final step is to make sure the application worked as it was expected. Open the terminal where you launched the application in step 3. Now you see the "hello, world" message on the screen.

It's possible to manage Tomcat using JMX Tools.

Currently, JMX Tooling is able to connect to Tomcat without authentication or with password-based authentication.

Using SSL for authentication is not supported: you need to make sure that the System property com.sun.management.jmxremote.ssl is set to false.

More information to manage Tomcat can be found in Tomcat management documentation.

Instructions to manage remotely Tomcat are available in Tomcat's monitoring documentation.

You can manage Equinox through the Equinox monitoring framework.

In this section we will show you how to connect to an Equinox server via JBoss JMX tools. First off, you need to make for example a simple servlet and run it on a server. This guide is not intended to teach you how to build application and run them on the server, you can read for example this tutorial to get a better idea of how to build server-based applications with Eclipse Equinox.

Once you have run an application on the server you can connect to it using JBoss JMX tools.

  1. Go to Window > Open Perspective > Other and select the JMX perspective.

  2. Switch to the MBean Explorer by going to Window > Show View > Other and selecting the MBean Explorer.

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

  4. Select the Advanced tab and set the JMX URL to service:jmx:rmi:///jndi/rmi://:8118/jmxserver.


You now have access to the MBeans exposed by Equinox.

Managing JBoss instances is not supported with the JMX Tools alone. You must also download and install the AS Tools portion of the JBoss Tools distribution. Even after installing the proper tooling, you cannot create a JBoss JMX connection yourself or through the Connection Wizard. The first step is to create a JBoss Server. The full instructions for this can be found in the AS Tools section, however, the short summary is:

Now you can explore MBeans exposed by a JBoss instance.

JBoss JMX Tool allow you to easily get access and mangane JBoss AS server remotely. In order to get connected to the instance of JBoss AS remotely you need to run the server or make sure the server is lauched.

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 by you 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.