Examine the JavaCallout policy and the resource that is used. In the above example, the JavaCallout policy uses a resource named hello.jar, as shown below:
Compile and replace the affected resource (JAR file) with the updated Java artifact.
Deploy the API Proxy as a new revision and make the API call.
Start another trace session.
Notice that a stack trace is available in the JAVA_STACKTRACE variable. The stack trace lists the actual exception and the Java source file and line number at which the error is being thrown.
Use this information to fix the issue in the Java code.
In this example, the JavaCallout policy failed due to an ArithmeticException (division by zero) in the JavaError.java file at line #25.
Resolution
Depending on the exception thrown, fix the issue in the relevant Java source file(s).
a. In the example shown above, the issue was caused by an arithmetic error (division by zero). Go to the specific source file and line number indicated by the stack trace.
b. Since you cannot perform division by zero, remove the complete else block containing the faulty line of code to resolve the problem.
Replace the relevant JAR file containing the modified files at the appropriate level (API proxy, environment or organization), where it previously existed.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-20 UTC."],[[["\u003cp\u003eThis documentation addresses troubleshooting for \u003ccode\u003esteps.javacallout.ExecutionError\u003c/code\u003e in Apigee and Apigee hybrid environments, specifically related to JavaCallout policies.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eExecutionError\u003c/code\u003e occurs when Java code within a JavaCallout policy throws an exception or returns \u003cem\u003enull\u003c/em\u003e.\u003c/p\u003e\n"],["\u003cp\u003eDiagnosis involves using a trace session to identify the failing JavaCallout policy and examining the relevant JAR resource, along with capturing the Java exception in a flow variable named \u003ccode\u003eJAVA_STACKTRACE\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eResolution requires identifying the specific Java exception and its location (file and line number) from the stack trace, fixing the error in the source code, and updating the corresponding JAR file.\u003c/p\u003e\n"],["\u003cp\u003eThe example given in this document outlines an \u003ccode\u003eArithmeticException\u003c/code\u003e (division by zero), for which you can resolve by removing or correcting the lines of code that cause the error, updating the jar file and deploying a new revision.\u003c/p\u003e\n"]]],[],null,[]]