how to replicate Failed parsing field: content org.mule.runtime.core.api.expression.ExpressionRuntimeException?

54 Views Asked by At

I have an API that is using GET method to get status of an order ./status/orderId/123456 123456 is a path parameter that we need to pass.

Sometimes in mule log I am seeing below error, but not sure the cause of error:

Failed parsing field: content org.mule.runtime.core.api.expression.ExpressionRuntimeException: "org.mule.weave.v2.exception.UnexpectedFunctionCallTypesException: You called the function 'AnonymousFunction' with these arguments: 1: String ("123456" as String {class: "java.lang.String"}) 2: Null (null) But it expects arguments of these types: 1: Any 2: String 3: Object 17|

How to reproduce this type of error?

1

There are 1 best solutions below

0
aled On

The error happens because your script is trying to use some value that is null. You didn't provide all details for reproduction but most likely the issue is in this expression:

write(inputData,inputData.^mimeType)

Probably inputData.^mimeType is returning null. You can reproduce the issue like this:

write(payload,null)

I would recommend to rewrite that expression and use an explicit argument for the format. What you are using may not be returning the value you are expecting.