¿Which third-party jar files are supported by Apigee?

I am planning to use few 3rd party jar files in my java callout. Is there a way to find the list of 3rd party jars that is supported in apigee. @Dino-at-Google @Sai Saran Vaidyanathan

I would like to use the following jars in my proxy

  • jolt-core
  • json-utils

The following community article gets me list of 3rd party jars supported in apigee. The above mentioned jars are not present in the list.

(https://community.apigee.com/questions/15249/how-do-i-get-the-list-of-jar-libraries-already-ava.html) FYI-proxy bundle attached in that article is throwing Error 500.

1 3 352
3 REPLIES 3

@Dino-at-Google has written that sample API proxy bundle in Jan, 2016. Since then, Java security policies in Apigee runtime has changed. Hence, it may not work now.

I think it would be better to bundle all dependencies of your Java Callout policy implementation without relying on the ones provided by Apigee. That way you could ensure required versions of dependent libraries are loaded together with the Java Callout JAR file.

Here, you may need to note that all JAR files imported to Apigee would need to comply with Apigee Java permission policies:
https://docs.apigee.com/api-platform/reference/java-permission-reference

If any of the Java security policies are violated by the Java Callout JAR or dependent libraries, Apigee runtime will not execute that code. Hope this would help.

I agree with that.

If you want to use a third-party jar, you need to provide it as a resource in the proxy bundle, or as a resource in the environment or organization.

I tried using jolt and the Java permissions prevented it from running with the following exception:

"java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")".

My simple test:

package com.kurt.jolt;

import com.bazaarvoice.jolt.Chainr;
import com.bazaarvoice.jolt.JsonUtils;

import com.apigee.flow.execution.ExecutionContext;
import com.apigee.flow.execution.ExecutionResult;
import com.apigee.flow.execution.spi.Execution;
import com.apigee.flow.message.MessageContext;

import java.util.List;

public class sample implements Execution {

	public ExecutionResult execute(MessageContext messageContext, ExecutionContext executionContext) {
    	try {
	    	String input = "{\"rating\": {\"primary\": {\"value\": 3},\"quality\": {\"value\": 3 }}}";
	    	String spec = "[ { \"operation\": \"shift\", \"spec\": { \"rating\": { \"primary\": { \"value\": \"Rating\" }, \"*\": { \"value\": \"SecondaryRatings.&1.Value\", \"$\": \"SecondaryRatings.&.Id\" } } } }, { \"operation\": \"default\", \"spec\": { \"Range\" : 5, \"SecondaryRatings\" : { \"*\" : { \"Range\" : 5 } } } } ]";

	    	List chainrSpecJSON = JsonUtils.jsonToList( spec );
	        Chainr chainr = Chainr.fromSpec( chainrSpecJSON );
	        Object inputJSON = JsonUtils.jsonToObject( input );
	        Object transformedOutput = chainr.transform( inputJSON );
   		
	        messageContext.getMessage().setContent(JsonUtils.toJsonString(transformedOutput));
    		return ExecutionResult.SUCCESS;
    	} catch (Exception e) {
	        messageContext.setVariable("jolt_stacktrace", e.toString());
    		return ExecutionResult.ABORT;
    	}
    }
}

Java Callout:

9421-javacalloutjolt.png