Deploying Mule as a Service to Tomcat
This page describes how to install Mule as a service in Apache Tomcat and set up your Mule applications for hot deployment. For more information on hot deploying Mule applications, see Application Server Based Hot Deployment.
To install Mule in Tomcat so that you can hot deploy your Mule applications, you take the following steps:
Download and install Apache Tomcat 6 from the Apache web site following the standard installation instructions.
In the Tomcat home directory, add the following line to the
<Listener className="org.mule.module.tomcat.MuleTomcatListener" />
Copy the contents of the Mule
libfolder with all its subdirectories except
mule-libs/directory under your Tomcat home directory (create one if necessary). You do not need to flatten the directories.
mule-module-tomcat-<version>.jarfile to the
mule-libs/mule/directory under your Tomcat home directory (if it is not there already).
Copy the following libraries from your Mule
lib/boot/directory to your Tomcat
In the Tomcat
conf/catalina.propertiesfile, add the following to
common.loader(precede with a comma to separate it from existing values):
After you package your configuration files and custom Java classes in a WAR file (see Application Server Based Hot Deployment), copy your Mule applications WAR files to the Tomcat
After you have copied the WAR file for your Mule application to the Tomcat
/webapps directory, Tomcat deploys it. If you need to make a change to a configuration or Java file in the webapp, simply modify the file in the exploded directory under the Tomcat
/webapps directory, and then touch the
web.xml file (or you can simply add and delete a space in the file and then save it) to trigger Tomcat to redeploy the application. Alternatively, you could modify the source files, repackage them as a WAR, and drop the new WAR into the
/webapps directory to trigger Tomcat to redeploy the application.