0

I need to call a Java function from the worklight ADAPTER. I have followed the "adding Java to worklight adapter" document, but my problem did not get solved. I was not able to call the function.

The structure of the Java code that I have is as follows:

server/java
com.worklight.custonmode           package name
loginfunction.java                     java 
login                              java method in class loginfunction

From the adapter, I am calling:

function loginmodules(username, passwd) {   
    return {
        result : com.worklight.custonmode.loginfunction.login()
    };
}

I am getting the error as:

response [/apps/services/api/erLight/common/query] success: /-secure- {"responseID":"2","errors":["Ecma Error: TypeError: Cannot call property login in object [JavaPackage com.worklight.custonmode.loginfunction]. It is not a function, it is \"object\". (C%3A%5CUsers%5CADMIN%5CworkspaceM11%5CMobileClient%5Cadapters%5CAdapter/Adapter-impl.js#103)"],"isSuccessful":false,"warnings":[],"info":[]}/

worklight.js (line 1112)

Procedure invocation error. Ecma Error: TypeError: Cannot call property login in object [JavaPackage com.worklight.custonmode.loginfunction]. It is not a function, it is "object". (C%3A%5CUsers%5CADMIN%5CworkspaceM11%5CMobileClient%5Cadapters%5CAdapter/Adapter-impl.js#103)

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
anilgontla
  • 103
  • 1
  • 4
  • 12
  • What is the "'adding Java to worklight adapter' document"? Do you have a link? – adamdunson Mar 13 '13 at 06:36
  • yes i have ftp://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v505/Module_05_5_-_Using_Java_in_Adapters.pdf or http://www.ibm.com/developerworks/mobile/worklight/getting-started.html#authentication download module_05_5 – anilgontla Mar 13 '13 at 13:53

0 Answers0