Ecma Error: TypeError: Cannot call property

前端 未结 4 2072
清歌不尽
清歌不尽 2020-12-02 00:45

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\"

相关标签:
4条回答
  • 2020-12-02 01:06

    We have identified another possible solution to this.

    • Change Java compiler level to 1.6 as well as default JRE to 1.6:

    Compiler level JRE version

    0 讨论(0)
  • 2020-12-02 01:17

    Try adding the parenthesis when you instantiate your object:

    var fileInstance = new com.worklight.JavaCode.FileIOPlugin()
    
    0 讨论(0)
  • 2020-12-02 01:19

    Check your .project file and make sure it has the right buildCommand tags in it.

    <buildCommand>
            <name>org.eclipse.jdt.core.javabuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>org.eclipse.wst.common.project.facet.core.builder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>com.worklight.studio.plugin.WorklightProjectBuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>org.eclipse.wst.validation.validationbuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
    

    Read more at: ECMA TypeError calling Java class from Worklight adapter

    0 讨论(0)
  • 2020-12-02 01:26

    Make sure your package starts with com, e.g. rename it to "com.classes".

    0 讨论(0)
提交回复
热议问题