Deploy java callout policy on Apigee cloud

I would like to deploy sample java callout policy on apigee on cloud without creating JAR file in my local. If I deploy that exact project which i got from GIT on cloud then APIGEE will automatically execute java code and create required JAR file?

Solved Solved
0 7 909
2 ACCEPTED SOLUTIONS

@Rajat Agarwal ,

Welcome to Apigee Community.

I don't think Apigee will automatically create jar files for you. You need to upload same to Apigee Edge using local deployment option / UI.

1520-screen-shot-2015-11-20-at-122022-pm.png

If you would like upload form local instance,

Place the JAR in an API proxy under /resources/java.If your JavaCallout relies on additional third-party libraries packaged as independent JAR files, then place those JAR files in the /resources/java directory as well to ensure that they are loaded correctly at runtime. If you are using the management UI to create or modify the proxy, add a new resource and specify an additional dependent JAR file. If there are multiple JARs, simply add them as additional resources. You do not need to modify the policy configuration to refer to additional JAR files. Putting them in /resources/java is sufficient.For information on uploading Java JARs, see Resource files.

Find more about java callout policy here.

View solution in original post

@Rajat Agarwal Unfortunately no. You have to create a jar locally and deploy that on Apigee.

View solution in original post

7 REPLIES 7

@Rajat Agarwal ,

Welcome to Apigee Community.

I don't think Apigee will automatically create jar files for you. You need to upload same to Apigee Edge using local deployment option / UI.

1520-screen-shot-2015-11-20-at-122022-pm.png

If you would like upload form local instance,

Place the JAR in an API proxy under /resources/java.If your JavaCallout relies on additional third-party libraries packaged as independent JAR files, then place those JAR files in the /resources/java directory as well to ensure that they are loaded correctly at runtime. If you are using the management UI to create or modify the proxy, add a new resource and specify an additional dependent JAR file. If there are multiple JARs, simply add them as additional resources. You do not need to modify the policy configuration to refer to additional JAR files. Putting them in /resources/java is sufficient.For information on uploading Java JARs, see Resource files.

Find more about java callout policy here.

@Rajat Agarwal Unfortunately no. You have to create a jar locally and deploy that on Apigee.

Thank anil and sarthak.

I am following readme document given for java call out sample policy project by apigee.

when i am trying to follow the steps in ream me i am getting error at step where we compile java class-- its giving compile as its not able to find the java classes which are imported in CityLookup ie 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;

since we need to provide jar file with compiled Citylookup java class and required jars

as i was not able to compile it locally so thought of doing it on APIGEE cloud

so i deploy that complete \java-cookbook folder as zip will it automatically compile java class and create jar?

actually due to some setup constraint/limitation i am not able to compile java class as of now.

kindly suggest

I am now successfully able to deploy java callout project on apigee developer portal.

I am trying to hit using below URL but not able to get response.

http://agarwalrajat-test.apigee.net/v1/java-cookbook/forecastrss?w=ROME

http://agarwalrajat-test.apigee.net/java-cookbook/forecastrss?w=ROME

can you see any loophole in that.

kindly suggest

Hey Its working 🙂

Awesome, Moving forward please use comments instead of answers to keep the discussion in readable way.

@Rajat Agarwal , You can also click on Accept link below the answer if your query is resolved. Thank you 🙂