My Oracle Support Banner

java.lang.ClassCastException: com.vordel.mime.RawBody cannot be cast to com.vordel.mime.JSONBody (Doc ID 2057981.1)

Last updated on AUGUST 19, 2022

Applies to:

Oracle API Gateway - Version 11.1.2.1.0 and later
Information in this document applies to any platform.

Symptoms

A policy in OAG (WS/SOAP Service) creates an external call to a REST Service that returns a JSON formatted message.  The policy should process the returned JSON Message and convert it to a XML message that serves as a response to the initial caller.

After the connection filter (to the REST service), a Trace Filter was placed to verify the contents of the variable content.body.  The Trace Filter will expose whether or not the message content is a valid JSON message, which it is in this test:

content.body {
DEBUG new buffered content stream <STREAM ID>
DEBUG delete buffered content stream <STREAM ID> <BUFFERED ID>
DEBUG Value: {"code":1,"message":"Lead successfully created","data":{"<PARAMETER>":<VALUE>}}
DEBUG Type: com.vordel.mime.RawBody
DEBUG }

However the JSON to XML Filter fails with the following message:

java exception:
java.io.IOException: No JSON body found
...
Caused by: java.lang.ClassCastException: com.vordel.mime.RawBody cannot be cast to com.vordel.mime.JSONBody

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.