This page last changed on Oct 02, 2006 by lajos@mulesource.com.

The Mule Webapp provides a user interface to some of the Mule examples such as the LoanBroker, Hello World and Echo examples. It also provides examples of accessing Mule using REST style service calls and is itself an example of how to embed Mule in a webapp.

Prerequisites

You should have the MULE_HOME environment variable set to the root of your Mule distribution.

Preparation  

  1. Open a shell*.
  2. From the root of the Mule distribution go to examples/ant/webapp or examples/maven/webapp
  3. If you are running this example for the first time and want to use Ant (version 1.6.5 or later) to build the web application:
    1. Make sure you are in the examples/ant/webapp directory
    2. Run the Ant script - 'ant'
    3. You should see output indicating that the .war file has been built
    4. Copy the .war file, found in the build subdirectory, to the deployment directory for your servlet engine
  4. If you are running this example for the first time and want to use Maven to to build the web application:
    1. Make sure you are in the examples/maven/webapp directory
    2. Run Maven - 'mvn'
    3. You should see output indicating that the .war file has been built
    4. Copy the .war file, found in the build subdirectory, to the deployment directory for your servlet engine

Notes for Apache Tomcat 5.0

This Mule sample has been tested on Apache Tomcat 5.0.28 and later

Apache Tomcat comes with a JMX implementation that will conflict with that contained in the Mule web application. In the Tomcat bin directory, you will find a jar file called jmx.jar. Move this to a safe location. Copy the WEB-INF/lib/mx4j-3.0.1.jar file from the Mule webapp to the Tomcat bin directory, and rename it to jmx.jar. Now restart Tomcat is the Mule webapp context should start.

Webapp Contents

The webapp contains the following -

mule.war
 |- html and jsps
 |- WEB-INF
    |- mule-config.xml - The Mule server shared configuration
    |- mule-echo-config.xml - Configuration for the echo example component
    |- mule-hello-config.xml - Configuration for the hello example
    |- mule-loanbroker-config.xml - Configuration for the loanbroker example
    |- mule-rest-config.xml - Configuration for the REST example
    |- web.xml - Webapp configuration
    |- lib
    |   |- jars required by the Mule server
    |- classes
        |- compiled classes for the example applications
Document generated by Confluence on Oct 03, 2006 09:23