JMX

  Home  Applications Programs  JMX


“JMX Interview Questions and Answers will guide us now that Java Management Extensions (JMX) is a Java technology that supplies tools for managing and monitoring applications, system objects, devices such as printers and service oriented networks. Those resources are represented by objects called MBeans, so learn more about JMX by this JMX Interview Questions with Answers guide”



30 JMX Questions And Answers

1⟩ What if there is no JMX data?

No JMX-related output in the logs. I can connect to the JVM with jconsole using the supplied credentials, browse to the configured mbean, jackhammer the Refresh button and get new values. Splunk, however, gets nothing, and leaves no indication as to why. Searching for "host=redacted" or "source='jmx://redacted'" yields nothing.

This is not a complicated setup, nor is it a complicated app. Single server test environment, just trying to get JMX data into Splunk directly instead of having to do some nasty search-time field extraction after indexing data output from JMXTrans text files. It's currently running on JDK 1.7, I tried 1.6 for science to no avail. No idea how to proceed since I'm not getting any errors and there doesn't appear to be a way to raise the log level.

 188 views

2⟩ How to access JMX (Java Beans) from a process running in docker container?

You have to expose the JMX port to the host and even used Sun specific options while running the Java process.

You are able to telnet to the host ip and the exposed JMX port, which tells that it is accessible. But I can't figure out a way to use JConsole and connect to the JMX service running in the container.

☛ Djava.rmi.server.hostname=$JMX_HOSTNAME

☛ Dcom.sun.management.jmxremote.port=$JMX_PORT

☛ Dcom.sun.management.jmxremote.rmi.port=$JMX_PORT

 198 views

4⟩ How would you connect JMX monitoring to Tomcat?

You have to install the jmx_ta on a 6.2 forwarder and getting the following error"

12-04-2014 16:08:02.884 +0000 ERROR ModularInputs - Introspecting scheme=jmx: script running failed (exited with code 1).

12-04-2014 16:08:02.884 +0000 ERROR ModularInputs - Unable to initialize modular input "jmx" defined inside the app "jmx_ta":

Introspecting scheme=jmx: script running failed (exited with code 1).

 201 views

5⟩ What is Managed Bean or MBean?

A managed bean - sometimes simply referred to as an MBean - is a type of JavaBean, created with dependency injection. Managed Beans are particularly used in the Java Management Extensions technology. But, with the Java EE 6 specification provides for a more detailed meaning of a managed bean.

 186 views

6⟩ What is JMX architecture?

JMX is based on a 3-level architecture:

► The Probe level contains the probes (called MBeans) instrumenting the resources. Also called the Instrumentation level.

► The Agent level, or MBeanServer, is the core of JMX. It is an intermediary between the MBean and the applications.

► The Remote Management level enables remote applications to access the MBeanServer through Connectors and Adaptors. A connector provides full remote access to the MBeanServer API using various communication frameworks (RMI, IIOP, JMS, WS), while an adaptor adapts the API to another protocol (SNMP) or to Web-based GUI (HTML/HTTP, WML/HTTP).

 236 views

7⟩ Which is the best tool for monitoring Weblogic server(WLS8)?

WLS8 supports JMX but it uses weblogic implementation of JMX server. It does not supports generalise sun javax API which can be used with any JVM. There are some patches available which can be used with WLS8 which will enabled JMX based monitoring. Once JMX is enable there are many monitoring tools available in the market. One can even go for custom JMX utilities which can be used for server monitoring.

 190 views

8⟩ How to connect to multiple jmx instances using Splunk for JMX?

Install Splunk 6 on your server which contains about 6 different JMX instances. you want to hook all of them up into our Splunk JMX plugin.

It is as easy as editing the config.xml file and adding a new jmx server host? Currently this is:

<jmxserver host="[[system name]]" jvmDescription="common_raw" jmxport="53632">

 189 views

10⟩ Explain JMX Concepts and Architecture?

MX is conceptually simple, yet bears the fruit of years of domain experience and research. In a nutshell, JMX defines a standard means for applications to expose management functionality

1)Instrumentation level

2)Agent level

3)Management level

 186 views

11⟩ What is JMX?

JMX is native to the Java programming language. As a result, it offers natural, efficient, and lightweight management extensions to Java-based functions. It consists of a set of specifications and development tools for managing Java environments and developing state-of-the-art management solutions for applications and services.

 193 views

12⟩ How is the application JVM configured?

The application JVM is configured with the following options:

☛ com.sun.management.jmxremote

☛ com.sun.management.jmxremote.port=1088

☛ com.sun.management.jmxremote.authenticate=false

☛ com.sun.management.jmxremote.ssl=false

 212 views

14⟩ What is a named pointcut and why to use one?

A pointcut expression that has a name so it can be reused.

Resons To use:

☛ Annotation: @Pointcut applied to a dummy method - name of the dummy method is the name of the pointcut expression.

☛ XML aop:pointcut id=".." expression=".."

 200 views

15⟩ What are the various actions performed when an application context is created?

Here are 5 steps:

☛ Read bean file XML (or process annotations). Build internal "map" of beans and determine dependency tree.

☛ Post process the definitions - e.g. resolve ${variables}

☛ Allocate objects - dependency inject constructor args and invoke setter.

☛ Perform any initialisation - 3 approachs: @PostConstruct, init-method, InitializingBean

☛ Bean post-processors - e.g. wrap with proxy, @Required

 186 views

19⟩ What is a cross-cutting concern?

A requirement that cuts across all the natural modules of your application.

Examples:

Tracing, security, transactions, business rules.

Two problems with cross-cutting concerns.

☛ Code tangling - method doing too many unrelated tasks

☛ Code scattering - code duplication leading to maintenance headache

 212 views

20⟩ What is lazy initialization?

Bean is not allocated until it is actually needed - dependency injected - or requested via getBean(). specify lazy="true" (false by default). Only useful if bean genuinely may never be used in most runs of the application.

 229 views