Chapter 10. Tools

Various tools complete the Jolokia portfolio. Some of the are available under the Jolokia umbrella, some of them are hosted elsewhere. This chapter gives an overview of this tool landscape.

10.1. Jmx4Perl

10.2. Jolokia Roo Addon

The Jolokia Roo addon allows for easy integration of an agent servlet in an existing Roo web project.

This addon has been submitted to the Roobot, a central Roo addon registry. Until it is publicly available you can directly install the addon from our repository.

roo> osgi obr url add --url
roo> osgi obr start --bundleSymbolicName org.jolokia.roo

Alternatively, if there are problems with the approach above (which is currently the case because the hard coded public PGP keyserver which is used by Roo 1.1.1 is down) and you don't need PGP verification, you can install the addon bundle directly from our repository:

roo> osgi start --url

As soon as src/main/webapp/WEB-INF/web.xml is available in the roo project, Jolokia can be setup with the command jolokia setup. This will add the proper dependency in the pom.xml and adapt web.xml so that an agent servlet gets registered under the subcontext jolokia (so, when you web application is deployed under the context /mywebapp, the agent is reachable under /mywebapp/jolokia. This command knows about the options described in Table 10.1, “jolokia setup Options”, all of which are optional.

Table 10.1. jolokia setup Options

Option Description
--addPolicy This adds an additional jolokia-access.xml below src/main/resources to allow putting access restrictions into place. The installed template, however, doesn't come with any restriction but contains sample configurations commented out.
--addJsr160Proxy Adapts the agent servlet's init-param to add an additional org.jolokia.jsr160.Jsr160RequestDispatcher request dispatcher which allows the installed servlet to act as an JSR-160 proxy. See Chapter 5, Proxy Mode for details about the JSR-160 proxy
--addDefaultInitParams By default, the servlet gets registered without any init parameters. With this option, all available init-param are added to the servlet definition with their default values.