使用文件时使用mule请求程序时,未部署Mule应用程序

时间:2017-07-10 07:35:04

标签: mule mule-studio mule-component mule-el mule-cluster

因为我想使用骡子请求者阅读json文件,但在部署代码本身时它会失败。您可以查看并提供帮助吗

   
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:mulerequester="http://www.mulesoft.org/schema/mule/mulerequester" 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/mulerequester http://www.mulesoft.org/schema/mule/mulerequester/current/mule-mulerequester.xsd">
    <http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
    <mulerequester:config name="Mule_Requester" doc:name="Mule Requester"/>
    <flow name="mulerequestertestFlow">
        <http:listener config-ref="HTTP_Listener_Configuration" path="/test" doc:name="HTTP"/>
        <mulerequester:request config-ref="Mule_Requester" resource="file:///C:/temp" doc:name="Mule Requester"/>
        <byte-array-to-string-transformer doc:name="Byte Array to String"/>
        <logger message="#[payload]" level="INFO" doc:name="Logger"/>
    </flow>
</mule>

并获得以下错误

ERROR 2017-07-10 12:54:40,427 [main] org.mule.module.launcher.application.DefaultMuleApplication: null
org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'mulerequester:config'. One of '{"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.
    at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) ~[?:?]
    at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) ~[?:?]
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ~[?:?]
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ~[?:?]
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ~[?:?]
    at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source) ~[?:?]
    at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source) ~[?:?]
    at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source) ~[?:?]
    at org.apache.xerces.impl.xs.XMLSchemaValidator.emptyElement(Unknown Source) ~[?:?]
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) ~[?:?]
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) ~[?:?]
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) ~[?:?]
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) ~[?:?]
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) ~[?:?]
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) ~[?:?]

2 个答案:

答案 0 :(得分:0)

mulerequester:配置已经过时,不再需要了。

删除行:

<mulerequester:config name="Mule_Requester" doc:name="Mule Requester"/>

相反,创建一个新的文件连接器配置并将您的mule-requester引用到此配置:

<file:connector name="file-connector" autoDelete="false" streaming="true" validateConnections="true" doc:name="File"/>
<flow...>
   ...
<mulerequester:request resource="file://src/main/resources/somefile.txt?connector=file-connector" doc:name="Retrieve File" />
</flow>

这应该可以毫无问题地部署您的应用。

注意:文件连接器配置包含您需要修改的所有设置,以便阅读正确的文件夹等...

答案 1 :(得分:0)

许多人在使用各种连接器时都会遇到此错误,因此我想给出一个对所有人都有帮助的答案。当您收到此特定错误“从元素开始找到无效内容”时,表示Jar不可用。无论你使用什么连接器(netsuite,zuora,salesforce,mulerequester等)如果你得到这个错误只需右键单击连接器并给项目添加库,它将解决问题。