Deployment of the API Proxy failed with error "Both the operands for EQUALS expression should be data expressions"

The deployment of the API Proxy is failing with the error "Both the operands for EQUALS expression should be data expressions".

What is the cause for this error ?

Solved Solved
0 1 764
1 ACCEPTED SOLUTION

  1. Looked into the Message Processor logs and found the following stack trace corresponding to this error:
    2018-06-01 13:55:17,796 org:myorg env:dev  Apigee-Main-246 ERROR STARTUP_RUNTIME_ERROR - Application.sync() :  sync error for ErrorResponseLogging and revision 1
    2018-06-01 13:55:17,797 org:myorg env:dev  Apigee-Main-246 ERROR STARTUP_RUNTIME_ERROR - Application.sync() :  Actual Error
    com.apigee.expressions.parser.ParseException: Both the operands for EQUALS expression should be data expressions
            at com.apigee.expressions.parser.ExpressionParser.buildExpressionTree(ExpressionParser.java:337) ~[expressions-1.0.0.jar:na]
            at com.apigee.expressions.parser.ExpressionParser.parse(ExpressionParser.java:24) ~[expressions-1.0.0.jar:na]
            at com.apigee.expressions.parser.ExpressionParser.parseLogicExpression(ExpressionParser.java:28) ~[expressions-1.0.0.jar:na]
            at com.apigee.messaging.runtime.Step.getExpression(Step.java:67) ~[message-processor-1.0.0.jar:na]
            at com.apigee.messaging.runtime.Step.handleAdd(Step.java:58) ~[message-processor-1.0.0.jar:na]
            at com.apigee.messaging.runtime.SharedFlowRuntime.addStep(SharedFlowRuntime.java:81) ~[message-processor-1.0.0.jar:na] 
    … <snipped>
  2. The error message in the ParseException - "Both the operands for EQUALS expression should be data expressions" indicated that a condition involving equal to (=), not equal to (!=) or Stats with (=|) operator must be having some issue.
  3. So I checked all the Conditional Expressions used and found the problem in the following line:
    <Condition>(error.state != null) and (productId === 'PayApp')</Condition>
  4. The error was thrown because "===" was used instead of "=="
  5. Modified this line as follows:
    <Condition>(error.state != null) and (productId == 'PayApp')</Condition>
  6. Saved the changes and deployed the API Proxy again.

With this change, the deployment went through successfully.

View solution in original post

1 REPLY 1

  1. Looked into the Message Processor logs and found the following stack trace corresponding to this error:
    2018-06-01 13:55:17,796 org:myorg env:dev  Apigee-Main-246 ERROR STARTUP_RUNTIME_ERROR - Application.sync() :  sync error for ErrorResponseLogging and revision 1
    2018-06-01 13:55:17,797 org:myorg env:dev  Apigee-Main-246 ERROR STARTUP_RUNTIME_ERROR - Application.sync() :  Actual Error
    com.apigee.expressions.parser.ParseException: Both the operands for EQUALS expression should be data expressions
            at com.apigee.expressions.parser.ExpressionParser.buildExpressionTree(ExpressionParser.java:337) ~[expressions-1.0.0.jar:na]
            at com.apigee.expressions.parser.ExpressionParser.parse(ExpressionParser.java:24) ~[expressions-1.0.0.jar:na]
            at com.apigee.expressions.parser.ExpressionParser.parseLogicExpression(ExpressionParser.java:28) ~[expressions-1.0.0.jar:na]
            at com.apigee.messaging.runtime.Step.getExpression(Step.java:67) ~[message-processor-1.0.0.jar:na]
            at com.apigee.messaging.runtime.Step.handleAdd(Step.java:58) ~[message-processor-1.0.0.jar:na]
            at com.apigee.messaging.runtime.SharedFlowRuntime.addStep(SharedFlowRuntime.java:81) ~[message-processor-1.0.0.jar:na] 
    … <snipped>
  2. The error message in the ParseException - "Both the operands for EQUALS expression should be data expressions" indicated that a condition involving equal to (=), not equal to (!=) or Stats with (=|) operator must be having some issue.
  3. So I checked all the Conditional Expressions used and found the problem in the following line:
    <Condition>(error.state != null) and (productId === 'PayApp')</Condition>
  4. The error was thrown because "===" was used instead of "=="
  5. Modified this line as follows:
    <Condition>(error.state != null) and (productId == 'PayApp')</Condition>
  6. Saved the changes and deployed the API Proxy again.

With this change, the deployment went through successfully.