Inconsistent javascript failures

We've recently started seeing inconsistent errors from Javascript policies:

Execution of JavaScript.ExtractVariables.L2Auth failed on line 162 with error: Class org.mozilla.javascript.MemberBox can not access a member of class com.apigee.javascript.exec.RhinoExecutor$TopLevelScope with modifiers "public static"

It happens in a number of different scripts and doesn't always happen - on a set of tests sometimes they all pass, sometimes one or other of them will fail and the trace show the above error. The Javascript policy includes one other common file. In the error shown above, the file mentioned doesn't have 162 lines in it so I'm assuming it's occurring in a system file.

Has anyone else seen this? Anyone any thoughts?

Solved Solved
0 4 329
1 ACCEPTED SOLUTION

Not applicable

I am facing the same issue with the below error, However I do have line number 72 in my script and its a print stmt which is inside a catch block. When the print stmt is commented out this error is not replicable.

Error:

"Execution of prepare_data failed on line 72 with error: Class org.mozilla.javascript.MemberBox can not access a member of class com.apigee.javascript.exec.RhinoExecutor$TopLevelScope with modifiers \"public static\""

Code at Line 72 in prepare_data.js:

catch(err){

print("Execption occured while preparing data: ", err); //line 72

}

View solution in original post

4 REPLIES 4

Not applicable

I am facing the same issue with the below error, However I do have line number 72 in my script and its a print stmt which is inside a catch block. When the print stmt is commented out this error is not replicable.

Error:

"Execution of prepare_data failed on line 72 with error: Class org.mozilla.javascript.MemberBox can not access a member of class com.apigee.javascript.exec.RhinoExecutor$TopLevelScope with modifiers \"public static\""

Code at Line 72 in prepare_data.js:

catch(err){

print("Execption occured while preparing data: ", err); //line 72

}

Thanks for the response. We had a couple of print statements in the included file. I've just commented them out and it's ran through several times with no failures - so looks like it is an issue with the print statement.

Hope I was helpful.

But not sure why the print stmt is an issue, the error occurs irregularly, sometimes the apigee request is successful and sometimes its not

We've got a support ticket raised with Apigee for this. Hopefully they'll find the root cause - it seems to be a relatively recent issue as we've used print() before with no issues.