I have a Worklight application with an HTTP adapter that connects to another application to retrieve data for display on a mobile device (testing on Android 4.0.4 at the moment).
When the application starts, I call three procedures from my HTTP adapter and output the results from all three procedures.
When I run my application in a browser and view it as Common, everything works fine.
The problem occurs when I run the application on a real phone. In most cases, 1 or 2 of my procedures fail and the data is not displayed, but it seems that one of them (the first) always works. In rare cases, all three procedure calls will retrieve data, but I cannot play this script sequentially.
When the procedure fails, I get an error in the Worklight Development Server console:
[ERROR ] FWLSE4007E: Received bad token from client. Server token:'null', client token:'b3fuqgdid2701hu855n89pldpk'. [project trunk]
Sometimes I get this error instead, but this is much less common:
[ERROR ] FWLSE0203E: Received bad instance Id from client. Server instance Id:'3f9eveddc7br5mq3ll0nq89miu', client instance Id:'ut5m5f01i3bkq5l78m54uq137o'. [project trunk]
An application always tries to execute WL.Client.invokeProcedure all procedures, and when the call is successful, my onSuccess function is executed, but when other procedures cannot load their data, the onFailure function never arises.
My adapter looks like this:
<displayName> Adapter </displayName>
<description> Adapter </description>
<connectivity>
<connectionPolicy xsi: type = "http: HTTPConnectionPolicyType">
<protocol> http </protocol>
<domain> 10.50.22.161 </domain>
<port> 9000 </port>
</connectionPolicy>
<loadConstraints maxConcurrentConnectionsPerNode = "5" />
</connectivity>
<procedure name = "getProcesses" securityTest = "securityTest" />
<procedure name = "getTasks" securityTest = "securityTest" />
<procedure name = "metricsList" securityTest = "securityTest" />
<procedure name = "getMetric" securityTest = "securityTest" />
<procedure name = "getAllHashTags" securityTest = "securityTest" />
<procedure name = "getMessages" securityTest = "securityTest" />
<procedure name = "getMentions" securityTest = "securityTest" />
<procedure name = "getConversations" securityTest = "securityTest" />
<procedure name = "getServerTime" securityTest = "securityTest" />
When I remove security tests from procedures, the error appears to occur less frequently, but still occurs.
What is the problem? Or how can I debug a Worklight server to determine the cause?
I am using the Eclipse Worklight plugin with version 6.0.0.20130701-1413.