IBM Worklight 6.1 Uncaught TypeError: Cannot read property 'directUpdate' of undefined - ibm-mobilefirst

I'm using Worklight 6.1
I have developed an Android application with
connectOnStartup : true
and
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="16" />
When I try to execute the application on the device (4.1.2), when it starts I get the exception in log cat:
Uncaught TypeError: Cannot read property 'directUpdate' of undefined
The application is a mix between the modules "Adapter-based authentication" and "Integrating server-generated pages in hybrid applications". Downloaded from http://www.ibm.com/developerworks/mobile/worklight/getting-started.html
If I do not set the set connectOnStartup to false it works.
Any idea?

You point me to the error, I thought there was nothing being executed before Direct Update but the java script code included in the main HTML page is executed before.
Then I realized that I didn't include the javascript file where the security challenge handler was implemented. Thas was the issue.
I have included the
<script src="js/SingleStepAuthRealmChallengeProcessor.js"></script>
in the .html and now it is working.
Thank you Idan.

Related

How can I fix "Cannot read property 'srcObject' of undefined" in Freeswitch Verto

I'm trying to get verto to work on in Chrome 57.0.2987.133 (64-bit).
After following https://dopensource.com/2017/01/21/setting-up-freeswitch-webrtc-functionality/, I was able to get webrtc/verto working on the server. I was able to get the demo app (in the verto repo) to connect and make calls.
I followed http://evoluxbr.github.io/verto-docs/tut/making-a-call.html to setup verto on my end, but I get (Uncaught TypeError: Cannot read property 'srcObject' of undefined and Uncaught TypeError: Cannot read property 'sinkId' of undefined) in chrome console. See below:
Uncaught TypeError: Cannot read property 'srcObject' of undefined
at FSRTCattachMediaStream (jquery.FSRTC.js:236)
at onRemoteStream (jquery.FSRTC.js:255)
at Object.self.peer.FSRTCPeerConnection.onRemoteStream (jquery.FSRTC.js:593)
at RTCPeerConnection.FSRTCPeerConnection.peer.onaddstream (jquery.FSRTC.js:737)
Uncaught TypeError: Cannot read property 'sinkId' of undefined
at $.verto.dialog.setAudioPlaybackDevice (jquery.verto.js:2144)
at jquery.verto.js:2214
https://pastebin.com/j4GrER0Q.
My script imports look like https://pastebin.com/H55piU1r.
Assistance will be greatly appreciated
So, I figured this out eventually. The verto codebase has changed since http://evoluxbr.github.io/verto-docs/ was put up.
I had cloned the latest (48 hrs old) FS repo to get the verto js libs.
Turns out I had to do these additional things;
Include the vendor/adapter-latest.js just before the verto libs in your index.html (or whatever it's called)
In the new verto config, add tag: "<whatever>",
Insert <video id="<whatever>"></video> in your index.html. You can add a display: none; to hide the video - if all you need is audio.
That solved it.
Update: If all you need is audio, then just use the <audio> tag.

error on hosting sencha touch app in googledrive

when am trying to host my app in googledrive getting an error
just splash screen and continue on blinking with loader
try this link
https://51da17b21e519f2a1eb8d97ae6f8...1nVm8wZWJXNlk/
Failed to load resource: net::ERR_NAME_NOT_RESOLVED
bootstrap.js:11 Uncaught TypeError: Cannot read property 'addClassPathMappings' of undefined
app.js:13 Uncaught TypeError: Ext.application is not a function
I had this error too, after using sencha CMD - upgrade command.
I was missing the 'touch' folder in my aplication root.
copy-ing the touch folder from another project in my current project solved this.

Building native application with MobileFirst

We are using MobileFirst 6.3 and we are almost finished, but building the native iOS application by adding the environment isn't that easy for us it seems. After creating the environment we tried to run the code, but we are left with a blank screen, which is scrollable, and an error:
Error in success callback: DeviceAuth1101721282 = TypeError: undefined is not an object (evaluating 'window.cordova.plugins.Keyboard')
It appears the Keyboard plugin is not available and the rest of the application won't load any further. Things I tried is adding the plugin found on Github (https://github.com/apache/cordova-plugins/tree/master/keyboard) to the iphone/native/CordovaLib/plugin directory and adding the following code to the iphone/native/config.xml file:
<feature name="Keyboard">
<param name="ios-package" value="CDVKeyboard" />
</feature>
This doesn’t fix the problem. In the documentation how to add native functionality to the application (https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-6-3/adding-native-functionality/ios-adding-native-functionality-hybrid-application-apache-cordova-plugin/), the next step was to create a function, but I don’t have a function to call at the plugin so I created a temporary function according to the tutorial which only outputs to the console with NSLog. In the log I get the message following by the same error as before.
Is there anything I missed?
In one of the tutorials to build MobileFirst applications in combination with Ionic Framework, there was an if-statement which gave the error. The if-statement was:
if (window.cordova && window.cordova.plugins.keyboard) { ... }
While the fix was:
if (window.cordova && window.cordova.plugins && window.cordova.plugins.keyboard) { ... }
Now we have found the fix after 2 days, it seems quite obvious, but this line was somewhat hidden in the project and searching for keyboard gave lots of results.

Installation failure of Impresspages on Two Servers

I have tried installing Impresspages on my local xampp server, and was successful, but have JS errors and am unable to edit any content on front end. I get the below error in my inspector.
Uncaught TypeError: Cannot read property 'mouse' of undefined localhost/Ip/Internal/Content/assets/management.min.js?1:71
Does anyone know what is causing this?
I then tried to install it on my Cloudserver which runs WHM/Cpanel. I was not able to install at all.. I get the below error:
[03-Jul-2014 19:25:50 UTC] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20100525/php_openssl.dll' - /usr/local/lib/php/extensions/no-debug-non-zts-20100525/php_openssl.dll: cannot open shared object file: No such file or directory in Unknown on line 0
What is causing this? How can I fix?
Thanks in advance!!
Michael
http://www.digitalworkhorse.com/
First issue shouldn't make any problems with content management. Refresh page, clear browser cache. Content management should work.
The second has nothing to do with ImpressPages. It's your servers problem with PHP installation.

TypeError: WLJSX.Ajax.WLRequest.setConnected is not a function

i have upgraded my worklight with 5.0.5 to 5.0.6 .when i have worked on 5.0.5 it worked fine but the same code when i am using in updated version worklight 5.0.6 it gives me this error
TypeError: WLJSX.Ajax.WLRequest.setConnected is not a function
WLJSX.Ajax.WLRequest.setConnected(false);
when i have build for the first time after upgrading to worklight 5.0.6 it gave this in the console
FWLST1061W: RMLight.java has changed, onCreate() was renamed to onWLCreate(), please check your code for changes. Refer to the IBM Worklight Information Center for details.
can some one help please
am also getting this error
ReferenceError: wlInitOptions is not defined
[Break On This Error]
if (!isIOSEnv() && wlInitOptions.connectOnStartup) {
As the error message states: wlInitOptions is not defined. Could this indee be case? Please see this Stackoverflow question.
Look inside your application's js folder (yourProject\apps\yourApp\common\js). Make sure it contains an initOptions.js
Make sure this file is also referenced in the HTML.