简体   繁体   English

从javascript适配器调用Java代码时出错

[英]Error While invoking java code from javascript adapter

I am using IBM MobileFirst 7.1 and I am calling java code from Javascript adapter. 我正在使用IBM MobileFirst 7.1,并且正在从Javascript适配器调用Java代码。 But, I am getting error while calling adapter. 但是,调用适配器时出现错误。 Error is: 错误是:

 {  
   "errors": [  
      "Ecma Error: TypeError: Cannot call property main1 in object [JavaPackage com.sample.customcode.SendMail]. It is not a function, it is \"object\". (2016-10- 
05T10:46:40.941Z\/74c15a587d1ce37bbfce9925722acab7b6321aad\/UsingJavaInAdapter-impl.js#19)"  
   ],    
   "info": [  
   ],  
   "isSuccessful": false,  
   "warnings": [  
    ]  
}   

I have changed Java compiler level to 1.6 as well as default JRE to 1.6 from 1.7. 我将Java编译器级别更改为1.6,并将默认JRE从1.7更改为1.6。
But still I am facing same error. 但是我仍然面临着同样的错误。 This code is working in one project in same eclipse workspace. 这段代码在同一个Eclipse工作区的一个项目中运行。 But in another project this not working. 但是在另一个项目中,此方法无效。

Make sure to also change the Java compiler level for the specific project. 确保还更改特定项目的Java编译器级别。 Right-click the project and select Properties -> Java Build Path -> Java Compiler. 右键单击项目,然后选择属性-> Java构建路径-> Java编译器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM