2

can somebody please help me how to make a war of a simple mule application. My mule application consists of a single mule-config.xml file. I have made this mule project in ecplise and can run it as a mule server. My requirement is to make a war and deploy it in a tomcat or tcat server.

Thanks and Regards, Arijit

Arijit Bose
  • 217
  • 4
  • 15

1 Answers1

4

As explained in the user guide:

To embed Mule inside a webapp, you provide one or more configuration file locations as context params and include a context listener to initialize the Mule Server.

So just add this in your web.xml, with mule-config.xml at the root of your classpath (for ex. in src/main/resources):

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

EDIT I've open-sourced a running demo: https://github.com/ddossot/mule-webapp-example

David Dossot
  • 33,403
  • 4
  • 38
  • 72