Questions tagged [jmx]

Java Management eXtensions is a standard Java API that enables the instrumentation and monitoring of a running Java program.

JMX

Java Management Extensions (JMX) is a Java technology that supplies tools for managing and monitoring applications, system objects, devices (e. g. printers) and service oriented networks. Those resources are represented by objects called MBeans (for Managed Bean). In the API, classes can be dynamically loaded and instantiated. Managing and monitoring applications can be designed and developed using the Java Dynamic Management Kit (JDMK) which is also available and more commonly implemented using the open sourced version OpenDMK.

JMX classes live in the javax.management packages.

JMX is a part of the Java platform since Java SE 5 (though some components are optional and not bundled with the JRE).

References


Glossary

  • MBean: A logical unit, or service, most easily visualized as a Java Bean, that provides a defined service exposed through the JMX protocol. One instance of an MBean typically is identified by an ObjectName (see below). These services commonly include, but are not limited to:
    1. Getters and Setters that allow the reading and writing of the MBean's Attributes. For example, an MBean might represent a thread pool and an attribute named MaxPoolSize could be read to determine what the maximum allowable size of the pool is, while writing the attribute would modify the maximum allowable size of the pool that the MBean is managing.
    2. Operations that execute a specific piece of functionality in an MBean. Operations can be thought of as bean methods that do not fit the attribute (or Java Bean property) model. They may have no return value and have zero, one or more parameters. For example, an operation called stop might stop the thread pool that is managed by an MBean.
    3. MBeans may emit Notifications when a specific condition is met, or the MBean detects a specific event. Notifications can be subscribed to by NotificationListeners that have registered to be notified of these events. For example, an MBean might send notifications when the thread pool it manages is started, and then again when it is stopped.
  • MBeanServer: The MBeanServer plays multiple roles in a JMX environment:
    • It is the central registry for MBeans within a given JMX domain. As the registry, the MBeanServer provides functionality to register, unregister, enumerate and search for MBeans.
    • The MBeanServer provides the invocation interface for accessing registered MBeans. When a thread wants to read or write attributes, execute an operation or [un]register a notification listener in an MBean instance, it does so through the MBeanServer by providing the ObjectName of the target MBean and the parameters of the invocation.
  • ObjectName: This is a composite key that serves to both define the unique identity of one MBean, and as pattern that describes a group of MBeans that have matching sub-keys of their ObjectNames in common. There are 2 parts to an ObjectName:
    1. The Domain Name:
    2. The Key Properties:

A visual of the structure of an ObjectName

2442 questions
20
votes
5 answers

Is there any JMX - REST bridge available?

Hi I would like to monitor a Java application using the browser but at the same time utilising the existing JMX infrastructure. I know that JMX provides a HTTP interface but I think it provides a standard web gui and its not possible to mashup its…
Kostas
  • 702
  • 3
  • 8
  • 17
19
votes
4 answers

Disabling JMX in a spring application

I'm trying to disable jmx so that i don't get: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mbeanExporter'anymore. I've found a partial answer saying that I should include this in the…
OntZ
  • 263
  • 1
  • 3
  • 12
19
votes
4 answers

Failed to Unregister DataSource JMX MBean While Shutting Down a Spring Boot Application

I have a simple Spring Boot application using org.apache.commons.dbcp2.BasicDataSource as dataSource bean. The data source is exposed as MBean automatically by Spring boot. The bean declaration: @Bean public DataSource dataSource() { …
jlai
  • 909
  • 1
  • 10
  • 17
18
votes
4 answers

Package accessible from more than one module:

When trying to register an MBean in JMX Console I'm getting the following error message: The package javax.management is accessible from more than one module: , java.management I'm using Eclipse and I have no module-info.java file in my…
Evandro Pomatti
  • 13,341
  • 16
  • 97
  • 165
17
votes
1 answer

Use of JMX and How to use for existing applications

We have distributed web application developed few years back on JDK 5. How JMX will help this application? 1) Will it help me to monitor performance (Memory, CPU and Network & Disk IO)? 2) If so then application is deployed in multiple…
learner
  • 625
  • 2
  • 11
  • 25
17
votes
5 answers

JMX agent throws java.net.MalformedURLException when host name is set to all numeric value

We are using tomcat 7.0.27 in our application. We are below setting jmx properties on tomcat startup. -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8666 -Dcom.sun.management.jmxremote.ssl=false…
user3012665
  • 171
  • 1
  • 1
  • 4
17
votes
5 answers

create heap dump from within application, without HotSpotDiagnosticMXBean

How can i create a heap dump from within my application, without using the class HotSpotDiagnosticMXBean. Due to access restriction of java/rt.jar i am not able to compile it with a dependency to HotSpotDiagnosticMXBean. I know how solve the…
Chriss
  • 5,157
  • 7
  • 41
  • 75
16
votes
3 answers

How to change tomcat jmx password's file permission

I am trying to secure JMX access on my local tomcat instance hosted on Windows platform. I have created access and password files and plugged those using the following VM…
user804157
16
votes
3 answers

JConsole command line credentials

Is it possible to pass credentials for monitored resource to JConsole while starting it via command line. I've got the command like that right now. ${jdk.home}/bin/jconsole.exe -J-Djava.class.path=${jdk.home}/lib/jconsole.jar; …
2DH
  • 1,648
  • 2
  • 10
  • 19
16
votes
8 answers

Creating MBean in Java

I am trying to make a class implement an MBean Interface so I can interrogate the properties at runtime. The class I am trying to interrogate is as follows public class ProfileCache implements ProfileCacheInterfaceMBean{ private Logger logger =…
Biscuit128
  • 5,218
  • 22
  • 89
  • 149
16
votes
2 answers

Disable jmx in activemq network of brokers (spring, xbean)

Since I've struggled a lot with this problem, I am posting my solution. Disabling jmx in an activemq network of brokers removes race conditions about the registration of the jmx connector. When starting multiple activemq servers on the same…
subes
  • 1,832
  • 5
  • 22
  • 28
16
votes
1 answer

JBoss SAR vs EAR/WAR packaging

When would I choose to deploy as a JBoss SAR instead of an EAR? This is more of a general question and I'm looking for guidelines that explain the pros and cons of each deployment model and which one is applicable when.
nemo
  • 1,504
  • 3
  • 21
  • 41
15
votes
2 answers

Web based JMX console for Tomcat?

Are there any web based JMX consoles available for Tomcat that basically provide the same functionality as Tomcat's JMX Proxy Servlet but in a more user friendly manner? I understand that I could simply use jconsole over RMI but this solution is not…
Muton
  • 761
  • 2
  • 7
  • 16
15
votes
4 answers

Apache ActiveMQ browser can't connect to JMX console

I am using Apache ActiveMQ version 5.8.0 and I downloaded Apache ActiveMQ Browser version 2.5.2.8 Within Apache ActiveMQ I edited the activemq.xml configuration to use JMX:
Mark Veenstra
  • 4,691
  • 6
  • 35
  • 66
15
votes
2 answers

How to set request timeout for JMX Connector

I'm trying to set request timeout for JMX Connector but seems like it doesn't work. env.put("jmx.remote.x.request.waiting.timeout", new Long(30000)); But since it didn't work, i googled to see the reason and found out that in standard JMX remote…
sasankad
  • 3,543
  • 3
  • 24
  • 31