How to Use jconsole to Access MBeans (Windows)
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.
To learn how to use MBeans in Windows follow these steps:
- You'll need to activate MBeans in Tomcat. For instructions for configuring Tomcat to use MBeans, click here.
- Start the Tomcat server.
- Open a command prompt.
- At the command prompt, type
jconsoleand hit Enter.
- Select the Catalina JVM and then click Connect:
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.
- The main page will now be displayed. Click the MBeans tab.
- The MBeans main page will be displayed. We will look at the Catalina MBeans. Click the + sign adjacent to Catalina in the left hand
- 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
examplesweb application that is shipped with Tomcat. Open WebModule -> //localhost/examples -> none -> none -> Operations -> start as illustrated below:
startoperation will start the
examplesweb application. To invoke the operation, click the start button. Note that a
stopoperation 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).