0
votes

I am new to Mule and trying to follow http://www.mulesoft.org/documentation/display/current/JDBC+Transport+Reference#JDBCTransportReference-LargeDataset

This is my mule configuration file

<?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>

But, on running the mule application, I am getting the below error:

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)
    ....

I tried to search it on google but didn't get any working solution. FYI - I have mule-transport-vm-3.4.1.jar in my class path(one of the suggestion given somewhere to resolve this issue)

4

4 Answers

1
votes

you cann't use spring-object directly in the flow, instead you can use Java component and refer to spring object as below.

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

You can't have two inbound-endpoints in the same flow. What is it you're trying to achieve? In the short term, remove the vm:inbound-endpoint.

Possibly you want to make it an outbound-endpoint after the spring-object?

0
votes

You have a working and detailed example here:

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

0
votes

If you have multiple inbound endpoints define them in composite scope.