As explained in this question, I must set some attributes before APIKit. However, one of them is a secure property:
%dw 2.0
output application/java
---
(
(attributes
- "headers"
- "maskedRequestPath")
++
({
headers: attributes.headers
++
{
xpto: p("secure::SOME-VALUE")
}
})
)
as Object {
class: "org.mule.extension.http.api.HttpRequestAttributes"
}
Now I am getting below error:
""Exception happen while calling 'class org.mule.extension.http.api.HttpRequestAttributesBuilder.build()' method. Reason: Errors while creating org.mule.runtime.api.util.SerializableLazyValue by reflection, even when class in on classpath.'
5| (attributes | ... 19| }
Trace: at main (line: 5, column: 5)" evaluating expression: "%dw 2.0 output application/java --- ( (attributes - "headers" - "maskedRequestPath") ++ ({ headers: attributes.headers ++ { xpto: p("secure::SOME-VALUE") } }) ) as Object { class: "org.mule.extension.http.api.HttpRequestAttributes" }"."
Is there a way to solve this issue?
Seems like the field
clientCertificateis creating problem. You can try removing them like you did withmaskedRequestPath. Also want to mention that if you are using Mule 4.3 or later you can reduce your DataWeave usingupdateoperator