JMX

uPortal 2 does not currently export any JMX MBeans for management. Tomcat, the usual container, does export quite a bit of useful information as does the JVM.

JMX Over Known Ports

The default JMX server implementation only lets the administrator specify one of the ports to use when connecting. The second port is chosen randomly when the JMX client connects. This makes having a firewall on the machine very difficult. A solution to this is to write custom code to start a JMX Server when the server starts.

Solution

Based on some code from George Lindholm I've created a generic ServletContextListener that starts a MBean server that listens on two pre-configured ports. JavaManagementServerListener.java To use this listener it needs to be added to a web application and the following XML snippets added to the web.xml

<context-param>
    <param-name>org.jasig.portal.servlet.JavaManagementServerListener.portOne</param-name>
    <param-value>9000</param-value>
</context-param>
<context-param>
    <param-name>org.jasig.portal.servlet.JavaManagementServerListener.portTwo</param-name>
    <param-value>9001</param-value>
</context-param>
<listener>
    <listener-class>org.jasig.portal.servlet.JavaManagementServerListener</listener-class>
</listener>

This listener should only be installed in ONE web application per JVM

Update

This functionality is now part of the 5.5.25 Tomcat release as the JMXAdaptorLifecycleListener source code