Mule application in deployable WAR

As a Mule application can be directly converted to a military file, for deployment on a Jboss application server, I tried and could not create a war file manually, as indicated here and went through this one , but still have not got a clear idea about this part. Provide help with an example. Note: the mule-config.xml file is missing in my mule mule application

+4
source share
2 answers
  • In pom.xml make sure you have <packaging>war</packaging>
  • Create src/main/webapp/WEB-INF/web.xml using the template below, replacing YOUR_CONFIGS comma-separated list of Mule configurations and YOUR_PATH using the path you want for the Mule servlet,
  • Replace all incoming HTTP endpoints with servlet endpoints, for example, <servlet:inbound-endpoint path="/YOUR_ENDPOINT_PATH" />

And you should be good to go!

web.xml:

 <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> <context-param> <param-name>org.mule.config</param-name> <param-value>YOUR_CONFIGS</param-value> </context-param> <listener> <listener-class>org.mule.config.builders.MuleXmlBuilderContextListener</listener-class> </listener> <servlet> <servlet-name>muleServlet</servlet-name> <servlet-class>org.mule.transport.servlet.MuleReceiverServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>muleServlet</servlet-name> <url-pattern>/YOUR_PATH/*</url-pattern> </servlet-mapping> </web-app> 

EDIT I opened the original demo version: https://github.com/ddossot/mule-webapp-example

+6
source

All Articles