我正在尝试为Worklight v6.1.0运行Flight Ticket示例应用程序。我的设置工作正常。我按如下方式部署了应用程序:
FlightTicketSampleProject.zip
导入我的工作区。flightticket
,并将战争位置指向flightticket.war
。当我导航到http://localhost:10080/flightticket
时,我得到了简单的index.html消息。到目前为止,一切都很好。Run As -> Run on Worklight Development Server
部署了应用。当我打开Worklight Console并单击Preview as Common Resources
时,我在Eclipse控制台中收到错误,如下所示:
[ERROR ] FWLSE0020E: Ajax request exception: There is no application in the DB with the id 'FlightTicket'. [project module_60_4_FlightTicket]
[ERROR ] FWLSE0117E: Error code: 1, error description: INTERNAL_ERROR, error message: FWLSE0069E: An internal error occurred during gadget request [project module_60_4_FlightTicket]There is no application in the DB with the id 'FlightTicket'., User Identity {wl_authenticityRealm=null, FTRealm=null, wl_remoteDisableRealm=null, SampleAppRealm=null, wl_antiXSRFRealm=null, wl_deviceAutoProvisioningRealm=null, WorklightConsole=null, wl_deviceNoProvisioningRealm=null, wl_anonymousUserRealm=null}. [project module_60_4_FlightTicket]
com.worklight.common.log.filters.ErrorFilter
[ERROR ] FWLSE0099E: An error occurred while invoking procedure [project module_60_4_FlightTicket]FTAdapter/onAuthRequiredFWLSE0100E: parameters: [project module_60_4_FlightTicket]{
"arr": [
{
"Accept": [
"text\/javascript, text\/html, application\/xml, text\/xml, *\/*"
],
"Accept-Encoding": [
"gzip, deflate"
],
"Accept-Language": [
"en-IN"
],
"Cache-Control": [
"no-cache"
],
"Connection": [
"Keep-Alive"
],
"Content-Length": [
"66"
],
"Content-Type": [
"application\/x-www-form-urlencoded; charset=UTF-8"
],
"Cookie": [
"testcookie=oreo; JSESSIONID=0000Ujzcx6nIYXNuXrpCFmbvqwt:040ac9eb-2103-4149-97c9-431f2113a34f"
],
"Host": [
"192.168.174.1:10080"
],
"Referer": [
"http:\/\/192.168.174.1:10080\/module_60_4_FlightTicket\/apps\/services\/preview\/FlightTicket\/common\/0\/default\/views\/socialShare.html"
],
"User-Agent": [
"Mozilla\/5.0 (Windows NT 6.2; WOW64; Trident\/7.0; MALNJS; rv:11.0) like Gecko"
],
"WL-Instance-Id": [
"8k22jp5elrdat1d06sitpqeq1f"
],
"X-Requested-With": [
"XMLHttpRequest"
],
"x-wl-app-version": [
"1.0"
],
"x-wl-platform-version": [
"6.1.0.00.20131219-1900"
]
}
]
}
Function [onAuthRequired] not found.
我检查了onAuthRequired
函数的来源,但我找不到定义和函数调用。
有人可以告诉我这里发生了什么吗?
答案 0 :(得分:0)
你只是做错了。第2步完全不正确,并且在Worklight文档中没有任何地方可以看到它被要求执行。
以下是我所做的以及你应该遵循的内容:
Run As > Deploy Worklight adapter
Run As > Run on Worklight Development Server
第4步是必需的!如果不执行此步骤,则表示您未部署应用程序,这意味着您的应用程序将无法连接到Worklight Server。请参阅问题中提到的错误消息。它确切地告诉你,该应用程序不存在。
登录后:
答案 1 :(得分:0)
请确保您不删除Android项目下的原生文件夹。
war文件用作后端服务器(JAX-RS),因此移动设备将从此war文件中获取数据,就像您的真实企业数据一样,而工作光战则在eclipse中自动部署,并充当您的移动应用和适配器的网关将连接到后端服务器REST api以获取模拟数据。