Unlike most Catalina components, there are several standard
Listener implementations available. As a result,
the className
attribute MUST be used to select the
implementation you wish to use.
APR Lifecycle Listener (org.apache.catalina.core.AprLifecycleListener)
The APR Lifecycle Listener checks for the presence of
the APR/native library and loads the library if it is present. For more
information see the APR/native guide.
This listener must only be nested within Server
elements.
The following additional attributes are supported by the APR
Lifecycle Listener:
Attribute | Description |
---|
SSLEngine |
Name of the SSLEngine to use. off: Do not use SSL, on: Use SSL but no
specific ENGINE. The default value is on. This initializes the
native SSL engine, which must be enabled in the APR/native connector by
the use of the SSLEnabled attribute.
See the Official OpenSSL website
for more details on supported SSL hardware engines and manufacturers.
|
SSLRandomSeed |
Entropy source used to seed the SSLEngine's PRNG. The default value
is builtin . On development systems, you may want to set
this to /dev/urandom to allow quicker start times.
|
Jasper Listener (org.apache.catalina.core.JasperListener)
The Jasper Listener initializes the Jasper 2 JSP engine
before any web applications that may use it are loaded. For more
information on the Jasper 2 JSP engine see the
Jasper How To.
This listener must only be nested within Server
elements.
No additional attributes are supported by the Jasper Listener
.
Server Lifecycle Listener
(org.apache.catalina.mbeans.ServerLifecycleListener)
The Server Lifecycle Listener initializes the
MBeanServer for the MBeans that may be used to manager Tomcat via JMX.
Without this listener, none of the Tomcat MBeans will be available.
This listener must only be nested within Server
elements.
No additional attributes are supported by the Server Lifecycle
Listener.
Global Resources Lifecycle Listener
(org.apache.catalina.mbeans.GlobalResourcesLifecycleListener)
The Global Resources Lifecycle Listener initializes the
Global JNDI resources defined in server.xml as part of the Global Resources element. Without this
listener, none of the Global Resources will be available.
This listener must only be nested within Server
elements.
No additional attributes are supported by the Global Resources
Lifecycle Listener.
JMX Remote Lifecycle Listener
(org.apache.catalina.mbeans.JmxRemoteLifecycleListener)
This listener requires catalina-jmx-remote.jar
to be placed
in $CATALINA_HOME/lib
. This jar may be found in the extras
directory of the binary download area.
The JMX Remote Lifecycle Listener fixes the ports used by
the JMX/RMI Server making things much simpler if you need to connect
jconsole or a similar tool to a remote Tomcat instance that is running
behind a firewall. Only these ports are configured via the listener. The
remainder of the configuration is via the standard system properties for
configuring JMX. For further information on configuring JMX see
Monitoring and Management Using JMX included with the Java SDK
documentation.
If this listener was configured in server.xml as:
| | |
|
<Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener"
rmiRegistryPortPlatform="10001" rmiServerPortPlatform="10002" />
| |
| | |
with the following system properties set (e.g. in setenv.sh):
| | |
|
-Dcom.sun.management.jmxremote.password.file=$CATALINA_BASE/conf/jmxremote.password
-Dcom.sun.management.jmxremote.access.file=$CATALINA_BASE/conf/jmxremote.access
-Dcom.sun.management.jmxremote.ssl=false
| |
| | |
$CATALINA_BASE/conf/jmxremote.password containing:
$CATALINA_BASE/conf/jmxremote.access containing:
then opening ports 10001 (RMI Registry) and 10002 (JMX/RMI Server) in your
firewall would enable jconsole to connect to a Tomcat instance running
behind a firewall using a connection string of the form:
| | |
|
service:jmx:rmi://<hostname>:10002/jndi/rmi://<hostname>:10001/jmxrmi
| |
| | |
with a user name of admin
and a password of
letmein
.
Note that the example above does not use SSL. JMX access should
be considered equivalent to administrative access and secured accordingly.
This listener must only be nested within a Server
element.
The following additional attributes are supported by the JMX Remote
Lifecycle Listener:
Attribute | Description |
---|
rmiRegistryPortPlatform |
The port to be used by the JMX/RMI registry for the Platform MBeans.
The replaces the use of the
com.sun.management.jmxremote.port system property that
should not be set when using this valve.
|
rmiServerPortPlatform |
The port to be used by the Platform JMX/RMI server.
|
useLocalPorts |
Should any clients using these ports be forced to use local ports to
connect to the the JMX/RMI server. This is useful when tunnelling
connections over SSH or similar. Defaults to false .
|
JRE Memory Leak Prevention Listener
(org.apache.catalina.core.JreMemoryLeakPreventionListener)
The JRE Memory Leak Prevention Listener provides
work-arounds for known places where the Java Runtime environment uses
the context class loader to load a singleton as this will cause a memory
leak if a web application class loader happens to be the context class
loader at the time. The work-around is to initialise these singletons when
this listener starts as Tomcat's common class loader is the context class
loader at that time. It also provides work-arounds for known issues that
can result in locked JAR files.
This listener must only be nested within Server
elements.
The following additional attributes are supported by the JRE
Memory Leak Prevention Listener:
Attribute | Description |
---|
appContextProtection |
Enables protection so that calls to
sun.awt.AppContext.getAppContext() triggered by a web
application do not result in a memory leak. Note that a call to this
method will be triggered as part of the web application stop process so
it is strongly recommended that this protection is enabled. The default
is true .
|
gcDaemonProtection |
Enables protection so that calls to
sun.misc.GC.requestLatency(long) triggered by a web
application do not result in a memory leak. Use of RMI is likely to
trigger a call to this method. A side effect of enabling this protection
is the creation of a thread named "GC Daemon". The protection uses
reflection to access internal Sun classes and may generate errors on
startup on non-Sun JVMs. The default is true .
|
keepAliveProtection |
Enables protection so that the KeepAlive thread started by
sun.net.www.http.HttpClient does not result in a memory
leak. The thread is started the first time the HttpClient
class is used. Without this protection, if a web application uses this
class the KeepAlive thread will be configured with the thread's context
class loader set to the web application class loader which in turn will
trigger a memory leak on reload. Defaults to true .
|
securityPolicyProtection |
Enables protection so that usage of the deprecated
javax.security.auth.Policy class by a web application does not
result in a memory leak. The first access of this class will trigger the
static initializer that will retain a static reference to the context
class loader. The protection calls the getPolicy() method
of this class to ensure that the static initializer is not triggered by
a web application. Defaults to true .
|
tokenPollerProtection |
Enables protection so that any token poller thread initialized by
sun.security.pkcs11.SunPKCS11.initToken() does not
result in a memory leak. The thread is started depending on various
conditions as part of the initialization of the Java Cryptography
Architecture. Without the protection this can happen during Webapp
deployment when the MessageDigest for generating session IDs is
initialized. As a result the thread has the Webapp class loader as its
thread context class loader. Enabling the protection initializes JCA
early during Tomcat startup. Defaults to true .
|
urlCacheProtection |
Enables protection so that reading resources from JAR files using
java.net.URLConnection s does not result in the JAR file
being locked. Note that enabling this protection disables caching by
default for all resources obtained via
java.net.URLConnection s. Caching may be re-enabled on a
case by case basis as required. Defaults to true .
|
xmlParsingProtection |
Enables protection so that parsing XML files within a web application
does not result in a memory leak. Note that memory profilers may not
display the GC root associated with this leak making it particularly
hard to diagnose. Defaults to true .
|