<?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 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:
-
Create a WAR file with your application.
-
Required. Modify your Modify your WebLogic Configuration by adding elements to the weblogic.xml file.
-
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.
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.
-
Copy
<WLHOME>/wlserver_10.3/server/lib/wllog4j.jar
to<WLHome>/user_projects/domains/<yourdomain>/lib
. -
Download the Log4j logging file.
-
Unzip the file and copy
log4j.jar
to<WLHome>/user_projects/domains/<yourdomain>/lib
. -
Download the Commons logging file.
-
Unzip the file and copy
commons-loggin.jar
to<WLHome>/user_projects/domains/<yourdomain>/lib
. -
Launch your WebLogic domain and log into the console.
-
In the left navigation pane, expand Environment and select Servers.
-
In the Servers table, click the name of the server instance whose logging you want to configure.
-
Select Logging > General, and click Advanced at the bottom of the page.
-
In the Logging Implementation list box, select Log4j.
-
Click Save.
-
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:
-
Start the WebLogic server. For example, on Windows choose Start > BEA Products > WebLogic Server.
-
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.
-
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
. -
In the Domain Structure on the left, click Deployments.
-
Click Install, and then navigate to the location where you downloaded the web application EAR file.
-
Select the EAR file and click Next.
-
Select Install this deployment as an application
-
Select Next.
-
Select Finish.
-
In the Change Center on the left, click Activate Change.