Ravindar, Integrations with Mulesoft & BizTalk

Just another Integration blog

“Unknown class or illegal statement” error with special characters in payload

We’ve faced an issue in a particular payload message.

one of the json fields value in the payload has special charaters # and [ and ]

like below

{
   "test":  "This is#[ hello world]. yes"
}

The api kit router was rejecting this message with an error

“Unknown class or illegal statement”

if you notice in the above message it has sysmbols # and [ and ] in the correct order it consider it as a mule expression.

following were the observations

1. The issue is only when you use API kit router. API kit router is rejecting such messages. Without API kit router mule accepts the message normal.

2. The issue is because API kit router unable to parse #[text….] in the message as it considered it as a MEL

3. it’s because of following 2 reasons. Without the following two things, the issue won’t happen
a) the two characters #[ should be together.(even no space)
b) There should be a closing bracket ] in the text somewhere after #[

when the two things are satisfied, the Apikit router cannot processes the message.

September 27, 2019 - Posted by | Mule 3, Mulesoft

No comments yet.

Leave a comment