The VMware Knowledge Base provides support solutions, error messages and troubleshooting guides
Installing EM4J with Apache Tomcat (2011244)
Note: Before proceeding with the steps in this article, be sure to review the requirements for running EM4J with Apache Tomcat. For more information, see Using EM4J with Apache Tomcat (2011243).
Downloading the Helper ScriptsDownload
em4j-for-tomcat.zip(attached to this article) and extract the contents to your computer. The archive contains four files:
readme.txtfile included in the archive.
Installing Apache TomcatIf you have not already done so, install Apache Tomcat 6.0.x or 7.0.x. VMware recommends using a version at or greater than 6.0.35 or 7.0.23.
Note the path to your Tomcat installation as this is required later.
Installing EM4JThe downloaded archive contains the script
copy-em4j-to-tomcat.sh. This is an automated script that copies the EM4J components from an existing tc Server 2.8 installation and installs them into your Apache Tomcat instance.
Note: When run, the
copy-em4j-to-tomcat.shscript modifies your existing Tomcat installation; create a backup of your Tomcat instance prior to running the script.
These steps guide you through configuring and running this script:
- Open a terminal and
cdto the directory where you extracted the
- If necessary, set the execute permission on the copy script:
chmod a+x copy-em4j-to-tomcat.sh
- Edit the
copy-em4j-to-tomcat.shscript. Instructions for editing the script are included as comments in the script.
You must edit these two variables:
TCS_HOME: Set to the full path that identifies your existing tc Server 2.8.x installation.
CATALINA_HOME: Set to the full path that identifies your Apache Tomcat installation.
- Run the
copy-em4j-to-tomcat.shscript. The script attempts to verify that
CATALINA_HOMEpoint to valid tc Server and Apache Tomcat installations. If any errors are generated during the script run, ensure that you have correctly configured the script in step three.
- When the
copy-em4j-to-tomcat.shscript has run, in addition to installing EM4J, it also installs a new
bin/setenv.shscript and modifies the
conf/logging.propertiesfile. Review both of these files to examine the settings that were added.
Note: When the script runs, it backs up and overwrites the
bin/setenv.shscript. You are responsible for manually migrating any settings from the original (now
bin/setenv.sh.original) script to the current (
Before starting Apache TomcatBefore you start Apache Tomcat:
- Open the
bin/setenv.shfile in your Apache Tomcat installation.
- Ensure there is enough maximum heap specified with the
-Xmxargument to accommodate application data and balloon objects.
- Ensure that the remote JMX options, particularly the JMX port, are set appropriately for your Tomcat server. The EM4J CGC, if configured, uses this remote JMX port to report Java memory balloon metrics.
Enabling EM4J in the virtual machineAfter EM4J is installed, you must enable its use at the virtual machine level.
To enable EM4J at the virtual machine level:
- Shut down the virtual machine.
- Modify the virtual machine's configuration (the
.vmxproperties) and add the
sched.mem.pshare.guestHintsSyncEnableproperty, and set it to
Note: You cannot add the
sched.mem.pshare.guestHintsSyncEnableproperty while the virtual machine is running.
Running Apache TomcatAt this point, EM4J is installed. You can now start the Apache Tomcat server. If everything is working correctly, your applications are accessible and you see these three lines in your
EM4J agent starting...
EM4J is now running on a supported version of ESX
EM4J 1.2.0 agent initialized
If you experience problems during start-up, review the
logsdirectory for hints at the issue.
For additional EM4J information that is not specific to Apache Tomcat, see the EM4J documentation in the vFabric Documentation Center.
Request a Product Feature
To request a new product feature or to provide feedback on a VMware product, please visit the Request a Product Feature page.