Good afternoon everybody,
I am experiencing an error on deploying a mobile app to Windows Phone 8.
It is a Worklight 6.1.0.1 hybrid application deployed to windows8phone, android and iphone.
It is an application written with Angularjs.
Build and deploy to WL server is ok, deploy of all adapters is ok. The application runs correctly on iphone and android (devices). By using WL simulator, the app works correctly with windows 8 phones (we are testing a Nokia Lumia 820 device).
Then, I open the visual studio project (vs express 2013), contained into native folder of the windowsphone8 environment, and try to run on official MS emulator and directly on the device.
After the app starts on the device, I get an error in the WL Server console:
[ERROR ] FWLSE0059E: Login into realm 'WLDeviceNoProvisioningLoginModule' failed. The field "deviceId" of instance "null" contained a null value; the metadata for this field specifies that nulls are illegal.. [project MobileBanking] The field "deviceId" of instance "null" contained a null value; the metadata for this field specifies that nulls are illegal.; nested exception is org.apache.openjpa.persistence.InvalidStateException: The field "deviceId" of instance "null" contained a null value; the metadata for this field specifies that nulls are illegal. [ERROR ] FWLSE0117E: Error code: 4, error description: AUTHENTICATION_ERROR, error message: An error occurred while performing authentication using loginModule WLDeviceNoProvisioningLoginModule, User Identity Not available. [project MobileBanking] [project MobileBanking]
Further info- Authentication. I have one realm and one security test:
<realms>
<realm loginModule="AuthLoginModule" name="WSAuthRealm">
<className>com.worklight.integration.auth.AdapterAuthenticator</className>
<parameter name="login-function" value="AuthAdapter.onAuthRequired" />
<parameter name="logout-function" value="AuthAdapter.onLogout" />
</realm>
</realms>
<securityTests>
<customSecurityTest name="AuthAdapter-securityTest">
<test isInternalUserID="true" realm="WSAuthRealm" />
</customSecurityTest>
</securityTests>
We have also tried the following possible solutions:
Maybe the trouble lies into the native wp8 nutshell or into some environment params configuration.
Thank you very much.
Finally we solved.
It was an angularjs problem about $routeProvider -> templateUrl.
Not a WL problem though it seemed.
When working with windowsphone8 the root of the Partials Url must be www, that is:
For Android and Iphone the correct path for partials html is
app.config(function($routeProvider, $locationProvider) {
$routeProvider.when('/', {
templateUrl : "partials/login.html",
controller : "LoginController"
});
...
Whilst for WindowsPhone8 the path must be absolute
app.config(function($routeProvider, $locationProvider) {
$routeProvider.when('/', {
templateUrl : "www/default/partials/login.html",
controller : "LoginController"
});
...
Anyway, the error message still remain. But everything works fine.