How to Use jconsole to Access MBeans (Windows)

  • google plus

In Brief...

MBeans provide potentially important properties and operations to the Apache Tomcat administrator. In this topic, we'll explore how to access MBeans using the jconsole application that is provided in the JDK.

Take our Apache Tomcat 8.0 Administration for Windows Training course for free.

See the Course Outline and Register

Instructions

To learn how to use MBeans in Windows follow these steps:

  1. You'll need to activate MBeans in Tomcat. For instructions for configuring Tomcat to use MBeans, .
  2. Start the Tomcat server.
  3. Open a command prompt.
  4. At the command prompt, type jconsole and hit Enter.
  5. Select the Catalina JVM and then click Connect:
    Connect VM for jconsole
    Since the connection is not through SSL, a warning will be displayed. Click the button labelled Insecure connection. In practice, you'll want to secure access to the MBeans. For more information on securing the JMX port visit the Oracle documentation at https://docs.oracle.com/javase/8/docs/technotes/guides/management/agent.html.
  6. The main page will now be displayed. Click the MBeans tab.
    jconsole MBeans tab
  7. The MBeans main page will be displayed. We will look at the Catalina MBeans. Click the + sign adjacent to Catalina in the left hand panel.
    jconsole MBeans page
  8. Let's follow one branch of the tree to give you an idea of the what can be accomplished using MBeans. We'll locate the operations available for the examples web application that is shipped with Tomcat. Open WebModule -> //localhost/examples -> none -> none -> Operations -> start as illustrated below:
    jconsole WebModule operations for example web app
    The start operation will start the examples web application. To invoke the operation, click the start button. Note that a stop operation is also available on the list of operations, and this action will stop the web application (attempts to access a stopped web application will result in Tomcat sending an HTTP status of 404 to the browser).

Webucator provides instructor-led training to students throughout the US and Canada. We have trained over 90,000 students from over 16,000 organizations on technologies such as Microsoft ASP.NET, Microsoft Office, XML, Windows, Java, Adobe, HTML5, JavaScript, Angular, and much more. Check out our complete course catalog.

Categories

Courses

Author: Stephen Withrow

Stephen has over 30 years' experience in training, development, and consulting in a variety of technology areas including Java, C, C++, XML, JavaScript, AJAX, Tomcat, JBoss, Oracle, and DB2. His background includes design and implementation of business solutions on client/server, Web, and enterprise platforms. Stephen is a published writer in both technical and non-technical endeavors. Stephen received an undergraduate degree in Computer Science and Physics from Florida State University.

Discuss