i have followed this document module 5.5 in this url \"http://www.ibm.com/developerworks/mobile/worklight/getting-started.html#authentication\" or ftp://public.dhe.ibm.com
Make sure that login() function is public and static. Check out a sample code of the training module you're working with.
I just figured this out. It's funny how everyone went silent on this issue for two months. For me it wasn't obvious at all because it works in some projects and simply doesn't in others. The same is true for machines. It'll work one place, but not another (if you're not aware of what's going on).
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