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

Deploying Mule to WebSphere

Before you can deploy your Mule application to an http://www-01.ibm.com/software/webservers/appserv/was/[IBM WebSphere application server], you must prepare it as a web application. This involves creating a web.xml file for your Mule application, 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. Create a web.xml file for your Mule application as per the example below.


         
      
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?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-mapping>
        <servlet-name>muleServlet</servlet-name>
        <url-pattern>/app-path/*</url-pattern>
    </servlet-mapping>
  <!--Mule configuration ends-->
</web-app>

Deploying the Mule Application

  1. Create a .war file for your project. Ensure that the .war file contains the web.xml file as well as the configuration files, libraries and properties files for your Mule application.

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

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

  4. For the root, browse to the location of your Mule application’s .war file on your local drive.

  5. For the context root, type a unique root such as Mule.

  6. Click Next in each of the wizard’s panel, then click Finish

  7. Save your settings.

  8. Navigate to Enterprise Applications, select muleApp.war, and then click Start.

WebSphere starts your Mule application as an embedded web app. To confirm that it deployed correctly, check the MuleProfile/logs/server1/SystemOut.log file.