How to get more information about dataweave exception in muleosft

不想你离开。 提交于 2019-12-11 05:29:23

问题


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


回答1:


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"
}



回答2:


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

Please Try validating the json as well




回答3:


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.



来源:https://stackoverflow.com/questions/40445786/how-to-get-more-information-about-dataweave-exception-in-muleosft

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!