Ecma错误:TypeError:无法调用属性 [英] Ecma Error: TypeError: Cannot call property

查看:195
本文介绍了Ecma错误:TypeError:无法调用属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在worklight项目的适配器中编写了一些java代码。当我试图调用java方法时,我收到错误说

I have written some java code in an adapter in worklight project. when i m trying to call the java method, i am getting an error saying


responseID:6,errors:{ Ecma错误:TypeError:无法在对象
JavaPackage java.classes.FileIOPlugin]中调用属性downloadFile。它不是一个函数,它是
\object \。}

"responseID":"6","errors": {Ecma Error: TypeError: Cannot call property downloadFile in object JavaPackage java.classes.FileIOPlugin]. It is not a function, it is \"object\".}

我完全按照程序执行了在以下链接中说明。
在适配器中使用Java

I have followed the procedure exactly stated in the following link. Using Java in Adapters

这是我的项目结构。这个结构有什么问题,还是我应该添加更多内容?

this is my project structure. Is there something wrong with this structure or should i add anything more to this?

这就是我试图在adapter-impl.js中调用java非静态方法

This is how i am trying to call the java non-static method in adapter-impl.js

function downloadFile() {
    var fileInstance = new com.worklight.JavaCode.FileIOPlugin();
    return
    {   result: fileInstance.downloadFile();    };

}

推荐答案

我们已经确定了另一个可能的解决方案。

We have identified another possible solution to this.


  • 将Java编译器级别更改为1.6以及将默认JRE更改为1.6:


这篇关于Ecma错误:TypeError:无法调用属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆