Enhancing JMX descriptors in Apache Tomcat
Budddhika Chamith De Alwis
Enhancing JMX descriptors in Apache Tomcat
JMX is a technology which can be used to manage and monitor Java applications. A proper JMX support can significantly ease the task of remotely configuring, managing, and monitoring a Java application. For an application to be manageable via JMX, it has to be instrumented by providing it with JMX objects called MBeans which are then used to manage classes within the application.
Apache Tomcat is JMX aware and this JMX support can be leveraged to provide a management interface for configuring and monitoring a Tomcat instance to a certain extent. Tomcat utilizes a JMX implementation similar to Apache Commons Modeler. Tomcat mainly uses Dynamic MBean variant and utilize the features of modeler to make easier for developing Dynamic MBeans by allowing required meta-data to be configured from an XML description (mbeans-descriptors.xml) of each MBean to be supported.
Even though required JMX infrastructure is present in Tomcat some lapses (some of them described in section Project Details) currently present in the infrastructure and APIs which this project is aimed at addressing, makes it hard to utilize it to fully configure and manage a remote Tomcat instance from the scratch. Such complete JMX infrastructure would be beneficial for any endeavor which is aimed at providing a remote management application for Tomcat. (It seems that there is some interest towards this end at present. See  )
Tomcat has a JMX implementation which closely resembles commons modeler. DynamicMBeans and its extensions are basically used in the JMX implementation. A central Registry is used to read Mbean related meta-data and register the MBeans with the MBeans server. MbeanFactory provides facility to remotely generate some of the internal server components along side with their associated MBeans.
The aim of this project is enable a complete Tomcat instance to be remotely configured with least possible up front configurations. Some lapses regarding this front has been currently identified which this project would aim to address.
Currently there is no support for remotely generating MBeans associated with Service components within the server. This facility is required to be added to the MbeanFactory along with other related functions.
Some JMX getters/setters not aligned with changes to underlying objects. Some mbeans-descriptor.xml files contain operations which underlying object doesn't expose due some mismatching changes to APIs and descriptor files. (e.g: MbeansFactory descriptors contains methods non existent in actual class).
- Attributes exposed as read/write that should be read-only or need more work to make write operations safe. (e.g: Care must be taken to associate exactly one Engine component with a Service component)
- Providing MBean generation options for any new but required resources hitherto not supported.
- Making methods used in remote configurations more friendly towards to that end. (e.g: Parameterize file path related parameters with URLs as permitted)
- Updated JMX descriptors which accurately reflect underlying objects.
- Added functionality required to enable a complete Tomcat instance to be configured entirely via JMX.
- Related documentation as required.
April 20th to May 23th
Getting familiarized with Tomcat in general and discuss and identifying areas that need to be changed. An overall idea about Tomcat internal components and their relationships will be required to understand how to fully configure a Tomcat instance with respect to its component functionalities. Coming up with a to do list of changes along with their scheduled completion times, will be done during this period also leaving room for any possible additions later on as well.
May 23th to July 12th
Adding missing functionalities in MBean generation codes. JMX API and descriptor enhancements.
June 12 th to July 31st
JMX API and descriptor enhancements.
July 31 st to August 16 th
Fixing any bugs identified, reviewing codes and providing required documentation.
I am a fourth year student of Computer Science and Engineering Department of University of Moratuwa, . I have been working with open source technologies for the last couple of years and I am familiar with Apache Axis2 and ODE projects. I participated and successfully completed GSOC 2009 in Apache ODE project . For last several weeks I have been familiarizing myself with the Apache Tomcat project. So far I was also able to contribute to the Apache Tomcat project by providing an enhancement  and an initial patch regarding the first issue mentioned in the project details section. 
Apart from web service technologies I have worked with other technologies such as JSP/Servlets, JSF, Hibernate, and Jasper reporting and have developed several applications including an e-commerce web application and gaming application. I am passionate about open source software development and hope to continue with it in the future.