简体   繁体   中英

mulesoft dataweave arrayindexoutofbounds error

I have a simple flow that reads a csv file using a File Connector and I am trying to transform that data to json. Does not matter what I put as expression, I am always getting ArrayIndexOutOfBoundsException at design time and the preview does not generate. Below is the flow:

    <flow name="dw_exampleFlow">
        <file:inbound-endpoint path="C:\BNA\dw_sample" responseTimeout="10000" mimeType="application/csv" doc:name="File"/>
        <dw:transform-message doc:name="Transform Message" metadata:id="3496b3e4-708e-49c3-9f87-764eb149d1ee">
            <dw:set-payload><![CDATA[%dw 1.0
%output application/dw
---
payload]]></dw:set-payload>
        </dw:transform-message>
    </flow>
</mule>

Below is the error I am getting: Design Time Error

What mule runtime are you using? it's working on me using 3.7.3

在此处输入图片说明 在此处输入图片说明

<flow name="Flow">
        <file:inbound-endpoint
            path="/work/demo/workspace/3.7.3-dataweave/src/main/resources/input"
            moveToDirectory="/work/demo/workspace/3.7.3-dataweave/src/main/resources/output"
            responseTimeout="10000" doc:name="File" />
        <dw:transform-message metadata:id="ff8bbc88-efc7-4952-816a-a13f00ef6e6d"
            doc:name="Transform Message">
            <dw:set-payload><![CDATA[%dw 1.0
%output application/json
---
payload]]></dw:set-payload>
        </dw:transform-message>
        <byte-array-to-string-transformer
            doc:name="Byte Array to String" />
        <logger message="#[payload]" level="INFO" doc:name="Logger" />
    </flow>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM