IBM Worklight 6.1 - “Ecma Error: TypeError: Cannot

2019-03-02 07:08发布

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:

config preferences config preferences 2

1条回答
forever°为你锁心
2楼-- · 2019-03-02 07:39

This has been asked before. See the following questions and their solutions.
This is caused by one of two things:

  1. By not using Java compiler level 1.6 and JRE v1.6 (probably)
  2. 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.

查看更多
登录 后发表回答