【问题标题】:cvc-complex-type.2.4.a: Invalid content was found starting with element 'dw:transform-message'cvc-complex-type.2.4.a:发现以元素“dw:transform-message”开头的无效内容
【发布时间】:2016-01-13 16:03:59
【问题描述】:

我正在尝试在 mule 独立 3.7.0 EE 上部署 mule 应用,但是 运行时出现此错误:cvc-complex-type.2.4.a: Invalid content was found starting with element 'dw:transform-message'

这是我的流程:

    <?xml version="1.0" encoding="UTF-8"?>

 <mule xmlns:magento="http://www.mulesoft.org/schema/mule/magento" xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/magento http://www.mulesoft.org/schema/mule/magento/current/mule-magento.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd">
<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
<magento:config name="Magento" username="test" password="test" address="http://127.0.0.1:8000/api/v2_soap/" doc:name="Magento"/>
<flow name="proFlow">
    <http:listener config-ref="HTTP_Listener_Configuration" path="test" doc:name="HTTP"/>
    <magento:get-order config-ref="Magento" orderId="100000000" doc:name="Magento"/>
    <dw:transform-message doc:name="Transform Message">
        <dw:set-payload><![CDATA[%dw 1.0
         %output application/json
         ---
        {
        orderId: payload.increment_id
        }]]></dw:set-payload>
       </dw:transform-message>
    <set-payload value="#[payload]" doc:name="Set Payload"/>
</flow>
</mule>

另外,我在pom.xml 中有这个依赖:

      <dependency>
        <groupId>com.mulesoft.weave</groupId>
        <artifactId>mule-plugin-weave_2.11</artifactId>
        <version>${mule.version}</version>
        <scope>provided</scope>
    </dependency>

【问题讨论】:

    标签: maven mule


    【解决方案1】:

    您似乎缺少此架构位置:

    http://www.mulesoft.org/schema/mule/ee/dw
    http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd
    

    尝试将其添加到 xsi:schemaLocation 列表中。

    希望这会有所帮助 问候

    【讨论】:

    • 我在独立时收到此错误:[http://www.mulesoft.org/schema/mule/ee/dw]: problem with handler class file or dependent class; nested exception is java.lang.NoClassDefFoundError: scala/Option (org.mule.api.lifecycle.InitialisationException) (org.mule.api.config.ConfigurationException)
    • 好的,这不是另一个例外和另一个问题。我想你在你的问题中遇到的问题已经解决了。我建议您发布另一个带有完整堆栈跟踪的问题,以便您继续遵守 stackoverflow 的规则,我们会继续为您提供帮助。当然不要忘记将我的答案标记为正确,如果是,我将不胜感激。
    猜你喜欢
    • 2023-03-07
    • 2018-03-04
    • 1970-01-01
    • 1970-01-01
    • 2020-10-31
    • 2011-07-07
    • 2019-01-26
    • 2018-12-23
    • 1970-01-01
    相关资源
    最近更新 更多