【问题标题】:Mule custom connector Invalid content was found starting with elementMule 自定义连接器 发现以元素开头的内容无效
【发布时间】:2015-09-02 17:33:50
【问题描述】:

我创建了名为 KoreAlert 的自定义连接器。我成功地将它安装到 AnypointStudio。但是,当我在另一个流程中使用它时,我得到了这个异常。谁能解决这个问题。

Invalid content was found starting with element 'kore-alert:alert'. One of '{"http://www.mulesoft.org/schema/mule/core":abstract-message-processor, "http://www.mulesoft.org/schema/mule/core":abstract-outbound-endpoint, "http://www.mulesoft.org/schema/mule/core":abstract-mixed-content-message-processor, "http://www.mulesoft.org/schema/mule/core":response}' is expected.

编辑: 这是我的连接器处理器签名:

@Processor(friendlyName = "Kore Alert")
public void alert(@RestPostParam("alert") String alert) throws IOException {
        koreClient.postAlertInfo(alert);
}

这是使用连接器的骡子应用程序:

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

<mule xmlns:kore-alert="http://www.mulesoft.org/schema/mule/kore-alert" 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" version="EE-3.6.2"
    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/kore-alert http://www.mulesoft.org/schema/mule/kore-alert/current/mule-kore-alert.xsd">
    <http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8081" doc:name="HTTP Listener Configuration"/>
    <kore-alert:config-type name="KoreAlert_Configuration" doc:name="KoreAlert: Configuration type strategy"/>
    <flow name="kore-alert-userFlow">
        <http:listener config-ref="HTTP_Listener_Configuration" path="/hello" doc:name="HTTP"/>
        <kore-alert:alert config-ref="KoreAlert_Configuration" alert="'{&quot;title&quot;:&quot;ssss&quot;,&quot;body&quot;:&quot;safdsadfsa&quot;}'" doc:name="KoreAlert"/>
    </flow>
</mule>

【问题讨论】:

  • 您能分享连接器处理器签名和您的 mule 应用吗?

标签: mule connector


【解决方案1】:

我刚刚完成了我自己的版本。这是因为修改了我创建的连接器配置的代码(新架构)......

最后,我进行了彻底的清理:从添加连接器的项目中的 xml 文档中删除并重新创建(在 ui 中)所有现有的相关连接器配置。清理两个项目,构建连接器,更新并安装它,重新启动 AnyPoint Studio,构建“主机”项目并运行。

您可以按住 alt(mac 上的命令)键并单击要在架构设计器中查看的架构定义之一,以查看应用正在使用的版本。

【讨论】:

    【解决方案2】:

    Mule 无法识别命名空间 kore-alert。你在上面声明了吗?

    【讨论】:

    • @charu 你找到问题了吗?我刚刚创建了一个连接器,我遇到了同样的问题。生成的 xsd 似乎有问题。
    猜你喜欢
    • 2017-07-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-18
    • 2016-01-22
    相关资源
    最近更新 更多