Mule application into a deployable WAR

不想你离开。 提交于 2019-12-17 19:53:07

问题


How the Mule application can be directly convert into a war file, to deploy in Jboss application server, i tried and failed with creating the war file manually as mentioned here and gone through this too, but still didn't get a clear view on this part.Provide a assistance with example. Note: there is no Mule-config.xml file in my sample mule application program


回答1:


  • In the pom.xml, ensure you have <packaging>war</packaging>
  • Create src/main/webapp/WEB-INF/web.xml using the template below, replacing YOUR_CONFIGS with a comma-separated list of Mule configurations and YOUR_PATH with the path you want for the Mule servlet,
  • Replace all your inbound HTTP endpoints with Servlet endpoints, like <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've open-sourced a running demo: https://github.com/ddossot/mule-webapp-example




回答2:


Here you have the required steps: http://www.mulesoft.org/documentation/display/current/Deploying+Mule+to+JBoss



来源:https://stackoverflow.com/questions/14831012/mule-application-into-a-deployable-war

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!