Contact Us 1-800-596-4880

Deploying Mule to WebSphere

This page describes how to deploy Mule ESB to WebSphere Application Server 6.1.

Preparing Your Mule Application as a Web Application

Before you can deploy your Mule application to WebSphere, you must prepare it as a web application. This involves creating a web.xml file for your Mule application and then creating a WAR file of all the supporting files.

Creating the web.xml File

The web.xml file configures the Mule application as a web application by specifying your Mule configuration file and other options for starting Mule in the WebSphere container. It should look like this:

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version"2.4">
  <!--Mule configuration (Mule format)-->
  <context-param>
    <param-name>org.mule.config</param-name>
    <param-value>mule-config.xml</param-value>
  </context-param>
  <listener>
    <listener-class>org.mule.config.builders.MuleXmlBuilderContextListener</listener-class>
  </listener>
  <servlet>
    <servlet-name>muleServlet</servlet-name>
    <servlet-class>org.mule.transport.servlet.MuleReceiverServlet</servlet-class>
    <load-on-startup>100</load-on-startup>
  </servlet>
  <!--Mule configuration ends-->
</web-app>

Creating the WAR File

The WAR file must contain the web.xml file as well as the configuration files, libraries, and properties files for your Mule application. To create the WAR file, you can use the JAR command as follows in the root directory of your Mule application:

jar -cvf muleApp.war

The directory structure where you run the command should look similar to this:

META-INF
  maven
WEB-INF
  classes
    mule-config.xml
    log4J.properties
  lib
    mule jars
  web.xml

Creating and Running a Mule Profile in WebSphere

Before you can deploy the Mule application, you must create a profile for Mule in WebSphere. Following are instructions for using the Profile Management Tool in Windows, but the steps for UNIX servers are similar.

  1. From the Windows start menu, launch the Profile Management Tool from the WebSphere program group (e.g., Start > IBM WebSphere > Application Server v6.1 > Profile Management Tool).

  2. When the profile management wizard starts, click Next.

  3. Select Application server and click Next.

  4. Select Advanced profile creation and click Next.

  5. Select Deploy the application console, clear all other check boxes, and click Next.

  6. Specify a profile name like "MuleProfile" and specify the directory where you want to save the profile. We recommend you specify a directory with the same name as the profile. Leave the other options unchecked and click Next.

  7. If you want to enable security for this profile, enter the user name and password. Otherwise, clear the check box. Click Next.

  8. Leave all the default port values (or change any required in your environment) and click Next.

  9. Clear the check box to run the profile as a Windows service (on UNIX, clear the option to run as a daemon) and click Next.

  10. Leave the web server definition option unchecked and click Next.

  11. Click Create. The profile is created and available from the WebSphere Start menu.

  12. Run the profile. For example, choose Start > IBM WebSphere > Application Server v6.1 > Profiles > MuleProfile > Start the server.

Deploying the Mule Application

You are now ready to deploy your Mule application.

  1. With the Mule profile running, open the WebSphere administrative console.

  2. On the navigation bar on the left, click Applications and then click Install New Application.

  3. For the path, browse to the location of the Mule WAR file you created above.

  4. For the context root, type a unique root like "Mule".

  5. Click Next on each of the screens and then Finish. Save your settings.

  6. Go to Enterprise Applications, select muleApp.war, and then click Start.

Your Mule application is started as an embedded web application in WebSphere. To verify that it deployed correctly, check the MuleProfile/logs/server1/SystemOut.log file.