简体   繁体   English

Worklight应用程序在手机上生成带有JSONStore的PERSISTENT_STORE_FAILURE

[英]Worklight app results in PERSISTENT_STORE_FAILURE with JSONStore on my phone

I just tried a small sample worklight app on my phone to test the JSONStore, the init code for which is as follows in my file jsontest.js . 我刚刚在手机上尝试了一个小样本worklight应用程序来测试JSONStore,其初始代码在我的文件jsontest.js如下所示。

function wlCommonInit(){

var i;

var collectionName = 'exp';

var options = {};

var collections = {};
//Object that defines the 'people' collection
collections[collectionName] = {};
//Object that defines the Search Fields for the 'people' collection

WL.JSONStore.destroy(options);

collections[collectionName].searchFields = {name: 'string', age: 'integer'};

WL.JSONStore.init(collections, options)
.then(function () {
    alert ("JSON Store initialization success!");
})
.fail(function (errorObject) {
    alert (errorObject);
});

I'm getting the error -1: PERSISTENT STORE FAILURE when I run the app on my phone (Galaxy Nexus). 当我在手机上运行应用程序(Galaxy Nexus)时,我收到错误-1:PERSISTENT STORE FAILURE。 The following errorObject is returned. 返回以下errorObject

{
"src": "initCollection",
"err": -1,
"msg": "PERSISTENT_STORE_FAILURE",
"col": "exp"
"usr": "jsonstore",
"doc": {},
"res": {}
}

The app works fine in the Worklight console simulator and in the AVD. 该应用程序的工作灯控制台模拟器,并在AVD 正常工作。 My phone has enough storage (600 MB left) to run the app so that shouldn't be a problem. 我的手机有足够的存储空间(600 MB左右)来运行应用程序,这应该不是问题。

What am I doing wrong here? 我在这做错了什么? Does this have anything to do with the fact that I'm running a custom ROM? 这与我运行自定义ROM的事实有什么关系吗?

UPDATE: I checked the app on my dad's phone (Sony Xperia Sola) and it worked! 更新:我在我父亲的电话(索尼Xperia Sola)上检查了应用程序并且它有效! Very weird. 很奇怪。 It doesn't run on my phone, even though all other third-party apps that I have downloaded so far on my phone from the Play Store and other sources all work fine. 它不能在我的手机上运行,​​即使我到目前为止从Play商店和其他来源下载的所有其他第三方应用程序都运行正常。

So, does Worklight not support custom ROMs? 那么,Worklight 支持自定义ROM吗?

The custom ROM that I am using is VanirAOSP . 我使用的自定义ROM是VanirAOSP I applied a popular custom kernel and I'm using the Dalvik runtime (not ART or anything like that). 我应用了一个流行的自定义内核 ,我正在使用Dalvik运行时(不是ART或类似的东西)。

I also think that the problem might be because Worklight apps are not fully supported on Android 4.4 KitKat. 我也认为问题可能是因为Android 4.4 KitKat不完全支持Worklight应用程序。

Would appreciate it if someone would shed some light on this. 如果有人能对此有所了解,我将不胜感激。

There is an issue that affects the JSONstore when using Worklight 6.0 on Android 4.4, which causes the behavior your are seeing. 在Android 4.4上使用Worklight 6.0时会出现影响JSONstore的问题,这会导致您看到的行为。 You can get more information about this here: 你可以在这里获得更多相关信息:

http://www-01.ibm.com/support/docview.wss?uid=swg27040512 http://www-01.ibm.com/support/docview.wss?uid=swg27040512

If you are using Worklight Consumer Edition or Worklight Enterprise Edition, you can get a fix for this issue by upgrading to Worklight 6.0.0.2 (a/k/a Worklight 6.0 Fix Pack 2). 如果您使用的是Worklight Consumer Edition或Worklight Enterprise Edition,则可以通过升级到Worklight 6.0.0.2(a / k / a Worklight 6.0 Fix Pack 2)来解决此问题。

If you are using Worklight Developer Edition, you should be able to use the Eclipse "Check for Updates" function to upgrade your Worklight 6.0 Developer Edition installation to Fix Pack 2. 如果您使用的是Worklight Developer Edition,则应该能够使用Eclipse“检查更新”功能将Worklight 6.0 Developer Edition安装升级到Fix Pack 2。

Note that after applying the fix, you must remove the JSONstore feature from your application, and then add it back again; 请注意,应用此修复程序后,您必须从应用程序中删除JSONstore功能,然后再将其添加回来; this is described in the APAR document that you can access from the page I've linked above. APAR文档中描述了这一点,您可以从我上面链接的页面进行访问。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM