JSON in Javacallout

Hello,

I'm migrating my API Proxies from APIGE Edge to APIGEE X / Hybrid and facing an issue about serializing / deserializing and constructing JSON objects & arrays. In fact, in the Edge version the package org.json was doing the job perfectly but now after i had migrated to APIGEE X / Hybrid, but while debugging my calls in trace i have this issue :

Failed to execute JavaCallout. org/json/JSONObject

I tried with another package : javax.json but still same isse : 

Failed to execute JavaCallout. javax/json/Json

So i'm thinking that maybe the problem comes from this package and that it's not compatible with version of APIGEE X

 

Could you please help me on this tricky issue ?

 

Regards,

0 1 173
1 REPLY 1

Yes, try this repo: 

https://github.com/DinoChiesa/Apigee-Java-Json-Parse

Per the README, 

In my tests, both the Gson and Jackson libraries use reflection, which is not permitted in Apigee. This leads to a runtime error. The Javax version does not use reflection, and works in Apigee.

(JavaX here applies to the custom class included in the source repo)