TypeError: WLJSX.Ajax.WLRequest.setConnected is not a function - ibm-mobilefirst

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.

Related

Warning: getOperatorList - ignoring errors during "GetOperatorList: page 0" task: "r: Cannot read properties of undefined (reading 'X')"

In relation to this post:
After upgrading from revit 21 to 22 in my company, we can no longer view anything else than the default 3D model in our forge viewer. Initially, i thought the issue arose due to this warning:
"Deprecated API usage: No "GlobalWorkerOptions.workerSrc" specified.".
However, i got that same message in the console of a working implementation i made today, leading me to believe that it has nothing to do with this warning at all.
However, i also see another warning:
"Warning: getOperatorList - ignoring errors during "GetOperatorList: page 0" task: "r: Cannot read properties of undefined (reading 'X')"."
I have tried creating a new nuxt app on Node version 14.9.0, implemented a forge viewer in accordance with the official v7 documentation, and the bug is no longer present.
I then tried to mimic that in my actual production app where the problem exists, by running it on Node version 14.9.0 instead of 10.0.0, getting rid of my entire forge implementation and implemented a simple viewer like above. That did not solve the problem, and i still see above warnings in the console.
The warning is thrown in pdf.worker.jss, which is loaded in via "webpack://adsk/node_modules/#adsk/pdfjs-dist/legacy/build/pdf.worker.jss".
I hope someone has a suggestion.

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.

Titanium build error

Just trying to run a test app created in titanium and getting following errors:
/usr/lib/node_modules/titanium/node_modules/longjohn/dist/longjohn.js:185
throw e;
^
TypeError: Cannot read property '0' of undefined
at exports.validate (/home/inscripts/.titanium/mobilesdk/linux/3.1.3.GA/android/cli/commands/_build.js:296:70)
at exports.validatePlatformOptions (/home/inscripts/.titanium/mobilesdk/linux/3.1.3.GA/node_modules/titanium-sdk/lib/titanium.js:443:51)
at exports.validate (/home/inscripts/.titanium/mobilesdk/linux/3.1.3.GA/cli/commands/build.js:112:9)
at callCommandValidate (/usr/lib/node_modules/titanium/lib/cli.js:846:19)
at /usr/lib/node_modules/titanium/node_modules/async/lib/async.js:551:21
at /usr/lib/node_modules/titanium/node_modules/async/lib/async.js:227:13
at iterate (/usr/lib/node_modules/titanium/node_modules/async/lib/async.js:134:13)
at /usr/lib/node_modules/titanium/node_modules/async/lib/async.js:145:25
at /usr/lib/node_modules/titanium/node_modules/async/lib/async.js:229:17
at /usr/lib/node_modules/titanium/node_modules/async/lib/async.js:556:34
---------------------------------------------
at exports.execFile (child_process.js:701:9)
at exports.exec (child_process.js:588:18)
at async.series.cached (/home/inscripts/.titanium/mobilesdk/linux/3.1.3.GA/node_modules/node-appc/lib/android.js:86:4)
at /home/inscripts/.titanium/mobilesdk/linux/3.1.3.GA/node_modules/async/lib/async.js:486:21
at /home/inscripts/.titanium/mobilesdk/linux/3.1.3.GA/node_modules/async/lib/async.js:185:13
at iterate (/home/inscripts/.titanium/mobilesdk/linux/3.1.3.GA/node_modules/async/lib/async.js:108:13)
at /home/inscripts/.titanium/mobilesdk/linux/3.1.3.GA/node_modules/async/lib/async.js:119:25
at /home/inscripts/.titanium/mobilesdk/linux/3.1.3.GA/node_modules/async/lib/async.js:187:17
[ERROR] Application Installer abnormal process termination. Process exit value was 8
Need some help.
You are using Titanium SDK 3.1.3.GA which does not support Android SDK Tools 22.6, nor does it support 64-bit Java. You should update Titanium SDK to newest version.
I was facing the same problem.
and i tried following solution and that did work.
try to update Node.js to the latest version and that should work.
older version of Node.js was generating this error on my machine. when i updated it to a newer version it worked for me.
for reference you can refer following link
https://developer.appcelerator.com/question/150324/error-in-longjohnjs-when-creating-titanium-project
have look into this, may it'll help you.

Browser Console full of errors in IceFaces 3.3.0

As the title says, my browser console is really full of errors some of which are as follows:
Error: ReferenceError: css_ims is not defined
Error: TypeError: br.log is undefined
Error: TypeError: window.ice.onLoad is not a function
Error: TypeError: ice.captureSubmit is not a function
Error: TypeError: ice.setupBridge is not a function
Error: TypeError: ice.push is undefined
Error: TypeError: ice.captureSubmit is not a function
Error: TypeError: ice.onBeforeSubmit is not a function
And guys let me also tell you about the Icefaces version I used:
1. icefaces-3.3.0.jar
2. icefaces-ace-3.3.0.jar
3. icefaces-compat-3.3.0.jar
4. icefaces-mobi-1.2.0.jar
5. icepush-3.3.0.jar
Prior to the use of these 3.3.0 versions and icefaces-mobi-1.2.0.jar I was using 3.0.1 versions and no use of icefaces-mobi-1.2.0.jar in which the browser console was having none of the above mentioned errors. So I was thinking this might be the compatibility issue.
(Note:Here the icefaces mobi jar is used for Mobile related things.)
Thanks in advance. Any help would greatly be appreciated! :)
I'm not sure if adding ICEmobile is causing these JavaScript errors, but ICEmobile 1.2.0 is designed to be used with ICEfaces 3.2.0. For ICEfaces 3.3.0 you should use ICEmobile 1.3.0. Also be sure to clear your browser cache before retrying.
Those errors occurs because all/some icefaces javascript files are not downloaded to the client.
I faced this problem: I investigated this issue using firebug(firefox plug-in) and I found that all resources URL which includes (javax.faces.resource) are giving 302 response error which means that the request is redirected.
I double check and found that I have (javax.servlet.Filter) called AuthenticationFilter which filters all the requests, and if the user doesn't login all requests are redirected to the login page.
To solve this issue: in AuthenticationFilter.doFilter(ServletRequest request, ServletResponse response,FilterChain chain)
I added the if statement:
if (path.contains("javax.faces.resource") || path.contains("/css") || path.contains("/images") || path.contains("/js")) {
chain.doFilter(request, response); // Just continue chain.
return;
}

Worklight core-web-layer.js errors

Can someone help me?
When I run my Worklight project on Chrome, Firefox or Opera I don't get any errors.
But when I run it on IE I get these errors:
Error: multipleDefine
Error: multipleDefine
Error: multipleDefine
Error: multipleDefine
SCRIPT5002: Function expected
core-web-layer.js, line 311 character 160
SCRIPT438: Object doesn't support property or method '_eventHandler'
core-web-layer.js, line 165 character 71
When I run it on Android, the Dojo functionality also doesn't work and I get this error:
07-09 13:12:37.817: D/CordovaLog(7180): Error: scriptError
07-09 13:12:37.817: E/Web Console(7180): Error: scriptError at file:///data/data/com.Klappr/files/www/default/dojo/dojo.js:21
Is your core-web-layer.js the one that was created during project creation?
For your issue with running on Android, if you're using Worklight 6.0 with a new project, copy the following files from the Dojo Library project that was created alongside the Worklight project:
toolkit/dojo/dojo/nls/core-web-layer_ROOT.js
toolkit/dojo/dojo/nls/mobile-ui-layer_ROOT.js
These files then must be added to your Worklight project's www/dojo/nls/ directory.
In addition to including the *_ROOT.js files, you may also need to remove the development configuration from the application. To do this, open the Console view (Window > Show View > Other... > Console). From the Console view, click the Open Console button and choose Dojo Library Requests from the list. From the Dojo Library Requests console, click the View Menu (the triangle in the toolbar), and uncheck Provide Library Resources. After this, build and deploy your application to your emulator or device.