【问题标题】:mule dataweave anypoint studio The prefix "metadata" for attribute "metadata:id" associated with an element type "dw:transform-message" is not boundmule dataweave anypoint studio 与元素类型“dw:transform-message”关联的属性“metadata:id”的前缀“metadata”未绑定
【发布时间】:2018-04-09 13:47:45
【问题描述】:

我在运行 mule 应用程序时遇到此异常。

The prefix "metadata" for attribute "metadata:id" associated with an element type "dw:transform-message" is not bound.

它正在调用数据编织转换。我之前也遇到过类似的错误,只是在通过配置 XML 而不是消息流进行编辑之后。

我发现this post 有关于缺少命名空间的回复。据我所知,我有 dataweave 命名空间

xmlns:file="http://www.mulesoft.org/schema/mule/file" 
xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw" 
xmlns:http="http://www.mulesoft.org/schema/mule/http" 
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/http 
http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/file 
http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/ee/dw 
http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd
http://www.mulesoft.org/schema/mule/core 
http://www.mulesoft.org/schema/mule/core/current/mule.xsd">

我对 mule 很陌生,如果我在命名空间中遗漏了某些东西,或者如果有人看到了这一点,我将不胜感激。 这里也是元数据:id

        <dw:transform-message doc:name="json to flattened json" metadata:id="e1e281d5-880f-48f9-92af-b5ead2b0e5dd">
        <dw:input-payload mimeType="application/json"/>

【问题讨论】:

  • 以下答案是否对您有所帮助。如果是,请接受答案,以便其他面临相同问题的人可以从中受益。

标签: xml mule anypoint-studio dataweave


【解决方案1】:

只需删除 metadata-id

metadata:id="e1e281d5-880f-48f9-92af-b5ead2b0e5dd

来自您的配置 xml

<dw:transform-message doc:name="json to flattened json" metadata:id="e1e281d5-880f-48f9-92af-b5ead2b0e5dd">
<dw:input-payload mimeType="application/json"/>

保存并重新启动应用程序。它应该可以工作。

当您编辑配置 xml 时,这似乎是从其他配置 xml 文件中复制过来的。

“metadata-id”是在您使用消息流在“转换消息”组件中定义有效负载元数据时生成的。它对于该特定配置仍然有效。当您将此元素复制到其他配置时,它变得过时/未绑定在这种情况下。

如果这能解决您的问题,请告诉我们。

【讨论】:

  • 成功了!我最终在两个转换中遇到了这个问题,但是一旦我从两个转换中删除了 id,应用程序就成功部署了。
【解决方案2】:

添加

xmlns:metadata="http://www.mulesoft.org/schema/mule/metadata"

在骡子标签中

<mule xmlns:metadata="http://www.mulesoft.org/schema/mule/metadata"/>

【讨论】:

    猜你喜欢
    • 2020-04-05
    • 2016-10-12
    • 1970-01-01
    • 1970-01-01
    • 2015-03-05
    • 2018-09-12
    • 1970-01-01
    • 1970-01-01
    • 2011-05-15
    相关资源
    最近更新 更多