Contact Us 1-800-596-4880

Deploying Mule to WebLogic

These instructions assume you have downloaded and installed WebLogic Application Server version 10.3. Note that WebLogic 8.x and 9.x are also supported, but these instructions are specific to version 10.3 of Oracle WebLogic.

Note: For an example of Mule running in a webapp under WebLogic, take the webapp example from the standalone distribution and make the changes described above.

Deploying a web application with Mule in WebLogic

You must carry out the following steps, explained in detail below:

  1. Create a WAR file with your application.

  2. Required. Modify your Modify your WebLogic Configuration by adding elements to the weblogic.xml file.

  3. Configure logging as described in Configuring Logging.

Create a WAR File

Before you deploy your Mule application to WebLogic, you must prepare it as a web application. This involves creating a web.xml file for your Mule application, a weblogic.xml file for configuring the server, and creating a .war file of all the supporting files.

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>

Modify your WebLogic Configuration

Include these lines in the weblogic.xml file to prioritize Mule libraries:

<container-descriptor>
   <prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>

Instead, for a more fine-grained package overriding, you can refer to individual packages as shown below:

<container-descriptor>
   <prefer-application-packages>
      <package-name>org/apache/commons/lang</package-name>
   </prefer-application-packages>
</container-descriptor>

Read more about WebLogic Classloading in Oracle’s Understanding WebLogic Server Application Classloading.

Configuring Logging

Mule uses Log4j2. WebLogic can be configured so that WebLogic’s and Mule’s logging both use log4j.

  1. Copy <WLHOME>/wlserver_10.3/server/lib/wllog4j.jar to <WLHome>/user_projects/domains/<yourdomain>/lib.

  2. Download the Log4j logging file.

  3. Unzip the file and copy log4j.jar to <WLHome>/user_projects/domains/<yourdomain>/lib.

  4. Download the Commons logging file.

  5. Unzip the file and copy commons-loggin.jar to <WLHome>/user_projects/domains/<yourdomain>/lib.

  6. Launch your WebLogic domain and log into the console.

  7. In the left navigation pane, expand Environment and select Servers.

  8. In the Servers table, click the name of the server instance whose logging you want to configure.

  9. Select Logging > General, and click Advanced at the bottom of the page.

  10. In the Logging Implementation list box, select Log4j.

  11. Click Save.

  12. Restart your WebLogic domain to activate the changes.

Deploying Mule

These instructions demonstrate the deployment through the Administration console. Note that this section also applies when deploying an EAR or WAR that embeds Mule to WebLogic, in which case you deploy the EAR or a WAR.

Deploying Mule Using the Administration Console

To deploy Mule from the Administration console:

  1. Start the WebLogic server. For example, on Windows choose Start > BEA Products > WebLogic Server.

  2. Start the Admin Server for your domain. For example, on Windows you would choose Start > BEA Products > * User Projects* > <yourdomain> > Start Admin Server for WebLogic Server Domain.

  3. When prompted, log in to the console using the user name and password you specified when creating the domain. If you close the console and need to restart it later, you can go to the URL http://localhost:7001/console/console.portal.

  4. In the Domain Structure on the left, click Deployments.

  5. Click Install, and then navigate to the location where you downloaded the web application EAR file.

  6. Select the EAR file and click Next.

  7. Select Install this deployment as an application

  8. Select Next.

  9. Select Finish.

  10. In the Change Center on the left, click Activate Change.