Nav
You are viewing an older version of this section. Click here to navigate to the latest version.

Deploying Mule as a Service to Tomcat

This page describes two activities that let you deploy your Mule applications on a Tomcat Web server:

  • Install Mule as a service on an Apache Tomcat server 

  • Set up your Mule applications for hot deployment

For more information on hot deploying Mule applications, see Application Server Based Hot Deployment.

Installing Mule on Tomcat

  1. Download and install Apache Tomcat, following Apache’s installation instructions.

  2. In the Tomcat home directory on your system, add the following line to the conf/server.xml file:

    <Listener className="org.mule.module.tomcat.MuleTomcatListener" />
  3. If you have not already done so, create a Tomcat home directory on your local system.

  4. Copy the contents of the Mule lib folder with all its subdirectories – except /boot to the mule-libs/ – to your Tomcat home directory. You do not need to flatten the directories.

  5. Copy the mule-module-tomcat-<version>.jar file to the mule-libs/mule/ directory in your Tomcat home directory.

  6. Copy the following libraries from your Mule lib/boot/ directory to your Tomcat `mule-libs/opt/`directory:

    • commons-cli-1.2.jar

    • jul-to-slf4j-1.6.1.jar

    • log4j-1.2.16.jar

    • mule-module-logging-3.3.1.jar

    • wrapper-3.5.7.jar

  7. In the Tomcat conf/catalina.properties file, add the following to common.loader (preceded by a comma to separate it from existing values):

${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar,${catalina.home}/mule-libs/user/*.jar,${catalina.home}/mule-libs/mule/*.jar,${catalina.home}/mule-libs/opt/*.jar,${catalina.home}/mule-libs/endorsed/*.jar

Ensure that you have only one listener in your web.xml file:


              
           
1
2
3
4
5
<listener>
<listener-class>
org.mule.module.tomcat.MuleTomcatListener
</listener-class>
</listener>

Deploying Mule Applications in Tomcat

  1. Package your Mule application’s configuration files and custom Java classes in a .war file (see Application Server Based Hot Deployment).

  2. Copy your application’s .war file, then paste it in the Tomcat /webapps directory.

  3. Tomcat hot deploys the application.

If you need to make a change to the configuration or Java file in the Mule application, modify the file in the expanded directory under the Tomcat /webapps directory, then touch the web.xml file (for example, simply add and delete a space in the file and then save it). These actions trigger Tomcat to redeploy the application.

Alternatively, you can modify the application’s source files, repackage them as a .war file, then drop the new .war file into the /webapps directory to trigger Tomcat to redeploy the application.

See Also