0

I am trying to convert a XML file to a POJO using data weave in mule, but it throws this exception -:

Message : Exception while executing: time: payload.deliveryMessageDate.time ^ Type mismatch found :name, :binary required :name, :object Type : com.mulesoft.weave.mule.exception.WeaveExecutionException Code : MULE_ERROR--2


Exception stack is: 1. Type mismatch found :name, :binary required :name, :object (com.mulesoft.weave.engine.ast.dynamic.DynamicDispatchException) com.mulesoft.weave.engine.ast.dynamic.DynamicDispatchNode:65 (null) 2. Exception while executing: time: payload.deliveryMessageDate.time ^ Type mismatch found :name, :binary required :name, :object (com.mulesoft.weave.mule.exception.WeaveExecutionException) com.mulesoft.weave.mule.WeaveMessageProcessor:124 (null)


Root Exception stack trace: com.mulesoft.weave.engine.ast.dynamic.DynamicDispatchException: Type mismatch found :name, :binary required :name, :object at com.mulesoft.weave.engine.ast.dynamic.DynamicDispatchNode.dispatchNode(DynamicDispatchNode.scala:65) at com.mulesoft.weave.engine.ast.dynamic.DynamicDispatchNode.valueType(DynamicDi...

I haven't used any annotation on my POJO and the xml has some attributes inside the tags.

Arup Mishra
  • 189
  • 2
  • 14

2 Answers2

0

You might have to format your date. try to follow the below link if you still have problem please share your logic screen that will give clear idea.

Converting to a date format in Mule using DataWeave

Community
  • 1
  • 1
0

Suppose Your Json is { "date": "2016-13-09" }

Data weave for converting date is :-

date : payload.date as :date {format: "yyyy-dd-MM"} as :string{format: "yyyyMMdd"}

Firstly its match date and then convert to your specific formats.