Contact Us 1-800-596-4880

Deploying Mule to WebSphere

Mule Runtime Engine versions 3.5, 3.6, and 3.7 reached End of Life on or before January 25, 2020. For more information, contact your Customer Success Manager to determine how you can migrate to the latest Mule version.

Before you can deploy your Mule application to an 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.

<?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.