I am using IBM Worklight Developer Edition 5.0.5 to try to create simple(HTML and Adapter) application, but facing unresolved problem.
This could be a same problem which is not answered in old forum: http://www.ibm.com/developerworks/forums/thread.jspa?threadID=460738
[Environment] OS: Windows7 64bit(Japanese locale), Eclipse: 4.2.1, Worklight: Developer Edition 5.0.5
[Description] I created Worklight Project in my Eclipse, without any external libraries like jQuery mobile nor Dojo. I added HTTP Adapters and SQL Adapters into this Project. Both seems to work fine when I try 'Run As .. -> Invoke Worklight Procedure'. Both returned expected JSON. So I don't think there would be a problem in Adapters.
But when I call those adapters from HTML file, I got "Uncaught TypeError: Cannot use 'in' operator to search for 'SUPPORT_COOKIES' in null" error in worklight.js(line:2380).
[My code]
var invocationData = { adapter : 'SQLAdapter', procedure : 'getCount', parameters : [] };
WL.Logger.debug( "1: invocationData = " + invocationData );
WL.Client.invokeProcedure( invocationData, { onSuccess: loadFeedsSuccess, onFailure: loadFeedsFailure });WL.Logger.debug( "2: loadFeeds" );
function loadFeedsSuccess( result ){ WL.Logger.debug( "3: success: result = " + result ); }
function loadFeedsFailure( result ){ WL.Logger.debug( "4: failure: result = " + result ); }
[My debug console output]
1: invocationData = [object Object] worklight.js:1112
Uncaught TypeError: Cannot use 'in' operator to search for 'SUPPORT_COOKIES' in null worklight.js:2380
wlclient init started worklight.js:1112
before: app init onSuccess worklight.js:1112
after: app init onSuccess worklight.js:1112
wlclient init success
So it seems only first WL.Logger.debug() is called successfully, but WL.Client.invokeProcedure() seems to cause above Uncaught TypeError, and it just failed(not call success-case callback, nor failure-case callback).
This is a SQL Adapter case, but when I tryed to use HTTP Adapter, the result was same(failed in WL.Client.invokeProcedure()). Again, both returns appropriate result when I try 'Run As .. -> Invoke Worklight Procedure'.
My console says this failure happens in line 2380 of worklight.js:
2379: isEnabled : function(field) {
2380: return !!(field in profile && profile[field]);
2381: }
So I have no idea what would be wrong with my code. Are there any idea/information for this problem? Thanks for advance.
Added Same error was happened in Mac OSX environment too.