将Mule应用程序转换为可部署的WAR

时间:2013-02-12 11:03:03

标签: mule

如何将Mule应用程序直接转换为war文件,以便在Jboss应用程序服务器中部署,我尝试并失败了,如上所述here手动创建war文件并经历了this,但是仍然没有对这一部分有一个明确的看法。以示例提供帮助。注意:我的示例mule应用程序

中没有Mule-config.xml文件

2 个答案:

答案 0 :(得分:6)

  • pom.xml中,确保您拥有<packaging>war</packaging>
  • 使用下面的模板创建src/main/webapp/WEB-INF/web.xml,将逗号分隔的Mule配置列表替换为YOUR_CONFIGS,将YOUR_PATH替换为Mule servlet所需的路径,
  • 将所有入站HTTP端点替换为Servlet端点,例如<servlet:inbound-endpoint path="/YOUR_ENDPOINT_PATH" />

你应该好好去!

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

编辑我开源了一个正在运行的演示:https://github.com/ddossot/mule-webapp-example

答案 1 :(得分:0)

相关问题