Knowledge Base
The VMware Knowledge Base provides support solutions, error messages and troubleshooting guides

|
Installing EM4J with Apache Tomcat (2011244)
Purpose
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).
Resolution
Downloading the Helper Scripts
Downloadem4j-for-tomcat.zip (attached to this article) and extract the contents to your computer. The archive contains four files:copy-em4j-to-tomcat.shlogging-fragment.propertiessetenv.shreadme.txt
readme.txt file included in the archive.Installing Apache Tomcat
If 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 EM4J
The downloaded archive contains the scriptcopy-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.sh script 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 thecopy-em4j-to-tomcat.shscript. - 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 thatTCS_HOMEandCATALINA_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 newbin/setenv.shscript and modifies theconf/logging.propertiesfile. Review both of these files to examine the settings that were added.
Note: When the script runs, it backs up and overwrites thebin/setenv.shscript. You are responsible for manually migrating any settings from the original (nowbin/setenv.sh.original) script to the current (bin/setenv.sh) script.
Before starting Apache Tomcat
Before 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 machine
After 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 thesched.mem.pshare.guestHintsSyncEnableproperty, and set it totrue.
Note: You cannot add thesched.mem.pshare.guestHintsSyncEnableproperty while the virtual machine is running.
Running Apache Tomcat
At 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 yourlogs/catalina.out file:EM4J agent starting...
EM4J is now running on a supported version of ESX
EM4J 1.2.0 agent initializedIf you experience problems during start-up, review the
logs directory for hints at the issue.Additional Information
For additional EM4J information that is not specific to Apache Tomcat, see the EM4J documentation in the vFabric Documentation Center.
See Also
Attachments
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.
Actions
KB:
- Updated:
- Categories:
- Languages:
- Product Family:
- Product(s):
- Product Version(s):

