问题
I'm trying to run the Java in Worklight Adapters example from the worklightadapterproject
smaple project, but I am facing an error when trying to invoke a procedure:
{
"errors": [
"Ecma Error: TypeError: Cannot call property addTwoIntegers in object [JavaPackage com.worklight.customcode.Calculator1]. It is not a function, it is \"object\". (C%3A%5CWorklightLab%5Cworkspace%5CWorklightAdaptersProject%5Cadapters%5CCalculatorAdapter\/CalculatorAdapter-impl.js#9)"
],
"info": [
],
"isSuccessful": false,
"warnings": [
]
}
How do I resolve this?
I tried setting this by using the following configuration which didn't work:
回答1:
This has been asked before. See the following questions and their solutions.
This is caused by one of two things:
- By not using Java compiler level 1.6 and JRE v1.6 (probably)
- Due to a missing segment in the .project file (less likely)
Try option #1 - use JRE 1.6 and Java compiler level 1.6.
Follow the instructions in the answer.
来源:https://stackoverflow.com/questions/20803265/ibm-worklight-6-1-ecma-error-typeerror-cannot-call-property-function-in-o