Please refer this dataweave window image :- dataweave window image
I am trying to transform a CSV TO JSON using dataweave but even for the simplest of transformations it is creating a null tag automatically. I can see that in the preview window. When I run this application I am getting this error *
Exception stack is: 1. 452 (java.lang.ArrayIndexOutOfBoundsException) com.mulesoft.weave.reader.CharArraySourceReader:21 (null) 2. 452 (java.lang.ArrayIndexOutOfBoundsException). Message payload is of type: WeaveMessageProcessor$WeaveOutputHandler (org.mule.api.MessagingException)
org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor:32******************************************************************************** Root Exception stack trace: java.lang.ArrayIndexOutOfBoundsException: 452 at com.mulesoft.weave.reader.CharArraySourceReader.lookAheadAscii(CharArraySourceReader.scala:21) at com.mulesoft.weave.reader.csv.parser.CSVParser.parse(CSVParser.scala:132) at com.mulesoft.weave.reader.csv.parser.CSVParser.elementAt(CSVParser.scala:61) at com.mulesoft.weave.reader.csv.parser.CSVParser.contains(CSVParser.scala:38) at com.mulesoft.weave.reader.csv.CSVRecordsValue$$anon$1.hasNext(CSVReader.scala:58) at scala.collection.Iterator$class.toStream(Iterator.scala:1188) at com.mulesoft.weave.reader.csv.CSVRecordsValue$$anon$1.toStream(CSVReader.scala:56)
This is the sample csv I am using
SpreadsheetKeyEmployee,Position,EffectiveDate,BonusPlan,Amount,Currency,IgnorePlanAssignment
1,18211,2016-05-01,BONUS_PLAN1,150,USD
2,18212,2016-05-01,BONUS_PLAN2,150,USD
3,18213,2016-05-01,BONUS_PLAN3,150,USD
4,18214,2016-05-01,BONUS_PLAN4,150,USD
I think i might be doing some mistake with the reader configuratuion (for csv) there is a similar issue discussed in the forum but this isnt helping either https://forums.mulesoft.com/questions/36378/dataweave-example-of-csv-to-json.html