我正在尝试通过mule standalone 3.7.0部署一个骡子应用程序,但我收到一个错误,即使它使用3.7.2 mule服务器通过任何点工作室版本5.4.1完美。注意:我已经通过anypoint studio创建了一个zip文件夹。
这是我的流程:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:amqp="http://www.mulesoft.org/schema/mule/amqp" xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:magento="http://www.mulesoft.org/schema/mule/magento" 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/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/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd
http://www.mulesoft.org/schema/mule/amqp http://www.mulesoft.org/schema/mule/amqp/current/mule-amqp.xsd">
<amqp:connector name="AMQPConnector"
validateConnections="true"
doc:name="AMQPConnector"
/>
<magento:config name="Magento" username="test" password="test" address="http://127.0.0.1:8000/api/v2_soap/" doc:name="Magento"/>
<flow name="flow">
<amqp:inbound-endpoint queueName="test" responseTimeout="10000" exchange-pattern="request-response" connector-ref="AMQPConnector" doc:name="AMQP-0-9" exchangeType="topic"/>
<logger message="test!!" level="INFO" doc:name="Logger"/>
<magento:get-product config-ref="Magento" productId="1" doc:name="Magento">
<magento:attributes-names>
<magento:attributes-name>sku</magento:attributes-name>
</magento:attributes-names>
</magento:get-product>
<mulexml:object-to-xml-transformer doc:name="Object to XML"/>
<logger message="#[payload]" level="INFO" doc:name="Logger"/>
<set-payload value="payload: #[payload]" doc:name="Set Payload"/>
</flow>
</mule>
这是他的错误:
ERROR 2016-01-10 18:40:46,877 [Mule.app.deployer.monitor.1.thread.1] org.mule.module.launcher.DefaultArchiveDeployer:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Failed to deploy artifact 'alone', see below +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
org.mule.module.launcher.DeploymentInitException: SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'amqp:connector'. One of '{"http://www.mulesoft.org/schema/mule/core":annotations, "http://www.mulesoft.org/schema/mule/core":description, "http://www.springframework.org/schema/beans":beans, "http://www.springframework.org/schema/beans":bean, "http://www.springframework.org/schema/context":property-placeholder, "http://www.springframework.org/schema/beans":ref, "http://www.mulesoft.org/schema/mule/core":global-property, "http://www.mulesoft.org/schema/mule/core":configuration, "http://www.mulesoft.org/schema/mule/core":notifications, "http://www.mulesoft.org/schema/mule/core":abstract-extension, "http://www.mulesoft.org/schema/mule/core":abstract-shared-extension, "http://www.mulesoft.org/schema/mule/core":abstract-mixed-content-extension, "http://www.mulesoft.org/schema/mule/core":abstract-agent, "http://www.mulesoft.org/schema/mule/core":abstract-security-manager, "http://www.mulesoft.org/schema/mule/core":abstract-transaction-manager, "http://www.mulesoft.org/schema/mule/core":abstract-shared-transaction-manager, "http://www.mulesoft.org/schema/mule/core":abstract-connector, "http://www.mulesoft.org/schema/mule/core":abstract-shared-connector, "http://www.mulesoft.org/schema/mule/core":abstract-global-endpoint, "http://www.mulesoft.org/schema/mule/core":abstract-exception-strategy, "http://www.mulesoft.org/schema/mule/core":abstract-flow-construct, "http://www.mulesoft.org/schema/mule/core":flow, "http://www.mulesoft.org/schema/mule/core":sub-flow, "http://www.mulesoft.org/schema/mule/core":abstract-model, "http://www.mulesoft.org/schema/mule/core":abstract-interceptor-stack, "http://www.mulesoft.org/schema/mule/core":abstract-filter, "http://www.mulesoft.org/schema/mule/core":abstract-transformer, "http://www.mulesoft.org/schema/mule/core":processor-chain, "http://www.mulesoft.org/schema/mule/core":custom-processor, "http://www.mulesoft.org/schema/mule/core":abstract-empty-processor, "http://www.mulesoft.org/schema/mule/core":invoke, "http://www.mulesoft.org/schema/mule/core":set-payload, "http://www.mulesoft.org/schema/mule/core":abstract-global-intercepting-message-processor, "http://www.mulesoft.org/schema/mule/core":custom-queue-store, "http://www.mulesoft.org/schema/mule/core":abstract-processing-strategy}' is expected.
任何想法如何解决?
答案 0 :(得分:3)
如果您有maven项目,您可能会错过POM中AMQP连接器的依赖关系。
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-amqp</artifactId>
<version>x.y.z</version>
</dependency>
希望这有帮助
答案 1 :(得分:1)
如上所述,您可能缺少activemq连接器jar文件,如果您使用maven,请将其放在您的pom上并让它下载规定的版本,例如:
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-all</artifactId>
<version>5.13.2</version>
</dependency>
http://activemq.apache.org/download.html
希望这有帮助。
答案 2 :(得分:1)
您好我认为您的AnyPoint工作室中没有amqp:连接器。 通过帮助 - &gt;安装新的软件 - &gt;选择Anypoint Connectors更新站点 - http://repository.mulesoft.org/connectors/releases/3.5.0。 希望这有助于上面其他人提到的。
答案 3 :(得分:1)
抛出此错误,因为在您的流程中使用了ampq:connector,而未在您的设置中安装。 要安装ampq:connector,请转到Help-&gt;安装新软件 - &gt; http://repository.mulesoft.org/connectors/releases/3.5.0 并从列表中安装以下包。 然后安装Mule AMPQ Tranpost包并重新启动Anypoint Studio。 这将解决您的问题。
答案 4 :(得分:1)
尝试将命名空间引用从当前更改为: &#34; http://www.mulesoft.org/schema/mule/amqp/3.1/mule-amqp.xsd&#34;
您还可以参考: https://docs.mulesoft.com/mule-user-guide/v/3.7/activemq-integration
答案 5 :(得分:0)
是因为您缺少默认的mule命名空间设置吗?
<div class="form-group">
<label class="col-md-4 control-label">Image:</label>
<div class="col-md-8">
<input class="form-control" type="file" name="file">
</div>
</div>
尝试添加此内容并查看是否有帮助。
答案 6 :(得分:0)
我认为你的AnyPoint工作室中没有amqp:connector
。尝试按照以下步骤在Studio中下载它。
帮助 - &gt;安装新的软件 - &gt;选择Anypoint Connectors更新站点 - http://repository.mulesoft.org/connectors/releases/3.5.0。
重启工作室......完成.. !!!如果有帮助,请告诉我。
答案 7 :(得分:0)
很可能Mule项目描述符文件中缺少连接器依赖项,称为 mule-project.xml 。这会阻止Studio将正确的连接器JAR附加到应用程序,从而导致您遇到的Invalid content was found starting with element 'amqp:connector
异常。
应用使用的所有连接器都在 mule-project.xml
标记内的<muleExtension>
中声明:
<muleExtension name="AMQP-0-9" qualifier="mule-transport-amqp-contribution"/>
依赖:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mule-project xmlns="http://www.mulesoft.com/tooling/project" runtimeId="org.mule.tooling.server.3.7.3.ee" schemaVersion="5.3.0.0">
<name>demo-amqp</name>
<description></description>
<muleExtension name="AMQP-0-9" qualifier="mule-transport-amqp-contribution"/>
</mule-project>
没有依赖:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mule-project xmlns="http://www.mulesoft.com/tooling/project" runtimeId="org.mule.tooling.server.3.7.3.ee" schemaVersion="5.3.0.0">
<name>demo-amqp</name>
<description></description>
</mule-project>
解决方案1(来自Studio)
拖动&amp;将连接器放到画布上。这将强制更新Mule应用程序,自动将依赖项添加到项目的类路径中。
解决方案2(来自Studio)
手动将连接器依赖项添加到类路径:
答案 8 :(得分:0)
我认为你的AnyPoint工作室中没有amqp:连接器。尝试按照以下步骤在Studio中下载它。帮助 - &gt;安装新的软件 - &gt;选择Anypoint Connectors更新站点 - http://repository.mulesoft.org/connectors/releases/3.5.0。
答案 9 :(得分:0)
您可能缺少activemq连接器jar文件
答案 10 :(得分:-1)
看起来像amqp:连接器在AnyPoint工作室中不存在。尝试按照以下步骤在Studio中下载它。帮助 - &gt;安装新的软件 - &gt;选择Anypoint Connectors更新站点 - http://repository.mulesoft.org/connectors/releases/3.5.0。
重启工作室......完成.. !!!如果有帮助,请告诉我。