1
votes

I am getting below dataweave exception while executing a mule flow :

"
        INFO  2016-11-06 09:02:42,097 [[abc].HTTP_Listener_Configuration.worker.01] com.mulesoft.weave.mule.utils.MuleWeaveFactory$: MimeType was not resolved '*/*' delegating to Java.
    ERROR 2016-11-06 09:02:42,290 [[abc].HTTP_Listener_Configuration.worker.01] org.mule.exception.CatchMessagingExceptionStrategy: 
    Message               : Exception while executing: 
    "Response": {
                   ^
    Unexpected character '\u000a' at index 25 (line 2, position 24), expected '"'
    Payload               : test
    Payload Type          : java.lang.String
    Element               : /Process11/processors/9/1/9 @ abc:def.xml:331 (TM_F1)
    Element XML           : <dw:transform-message doc:name="TM_F1">
                    <dw:set-payload>%dw 1.0%output application/json---{Data: [{//       in_id : flowVars.instanceId,pd: '{AmIds:[{AmId:' ++ flowVars.AmId ++ '}]}'}]}</dw:set-payload>
                    </dw:transform-message>
    Root Exception stack trace:
    com.mulesoft.weave.reader.json.JsonReaderException: Unexpected character '\u000a' at index 25 (line 2, position 24), expected '"'
    at com.mulesoft.weave.reader.json.JsonTokenizer.fail(JsonTokenizer.scala:193)
    at com.mulesoft.weave.reader.json.JsonTokenizer.require(JsonTokenizer.scala:190)
    at com.mulesoft.weave.reader.json.JsonTokenizer.readString(JsonTokenizer.scala:80)
"

Is there any possibility to enable more debug options to get more information about this particular exception so that it will be easy to find out the root cause.

The problem here is, even though i am not using the payload in transform message i am getting error because of the payload returned by the previous http call in muleflow.

Mule version is : studio 6.1 and runtime 3.8.

Please help me to solve this issue.

Thanks sdg

3
Please share your Output payload section for dataweave. Error message indicates that there is new line character where dataweave was expecting double quotes ' " 'Vijay Pande

3 Answers

2
votes

This is not dataweave question. Exception what you have is from JsonReaderException:

com.mulesoft.weave.reader.json.JsonReaderException: Unexpected character '\u000a' at index 25 (line 2, position 24), expected '"'

It means that JSON what you provide has new line (\u000a) ate line 2 position 24. I imagine it is something like this:

"Response": {
  "Message" : "67890123
                       456 the end"
}

Use special characters to represent new line in JSON.

"Response": {
  "Message" : "67890123\n456 the end"
}
0
votes

Enable info logs in log4j and enable debug logs at cloudhub if its an on cloud deployment.

Please Try validating the json as well

0
votes

Debug is the best option to figure out these kind of errors. Also you may use the logger feature of dataweave to log specific values on console and see whats wrong with the value.