How do I get the list of jar libraries already available in Apigee? (so I dont need to add them)

Not applicable

Apigee Edge includes a set of Java JARs that are available to all Java callouts in the Message Processor. These JARs can be referenced by Java callout code, and there's no need to upload the same Java JARs for use within the API proxy bundle. The question is, which JARs are on that list?

Solved Solved
6 13 5,163
1 ACCEPTED SOLUTION

@Ivan Beerli and @Juan Carlos Cancela

GREAT question.

Unfortunately this list is not officially documented by Apigee, at the moment.

The way I have answered the question is to build a Java callout that just examines the system property called java.class.path , and parses out the list of thirdparty jars. Then embed this callout into a proxy, and just call the proxy. For example if you try this:

curl -i http://deecee-test.apigee.net/java-props/3rdpartyjars

...(or just invoke that link in the browser) you should see the list of 3rd party jars in MY Apigee Edge organization + environment.

Attached please find the list that I've received. This list may change. Also attached please find the API Proxy bundle that generates the list. You can deploy it to your own environment and try it yourself.

3rdpartylibs.txt

java-props-rev1-2016-01-07.zip

View solution in original post

13 REPLIES 13

Not applicable

commons-httpclient-3.1.jar is one...

Not applicable
Also:
  • Apigee Edge expressions v1.0
  • Apigee Edge message-flow v1.0
  • Apache commons lang 2.6
  • Apache commons codec 1.7
  • Apache commons httpclient 4.3.5

@Ivan Beerli and @Juan Carlos Cancela

GREAT question.

Unfortunately this list is not officially documented by Apigee, at the moment.

The way I have answered the question is to build a Java callout that just examines the system property called java.class.path , and parses out the list of thirdparty jars. Then embed this callout into a proxy, and just call the proxy. For example if you try this:

curl -i http://deecee-test.apigee.net/java-props/3rdpartyjars

...(or just invoke that link in the browser) you should see the list of 3rd party jars in MY Apigee Edge organization + environment.

Attached please find the list that I've received. This list may change. Also attached please find the API Proxy bundle that generates the list. You can deploy it to your own environment and try it yourself.

3rdpartylibs.txt

java-props-rev1-2016-01-07.zip

Thanks for reply Dino! Now I understand why my java callout, that uses guava library, was working without upload the guava jar. I'll try it in my environment. Thanks again!

@Dino

I uploaded the proxy in my environment and when tested through Postman it throws an error "Malformed JSON: Unexpected 'a' ".

What could be the reason?

I think the reason is: by default the reply is not JSON. Unfortunately, I see the header in the response is being set as "Content-Type: application/json", which is wrong when the response is actually plain text. Tell you what: I'll fix the proxy and update it here, and let you know. But, even with this error, if you look at the reply in postman as plaintext, you should see the list of jars.

ok @Vipul Agarwal - I've updated the proxy so that it does not sent the wrong Context-type header. It should work in postman now.

@Dino-at-Google I tried using the above curl. It is not working now. Do you have any document or curl that lists the recent 3rd party jars supported by apigee.

I also tried uploading the bundle in my cloud and opdk version. The proxy fails in the cloud but gets me the response in opdk.(Version 4.18.05.00)

http://{vhost}.apigee.net/java-props/3rdpartyjars

{"fault":{"faultstring":"Execution returned an error result","detail":{"errorcode":"flow.execution.ExecutionReturnedFailure"}}}

Nope - the mechanism that allowed us to enumerate the known jars in the classpath is no longer permitted in Java callouts. For now, you should load your own dependencies as resources in the org/env or proxy. (Org/env will be easier on your system, less duplication. But more shared dependencies.)

@dchiesa1 ¿is this apply also to Apigee X and hybrid version?, actually i´m trying charge this bcprov-jdk15on-1.68.jar library on a sharedflow but i get the next error:

 
Status: instance "xxxxxx" reported error messaging.resource.CouldNotExtractJavaResource: "Could not extract the java resource bcprov-jdk15on-1.68.jar"
 
this solution that you posted, ¿could be help me?

Hi Jose, 

unfortunately, I don't understand your question. I'm not understanding this:


@josegarciae wrote:

i´m trying charge this bcprov-jdk15on-1.68.jar library on a sharedflow


 

I don't know what you mean by "charge a JAR on a sharedflow".  That doesn't parse, for me.   JARs are used by Java callouts. You may have a Java callout within a shared flow, and that JAva callout may reference the JAR.  But the JAR is used by the Java callout policy, not by the sharedflow. The sharedflow is just a container for the Java callout policy.  The fact that you are using a sharedflow should be irrelevant


@josegarciae wrote:

i get the next error:

 
Status: instance "xxxxxx" reported error messaging.resource.CouldNotExtractJavaResource: "Could not extract the java resource bcprov-jdk15on-1.68.jar"

When / where do you get that error?  I'm not clear on what you're trying to do, or what is showing you that error.  but if I had to guess, it might be,

  • you have a Java callout that refers to that JAR in some way? either explicitly (via IncludeURL) or implicitly (via dependency)
  • Apigee is trying to open the jar and extract the class files, and is failing

Why is it failing ?

Either the jar file (resource) does not exist, OR the named jar file exists  but it is malformed or corrupted. 

Can you check those things?

But I have to say I am guessing here, because you haven't provided context for 

  • java callout policy configuration
  • when/where you are seeing the error you have reported.  What are you doing when thart error displays?  At import time? Deploy time? runtime?  some other time? 
  • what it means to "charge the JAR on a sharedflow". 

@Juan Carlos Cancela , Welcome to Apigee Community 🙂

Not applicable

@Dino is there a third party library

''caniuse' shipped along with apigee ?