Worklight Flight Ticket Sample "Function [onAuthRequired] not found." - ibm-mobilefirst

I'm trying to run the Flight Ticket Sample Application for Worklight v6.1.0. My setup is working fine. I deployed the application as follows:
I imported the project zip file FlightTicketSampleProject.zip into my workspace.
I created a new web application in the server.xml file with the context root as flightticket and pointed the war location to flightticket.war. When I navigate to http://localhost:10080/flightticket I get the message simple index.html. Everything is fine so far.
I then deployed the three adapters FTAdapter, FTPushAdapter and LoginAdapter to the server.
Finally, I deployed the app using Run As -> Run on Worklight Development Server.
When I open Worklight Console and click on Preview as Common Resources, I get an error in Eclipse console as follows:
[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.
I have checked the source for the onAuthRequired function but I'm not able to find either the definition nor the call to the function.
Can someone tell me what's happening here?

You are just doing it wrong. Step 2 is completely not correct and no where in the Worklight documentation will you see it being asked to do.
Here's what I've done and what you should follow:
Downloaded the Flight Ticket sample project
Imported it to Eclipse running Worklight Developer Edition 6.1
Right-clicked on each of the adapters in the adapters folder and chose Run As > Deploy Worklight adapter
Right-clicked on the FlightTicket app in the apps folder and chose Run As > Run on Worklight Development Server
Open Worklight Console
Ran the app in the Android Emulator
Step 4 is required! If you do not do this step, it means you do not deploy your application, which means your app will fail to connect to the Worklight Server. See the error message you've mentioned in the question. It tells you exactly that, that the app does not exist.
After login:

Please ensure you don't delete the native folder under your Android project.
The war file is used as backend server(JAX-RS), so mobile will get the data from this war file like your real enterprise data, while worklight war is auto deployed in the eclipse, and serve as the gateway for your mobile app and adaptors will connect to the backend server REST api to get mock up data.

Related

How do I make APIManagement Service Logger deploy before the Application insights Resource?

I am trying to make the following ARM deploy a APIM service logger, however the service logger starts to deploy before the app insights resource and fails, the app insights resource is in a seperate template. I have added a dependson statement and thought that would do the job but that did'nt work either. Also the code below actually works if the app insights is already deployed.
does anyone have any pointers?
{
"type": "Microsoft.ApiManagement/service/loggers",
"name": "[concat(variables('apiManagementInstanceName'), '/', parameters('appInsightsName'))]",
"apiVersion": "2018-01-01",
"properties": {
"loggerType": "applicationInsights",
"description": "Logger resources to APIM",
"credentials": {
"instrumentationKey": "[reference(resourceId('Microsoft.Insights/components', parameters('appInsightsName')), '2015-05-01').InstrumentationKey]"
}
}
"dependsOn": [
"[resourceId('microsoft.insights/components', parameters('appInsightsName'))]"
]
}
also tried depending on both the APIM and app insights
"dependsOn": [
//"[resourceId('Microsoft.ApiManagement/service', variables('apiManagementInstanceName'))]"
"[resourceId('microsoft.insights/components', parameters('appInsightsName'))]"
],
You can use linked templates to reference another template file and define dependencies on it: https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/linked-templates#linked-template

Why every time I try to enter my publisher name my npm says I need to view user permissions on it?

The present reason I'm asking this question is that my npm CLI server in the Command Prompt doesn't let me register my theme to the Visual Studio Code Marketplace. I did as the VS Code website's tutorial on how to publish an extension read. However, when I typed my Personal Access Token in the cmd as it was shown to me, this is what I get:
>vsce login 'my publisher name'
#Error: Access Denied: 'Username' needs the following permission(s) on
#the resource /publisher name to perform this action: View user permissions
#on a resource
I tried several times, and even gave it full access to all accessible organizations in my Azure DevOps. And for your information, my computer runs on Windows 8.1.
This is the package.json file I tried to register:
{
"name": "blacklady-code-workspace",
"displayName": "Black Lady Theme",
"description": "Modeled after the Black Lady from Sailor Moon R.",
"version": "0.0.1",
"publisher": "ayaimarion",
"repository": {
"url": "https://github.com/ZanJang/blacklady-theme-ver-0.0.1"
},
"engines": {
"vscode": "^1.30.0"
},
"categories": [
"Themes"
],
"contributes": {
"themes": [
{
"label": "Black Lady",
"uiTheme": "vs-dark",
"path": "./themes/Black Lady-color-theme.json"
}
]
}
}
If there's something I did do wrong, let me know.
My Azure DevOps organization: https://dev.azure.com/ayamaki
I had the same issue. I had not yet created the publisher in the Marketplace.
Once I created the new publisher, the vsce login command succeeded.

vscode Fail to Debug Express Webapp

I'm trying to debug express (node) app on my machine, but debug does not start with no indication what so ever.
This happens on code I'm able to debug on another machine as well as "new" apps created in order to test this issue.
I followed the instructions on vscode site (https://code.visualstudio.com/docs/nodejs/nodejs-debugging) with no success.
Runtime works great - just fail to debug.
Behavior consist on all machine's users (admin/non-admin)
Does anyone have a clue?
My environment setup is:
operating System: Windows 10 Pro version 1803
node version: v10.13.0
vscode version: 1.28.2
This is vscode's trace (note the target not opened warning):
OS: win32 x64
Adapter node: v8.9.3 x64
vscode-chrome-debug-core: 6.7.19
11:20:18 AM, 11/7/2018
node-debug2: 1.28.3
From client: initialize({"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"node2","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en-us"})
To client: {"seq":0,"type":"response","request_seq":1,"command":"initialize","success":true,"body":{"exceptionBreakpointFilters":[{"label":"All Exceptions","filter":"all","default":false},{"label":"Uncaught Exceptions","filter":"uncaught","default":false}],"supportsConfigurationDoneRequest":true,"supportsSetVariable":true,"supportsConditionalBreakpoints":true,"supportsCompletionsRequest":true,"supportsHitConditionalBreakpoints":true,"supportsRestartFrame":true,"supportsExceptionInfoRequest":true,"supportsDelayedStackTraceLoading":true,"supportsValueFormattingOptions":true,"supportsEvaluateForHovers":true,"supportsLoadedSourcesRequest":true,"supportsLogPoints":true,"supportsTerminateRequest":false}}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"ClientRequest/initialize","data":{"Versions.DebugAdapterCore":"6.7.19","Versions.DebugAdapter":"1.28.3","successful":"true","timeTakenInMilliseconds":"3.774888","requestType":"request"}}}
From client: attach({"type":"node2","request":"attach","name":"Attach by Process ID","trace":true,"cwd":"c:\\Users\\roi\\dev\\janus\\src\\tools\\magento2-importer","port":9229,"protocol":"inspector","logFilePath":"c:\\Users\\roi\\AppData\\Roaming\\Code\\logs\\20181107T103352\\exthost1\\ms-vscode.node-debug\\debugadapter.txt","__sessionId":"910bc34a-3629-46b7-8c57-e89c06f5bda0"})
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"debugStarted","data":{"Versions.DebugAdapterCore":"6.7.19","Versions.DebugAdapter":"1.28.3","request":"attach","args":["type","request","name","trace","cwd","port","protocol","logFilePath","__sessionId","enableSourceMapCaching","sourceMapPathOverrides","showAsyncStacks","sourceMaps"]}}}
Getting browser and debug protocol version via http://127.0.0.1:9229/json/version
Discovering targets via http://127.0.0.1:9229/json/list
Got browser version: node.js/v10.13.0
Got debug protocol version: 1.1
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"targetDebugProtocolVersion","data":{"Versions.DebugAdapterCore":"6.7.19","Versions.DebugAdapter":"1.28.3"}}}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"targetCount","data":{"Versions.DebugAdapterCore":"6.7.19","Versions.DebugAdapter":"1.28.3","numTargets":1}}}
Attaching to target: {"description":"node.js instance","devtoolsFrontendUrl":"chrome-devtools://devtools/bundled/js_app.html?experiments=true&v8only=true&ws=localhost/a575db9e-d5a5-46a5-a49c-a553228c7493","devtoolsFrontendUrlCompat":"chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=localhost/a575db9e-d5a5-46a5-a49c-a553228c7493","faviconUrl":"https://nodejs.org/static/favicon.ico","id":"a575db9e-d5a5-46a5-a49c-a553228c7493","title":"dist/server.js","type":"node","url":"file://C:_Users_roi_dev_janus_src_tools_magento2-importer_dist_server.js","webSocketDebuggerUrl":"ws://127.0.0.1:9229/a575db9e-d5a5-46a5-a49c-a553228c7493","version":{}}
WebSocket Url: ws://127.0.0.1:9229/a575db9e-d5a5-46a5-a49c-a553228c7493
→ To target: "{\"id\":1,\"method\":\"Console.enable\"}"
→ To target: "{\"id\":2,\"method\":\"Debugger.enable\"}"
→ To target: "{\"id\":3,\"method\":\"Runtime.enable\"}"
→ To target: "{\"id\":4,\"method\":\"Log.enable\"}"
→ To target: "{\"id\":5,\"method\":\"Runtime.runIfWaitingForDebugger\"}"
→ Warning: Target not open! Message: "{\"id\":6,\"method\":\"Runtime.run\"}"
Websocket closed
Terminated: websocket closed
Waiting for any pending steps or log messages.
Current step and log messages complete
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"debugStopped","data":{"Versions.DebugAdapterCore":"6.7.19","Versions.DebugAdapter":"1.28.3","reason":"websocket closed"}}}
To client: {"seq":0,"type":"event","event":"terminated"}
From client: disconnect({"restart":false})
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"FullSessionStatistics/SourceMaps/Overrides","data":{"Versions.DebugAdapterCore":"6.7.19","Versions.DebugAdapter":"1.28.3","aspNetClientAppFallbackCount":0}}}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"report-start-up-timings","data":{"Versions.DebugAdapterCore":"6.7.19","Versions.DebugAdapter":"1.28.3","RequestedContentWasDetected":"false","Steps":"[\"BeforeFirstStep\",\"ClientRequest/initialize\",\"ClientRequest/attach\",\"Attach\",\"Attach.RequestDebuggerTargetsInformation\",\"Attach.ProcessDebuggerTargetsInformation\",\"Attach.AttachToTargetDebuggerWebsocket\",\"Attach.ConfigureDebuggingSession.Internal\",\"Attach.ConfigureDebuggingSession.Target\"]","All":"380.614371","BeforeFirstStep":"[18.487202]","WaitingAfter.ClientRequest/initialize":"[22.151169]","ClientRequest/initialize":"[4.841868]","ClientRequest/attach":"[4.11239]","Attach":"[8.248859]","Attach.RequestDebuggerTargetsInformation":"[12.433092]","Attach.ProcessDebuggerTargetsInformation":"[0.720004]","Attach.AttachToTargetDebuggerWebsocket":"[317.133643]","Attach.ConfigureDebuggingSession.Internal":"[0.81632]","Attach.ConfigureDebuggingSession.Target":"[13.309018]","RequestedContentWasNotDetectedReason":"shutdown"}}}
Terminated: Got disconnect request
To client: {"seq":0,"type":"response","request_seq":3,"command":"disconnect","success":true}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"ClientRequest/disconnect","data":{"Versions.DebugAdapterCore":"6.7.19","Versions.DebugAdapter":"1.28.3","successful":"true","timeTakenInMilliseconds":"2.443434","requestType":"request"}}}
This is snippet of vscode screen after debuger was attached. as you can see debugger was attached, but no debug tool bar is present (and no breaks on breakpoints):
You can try to add launch.json by go to Debug->Add Configuration
And then choose Node.js Attach To Process
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach by Process ID",
"processId": "${command:PickProcess}"
},
{
"name": "Attach",
"type": "node",
"request": "attach",
"port": Your Port,
"address": "localhost",
"restart": false,
"sourceMaps": false,
"outDir": null,
"localRoot": "${workspaceRoot}",
"remoteRoot": null
}
]
}
Then run you server as usual, for example
> nodemon app.js
Set breakpoints
And hit Start Debugging
The debugger should kick in and you should smile :)

Unable to connect to a site from Testcafe IDE on OSX

My fixtures are set up like so
{
"fixtures": [
{
"name": "login",
"pageUrl": "http:\/\/localhost:3000\/",
"tests": [
{
"name": "type name",
"commands": [
{
"type": "type-text",
"studio": {
},
"callsite": "0",
"selector": {
"type": "js-expr",
"value": "input[type=email]"
},
"options": {
},
"text": "example#email.com"
}
]
}
]
}
]
}
with one simple test to find the input and type some text but when running the command I get
testcafe chrome login.testcafe
ERROR Unable to establish one or more of the specified browser connections. This can be caused by network issues or remote device failure.
Type "testcafe -h" for help.
I've seen this issue a couple of times on their issues board one relating to CI integration on a Linux server and another which seems like a similar issue of trying to connect to localhost
https://github.com/DevExpress/testcafe-browser-provider-electron/issues/20
https://github.com/DevExpress/testcafe/issues/1133
New to testcafe any help would be appreciated!
I've found the solution some network policies don't allow access to your machine on some ports in my example it's 57501.
testcafe chrome login.testcafe --hostname localhost
adding --hostname resolves the issue
documentation
https://devexpress.github.io/testcafe/documentation/using-testcafe/command-line-interface.html#--hostname-name
I still don't know how to launch from the IDE but this resolves my main issue.
TestCafe Studio Preview does not support setting command line options (hostname in your case). The TestCafe team is going to implement this functionality in the official release.
So, for now, it is only possible to run tests via a command line.
UPDATE:
You can set the hostname option in the TestCafe Studio Settings dialog:

Application Installer abnormal process termination. Process exit value was 1

at the time of running titanium application i am getting error, i have tried all the solutions suggested by google, but problem still remains, please help if anyone can understand the error log i pasted below. Thanks.
Appcelerator Command-Line Interface, version 4.1.2
Copyright (c) 2014-2015, Appcelerator, Inc. All Rights Reserved.
TRACE | __command__ search paths:
[
"C:\\Users\\acer\\.appcelerator\\install\\4.1.2\\package",
"C:\\Users\\acer\\.appcelerator\\install\\4.1.2\\package\\node_modules",
"C:\\Users\\acer\\Desktop\\node_modules",
"C:\\Users\\acer\\node_modules",
"C:\\Users\\node_modules",
"C:\\node_modules",
"C:\\Users\\acer\\.appcelerator\\.npm\\lib\\node_modules"
]
DEBUG | [PLUGIN-LOAD] 0ms C:\Users\acer\.appcelerator\install\4.1.2\package\appc.js
DEBUG | [PLUGIN-LOAD] 623ms C:\Users\acer\.appcelerator\install\4.1.2\package\node_modules\appc-cli-titanium\appc.js
DEBUG | [PLUGIN-LOAD] 2ms C:\Users\acer\.appcelerator\install\4.1.2\package\node_modules\arrow\appc.js
log level set to "trace"
executing command "run"
set environment to {"registry":"https://software.appcelerator.com","security":"https://security.appcelerator.com","baseurl":"https://platform.appcelerator.com"}
checking credentials for existing session
Attempting to load session info from config file
check if session is invalidated
session expiry 1439531789135 false
+---------------------------------------------------------------------------------------+
+ This is a Developer trial account. You may use this software for evaluation purposes. +
+ Once you are ready to go to production, upgrade at https://billing.appcelerator.com +
+---------------------------------------------------------------------------------------+
Arrow Cloud config file: C:\Users\acer\.acs
found Arrow Cloud login { mid: 'dfa5b79881cc650462ff93ae5df5f65d5760e1cd',
publishPort: 443,
publishHost: 'https://admin.cloudapp-enterprise.appcelerator.com',
username: 'mymail',
cookie: [ 'connect.sid=s%3Ab9eP%2F3NylwuSkAqEtFC3La1k.RDNuz84uHznd9QjZUQ9Rm6UxHfan0GZcGKug2GtaQjg; Path=/; Expires=Fri, 14 Aug 2015 05:56:35 GMT; HttpOnly' ],
defaultEP:
{ publishHost: 'https://admin.cloudapp-enterprise.appcelerator.com',
publishPort: 443 } } , checking nodeACSEndpoint= https://admin.cloudapp-enterprise.appcelerator.com
Arrow Cloud cookie expiry [ 1439531795000 ]
session already loaded in opts.session
getCredentials() session:
{
"ipaddress": "192.168.1.13",
"username": "mymail",
"password": "<OMITTED>",
"session": "<OMITTED>",
"nonce": "<OMITTED>",
"environment": {
"name": "production",
"isProduction": true,
"acsBaseUrl": "https://api.cloud.appcelerator.com",
"acsAuthBaseUrl": "https://secure-identity.cloud.appcelerator.com",
"nodeACSEndpoint": "https://admin.cloudapp-enterprise.appcelerator.com"
},
"token": "<OMITTED>",
"fingerprint": "dfa5b79881cc650462ff93ae5df5f65d5760e1cd",
"fingerprint_description": "Windows Machine ID: bcd68e35-cc53-4567-ab68-66246b73cc67",
"org_id": 100057656,
"expiry": 1439531789135
}
loading plugins for command "run"
run search paths:
[
"C:\\Users\\acer\\.appcelerator\\install\\4.1.2\\package",
"C:\\Users\\acer\\.appcelerator\\install\\4.1.2\\package\\node_modules",
"C:\\Users\\acer\\Desktop\\node_modules",
"C:\\Users\\acer\\node_modules",
"C:\\Users\\node_modules",
"C:\\node_modules",
"C:\\Users\\acer\\.appcelerator\\.npm\\lib\\node_modules"
]
[PLUGIN-LOAD] 0ms C:\Users\acer\.appcelerator\install\4.1.2\package\appc.js
[PLUGIN-LOAD] 251ms C:\Users\acer\.appcelerator\install\4.1.2\package\node_modules\appc-cli-titanium\appc.js
run plugin: C:\Users\acer\.appcelerator\install\4.1.2\package\node_modules\appc-cli-titanium
[PLUGIN-LOAD] 0ms C:\Users\acer\.appcelerator\install\4.1.2\package\node_modules\arrow\appc.js
run plugin: C:\Users\acer\.appcelerator\install\4.1.2\package\node_modules\arrow
plugin "arrow" failed its "when" function check, skipping...
loading plugin "titanium" for command "run" CLI options via function
loading plugin "titanium" for command "run" CLI options via array
Duplicate option "colors" for command "run", removing...
executing command "run" with the following plugins:
["titanium"]
TRACE | Attempting to load session info from config file
TRACE | check if session is invalidated
TRACE | session expiry 1439531789135 false
TRACE | session already loaded in opts.session
DEBUG | Titanium Downloads Last Checked: 1439447168501
TRACE | "C:\Program Files\nodejs\node.exe" "C:\Users\acer\.appcelerator\install\4.1.2\package\node_modules\appc-cli-titanium\node_modules\titanium\bin\titanium" config -o json-object
TRACE | "C:\Program Files\nodejs\node.exe" "C:\Users\acer\.appcelerator\install\4.1.2\package\node_modules\appc-cli-titanium\node_modules\titanium\bin\titanium" sdk -o json
TRACE | checking for titanium, result:
{ activeSDK: '4.1.0.GA',
defaultInstallLocation: 'C:\\ProgramData\\Titanium',
installLocations:
[ 'C:\\ProgramData\\Titanium',
'C:\\Users\\acer\\AppData\\Roaming\\Titanium',
'C:\\ProgramData\\Application Data\\Titanium' ],
installed: { '4.1.0.GA': 'C:\\ProgramData\\Titanium\\mobilesdk\\win32\\4.1.0.GA' } }
TRACE | C:\Program Files\nodejs\node.exe [ 'C:\\Users\\acer\\.appcelerator\\install\\4.1.2\\package\\node_modules\\appc-cli-titanium\\node_modules\\titanium\\bin\\titanium',
'build',
'--platform',
'android',
'--log-level',
'trace',
'--sdk',
'4.1.0.GA',
'--project-dir',
'D:\\Titanium WS\\ex',
'--target',
'emulator',
'--android-sdk',
'C:\\android-sdk-win',
'--device-id',
'Appp',
'--skip-js-minify',
'--no-colors',
'--no-progress-bars',
'--no-prompt',
'--prompt-type',
'socket-bundle',
'--prompt-port',
'62727',
'--plugin-paths',
'C:\\Users\\acer\\.appcelerator\\install\\4.1.2\\package\\node_modules',
'--config-file',
'C:\\Users\\acer\\AppData\\Local\\Temp\\build-1439448105417.json',
'--no-banner' ]
[WARN] :
TRACE | titanium exited with exit code 1
[ERROR] Application Installer abnormal process termination. Process exit value was 1
After 24 hours i get my project installing on my device. i am unable to get the exact problem but i want to share my tried steps to solve the problem.
I installed all sdk's one by one.
I switched my current work space and created new one. (old work space still gives error)
Now my project is installing fine, every time.
Thanks.