1. 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.

2. 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

3. what is the use of Object Factories?

Factory methods that will be used to create objects just like in a static way.

4. 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.

5. 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).

6. 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.

7. 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">

8. 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).

9. 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.

10. How will you check if JMX agent is working in Tomcat?

When Tomcat is running as a service on Windows, you do not need setenv.bat, you need to use tomcat8w.exe and GUI toll for adding options.

Download Interview PDF

11. How to run JMX Java application in uDeploy process?

Copy {WLHOME}/wlserver_**/server/lib/wlfullclient.jar file into {agent home}/opt/groovy-1.8.8/lib Then the Groovy script (that migrated from my JMX Java application) works.

12. What is dependency injection?

A pattern (design) whereby collaborators are passed into an object from the outside - the object does not allocate them for itself.

13. Why is dependency injection useful?

Different collaborators for different environments can be injected - test, production, test-database, real database. This allows classes to be tested independent of its collaborators (makes it easy to pass in stub or mock objects).

14. How is dependency injection performed in the bean-file XML?

There are nested elements within each bean definition.

16. What is the advantage of constructor dependency injection?

Here are a few advantages:
☛Constructor
☛Mandatory
☛Mutable
☛Natural Java approach.

17. How does a Spring Factory Bean work?

It is created by Spring automatically, any setters are called on the factory then its getObject() method is called to allocate the actual bean.

18. What are the 5 scopes defined in Spring?

5 scopes defined in Spring:
☛ Singleton
☛ Prototype
☛ Session - only valid in a Web application context
☛ Request - ditto
☛ Custom

19. List 2 examples of anonymous bean?

Two examples:
☛ Nested or inner beans
☛ Configuration beans

20. What is a nested bean?

Scopes the bean within the bean that uses it. One less bean id in the set of bean names.

21. 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.

22. 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

23. What is a join-point?

Joint-point is an expression that defines zero or more join-points.

24. What is an advice in JMX?

he code that implements the cross cutting-concern that will be inserted at each join-point.

Download Interview PDF

25. List some types of advice?

Types of advice:
☛ Before
☛ AfterReturning
☛ AfterThrowing
☛ After
☛ Around