【问题标题】:Getting error while running mule application运行 mule 应用程序时出错
【发布时间】:2014-05-20 14:44:46
【问题描述】:

我是 Mule 的新手,正在尝试关注 http://www.mulesoft.org/documentation/display/current/JDBC+Transport+Reference#JDBCTransportReference-LargeDataset

这是我的 mule 配置文件

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

<mule xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:jdbc-ee="http://www.mulesoft.org/schema/mule/ee/jdbc" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:jdbc="http://www.mulesoft.org/schema/mule/jdbc" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" 
xmlns:spring="http://www.springframework.org/schema/beans" xmlns:vm="http://www.mulesoft.org/schema/mule/vm" xmlns:core="http://www.mulesoft.org/schema/mule/core" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="EE-3.4.1" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.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/jdbc http://www.mulesoft.org/schema/mule/ee/jdbc/current/mule-jdbc-ee.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/3.1/mule-http.xsd
http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/3.1/mule-scripting.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/3.4/mule-vm.xsd
http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd">

<jdbc-ee:oracle-data-source name="Oracle_Local_Data_Source" user="system" password="admin_123" url="jdbc:oracle:thin:@localhost:1521:orcl" transactionIsolation="UNSPECIFIED" doc:name="Oracle Data Source"></jdbc-ee:oracle-data-source>
    <jdbc-ee:connector name="Database_JDBC" dataSource-ref="Oracle_Local_Data_Source" validateConnections="true" queryTimeout="-1" pollingFrequency="1000000" doc:name="Database"></jdbc-ee:connector>

<spring:bean id="idStore" class="com.mulesoft.mule.transport.jdbc.util.IdStore"> 
     <spring:property name="fileName" value="/tmp/large-dataset.txt"/>
</spring:bean>
<spring:bean id="seqBatchManager" class="com.mulesoft.mule.transport.jdbc.components.BatchManager"> 
    <spring:property name="idStore" ref="idStore"/>
    <spring:property name="batchSize" value="2"/>
    <spring:property name="startingPointForNextBatch" value="0"/>
</spring:bean>
<spring:bean id="noArgsWrapper"             
             class="com.mulesoft.mule.transport.jdbc.components.NoArgsWrapper"> 
    <spring:property name="batchManager" ref="seqBatchManager"/>
</spring:bean>

<flow name="LargeDataSet">
        <jdbc-ee:inbound-endpoint queryKey="EmployeeList" queryTimeout="-1" pollingFrequency="1000" connector-ref="Database_JDBC" doc:name="Database"> 
            <jdbc-ee:query key="EmployeeList" value="select * from employee"></jdbc-ee:query>  
        </jdbc-ee:inbound-endpoint>
        <vm:inbound-endpoint exchange-pattern="one-way" path="vm://next.batch"/>
        <spring-object bean="noArgsWrapper" /> 
 </flow>

</mule>

但是,在运行 mule 应用程序时,我收到以下错误:

Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'vm:inbound-endpoint'. 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.
    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)
    ....

我试图在谷歌上搜索它,但没有得到任何可行的解决方案。 仅供参考 - 我的班级路径中有 mule-transport-vm-3.4.1.jar(在某处给出的解决此问题的建议之一)

【问题讨论】:

    标签: jdbc mule mule-studio


    【解决方案1】:

    您不能直接在流程中使用spring-object,而是可以使用Java组件并引用spring object,如下所示。

    <component doc:name="Java">
            <spring-object bean="noArgsWrapper"/>
        </component>
    

    【讨论】:

      【解决方案2】:

      同一流中不能有两个入站端点。你想达到什么目的?短期内,移除 vm:inbound-endpoint。

      您可能想在 spring-object 之后使其成为 outbound-endpoint?

      【讨论】:

      • 在删除 vm:inbound-endpoint 时,我收到错误原因:org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found started with element '弹簧对象'。
      【解决方案3】:

      您在这里有一个有效且详细的示例:

      http://ricston.com/blog/batch-select-mule/

      【讨论】:

        【解决方案4】:

        如果您有多个入站端点,请在复合范围内定义它们。

        【讨论】:

          猜你喜欢
          • 2016-03-14
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2018-10-03
          • 2012-04-02
          • 2016-10-07
          • 2014-01-10
          • 2014-10-09
          相关资源
          最近更新 更多