Exception while DeSeraializing object using object mapper(com.auth0) inside JavaCallout.

Hi All

I am getting Exception when when trying to deserialize and object. I am using JavaCallout policy, in which I have used Object Mapper to deserialize and object as following code snippet. But I am getting exception when executed this policy. This code works locally fine on my machine.

{"code":"ExecutionError","message":"Failed to execute JavaCallout. com/auth0/jwt/internal/com/fasterxml/jackson/databind/ObjectMapper {\"errorcode\":\"steps.javacallout.ExecutionError\"}","source":"apigeePolicy","sourceName":"apigeePolicy"}

My Code Snippet is following:-

import com.auth0.jwt.internal.com.fasterxml.jackson.databind.DeserializationFeature;
import com.auth0.jwt.internal.com.fasterxml.jackson.databind.ObjectMapper;

System.out.println("*****************************************************************************");

System.out.println("Input Base64 Data:: \n" + data);System.out.println("*****************************************************************************");

byte[] dataArray = Base64.decodeBase64(data);

String s = new String(dataArray);

s = s.replace("\n", "").replace("\\", "");

System.out.println("*****************************************************************************");

System.out.println("Data to be signed:: \n" + s);

System.out.println("*****************************************************************************");

String singedData = SigningUtil.signData(s,"11");

ObjectMapper mapper = new ObjectMapper();

mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);

Response res = mapper.readValue(s, Response.class);

Is it fine to use Object mapper inside Apigee Jar, Above code works fine when run locally on mac.

Regards,

Nishant

0 0 119
0 REPLIES 0