You're viewing Apigee Edge documentation.
Go to the
Apigee X documentation. info
ExecutionError
Error Code
steps.javacallout.ExecutionError
Error response body
{
"fault": {
"faultstring": "Execution returned an error result",
"detail": {
"errorcode": "flow.execution.ExecutionReturnedFailure"
}
}
}
Cause
This error occurs if Java code throws an exception or returns null during the execution of a JavaCallout policy.
Diagnosis
Start a trace session to capture the error and identify which JavaCallout policy has failed.
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:<JavaCallout name="hello-java"> <ClassName>com.apigeesample.HelloJava</ClassName> <ResourceURL>java://hello.jar</ResourceURL> </JavaCallout>
Capture and store the Java exception in a flow variable by modifying the source code, as described in Handling errors in a Java Callout.
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.
Save and deploy the API proxy as a new revision.