【问题标题】:Facing issue while deploying webapp on tomcat: Mule esb在 tomcat 上部署 webapp 时面临的问题:Mule esb
【发布时间】:2015-03-07 01:18:10
【问题描述】:

我尝试将我的 webapp 部署为 tomcat 服务。我关注这个链接https://github.com/ddossot/mule-in-action/tree/mule-3/chapter07/web-application 以下是我的 web.xml 文件

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" 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">

    <display-name>salesforce</display-name>
    <description>salesforce to ftp</description>



    <context-param>
        <param-name>org.mule.config</param-name>
        <param-value>javatest.xml</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.MuleRESTReceiverServlet</servlet-class>

        <!-- Responses from the servlet are of type HTML by default -->
        <init-param>
            <param-name>org.mule.servlet.default.content.type</param-name>
            <param-value>text/html</param-value>
        </init-param>
    </servlet>

    <servlet-mapping>
        <servlet-name>muleServlet</servlet-name>
        <url-pattern>/services/*</url-pattern>
    </servlet-mapping>


    <welcome-file-list>
        <welcome-file>testindex.jsp</welcome-file>
    </welcome-file-list>
</web-app>

以下是我的 javatest.xml 文件

<data-mapper:config name="CSV_To_List_Transaction_c" transformationGraphPath="csv_to_list_transaction_c.grf" doc:name="CSV_To_List_Transaction"/>
    <sfdc:config name="Salesforce" username="username" password="pwd" doc:name="Salesforce" securityToken="token"/>
     <flow name="javatestFlow1" doc:name="javatestFlow1">
        <file:inbound-endpoint path="Custom" moveToDirectory="Backup" responseTimeout="10000" doc:name="File"/>
        <data-mapper:transform config-ref="CSV_To_List_Transaction_c" doc:name="CSV To List&lt;Transaction_c&gt;"/>

        <sfdc:create-bulk config-ref="Salesforce" type="Transaction__c" doc:name="Salesforce">
            <sfdc:objects ref="#[payload]"/>
        </sfdc:create-bulk>
        <idempotent-message-filter idExpression="#[payload.state]" doc:name="Idempotent Message"/>
        <custom-transformer class="com.org.Status" doc:name="Java"/>
        <catch-exception-strategy doc:name="Catch Exception Strategy">
            <logger level="INFO" doc:name="Logger" message="test..."/>
        </catch-exception-strategy>
    </flow>

<flow name="testforceFlow1" doc:name="testforceFlow1">
    <servlet:inbound-endpoint path="/download" responseTimeout="10000" doc:name="Servlet"/> 
         <flow-ref name="javatestFlow1" doc:name="Flow Reference"/>
</flow>

当时我部署此应用时出现以下错误

WARN  2015-03-05 19:25:56,228 [main] org.eclipse.jetty: Error creating bean with name 'javatestFlow1': Cannot create inner bean '(inner bean)#e93ee6' of type [com.mulesoft.mule.module.datamapper.processors.DataMapperMessageProcessor] while setting bean property 'messageProcessors' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#e93ee6': Invocation of init method failed; nested exception is java.lang.RuntimeException: com.mulesoft.datamapper.exception.DataMapperRuntimeException: The data mapping graph csv_to_list_transaction_c.grf does not exists (org.mule.api.lifecycle.InitialisationException)
org.mule.api.config.ConfigurationException: Error creating bean with name 'javatestFlow1': Cannot create inner bean '(inner bean)#e93ee6' of type [com.mulesoft.mule.module.datamapper.processors.DataMapperMessageProcessor] while setting bean property 'messageProcessors' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#e93ee6': Invocation of init method failed; nested exception is java.lang.RuntimeException: com.mulesoft.datamapper.exception.DataMapperRuntimeException: The data mapping graph csv_to_list_transaction_c.grf does not exists (org.mule.api.lifecycle.InitialisationException)

我想将此应用程序作为服务部署在 Tomcat 服务器上, 我该如何解决这个错误?请帮忙

谢谢

【问题讨论】:

标签: mule mule-studio mule-component


【解决方案1】:

异常的重要部分是:

com.mulesoft.datamapper.exception.DataMapperRuntimeException
The data mapping graph csv_to_list_transaction_c.grf does not exists

要解决此问题,请确保在 WAR 文件中正确打包 csv_to_list_transaction_c.grf。它应该在类路径的根目录下,即WEB-INF/classes 的正下方。

【讨论】:

  • 嗨大卫..非常感谢..它现在工作..我想问一个问题。如果我使用 http 入站端点并在 tomcat 中部署 war 文件,那么我的应用程序是否运行成功???或者我必须使用 Servlet 入站端点???
  • 我在 pom.xml 中进行了更改 war 并编译但没有创建war文件是否还有创建war文件的步骤?
  • 嗨大卫现在我面临另一个问题..请帮助...stackoverflow.com/questions/28912246/…
  • 如果部署在 servlet 容器中,则使用 servlet 入站端点,而不是 HTTP 入站端点,否则 Mule 在 servlet 容器内启动第二个 HTTP 服务器,这是没有意义的。
猜你喜欢
  • 1970-01-01
  • 2014-07-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-08-01
  • 1970-01-01
相关资源
最近更新 更多