Worklight adapter It is not a function, it is “object”. error

后端 未结 2 1426
礼貌的吻别
礼貌的吻别 2021-01-29 01:16

After deploying worklight adapter onto production server, when adapter makes a call to java code from javascript I get an error:

rocedure invocation error. Ecma          


        
2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-29 02:06

    a search would have given you a couple of questions/answers already: i want to call a java class from the worklight adapter ; ECMA TypeError calling Java class from Worklight adapter ; Ecma Error: TypeError: Cannot call property

    we had that problem several times and it always had something to do with a corrupted eclipse .project file. What happens is that the Java Class you have does not get built and does not get added to your worklight.war file. When you deploy your app, the compiled class is missing on the server and the ECMA error tells you that in a very cryptic way.

    One solution we found was to open the properties of the WL project with a right click go to the Java Build Path and move some of the entries UP and DOWN using the buttons there. After closing the properties dialog eclipse should rewrite the .project file and the build should work.

    Another thing we did sometimes was to add a new class to the project/server/java part of the project using the eclipse New-Class wizard, clean and rebuild the project and then remove the class again. Maybe even start eclipse with the option -clean at the end of the startup string that it uses.

提交回复
热议问题