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

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

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

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

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

我发现 有关于缺少名称空间的响应。据我所知,我有 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 的新手,如果我在命名空间中遗漏了一些东西,或者如果有人看到了这个,我将不胜感激。 这也是metadata:id

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

只需删除 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"/>

保存并重新启动应用程序,一旦 again.It 应该可以工作。

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

"metadata-id" 当您使用消息在 "Transform message" 组件中定义有效负载元数据时生成 flow.It 对特定的特定内容有效 config.When 您将此元素复制到其他配置它变成 obsolete/un-bound 到那个上下文。

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

添加

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

在 mule 标签中

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