适用于IBM Mobile First JsonStore初始化的{PROVISION_TABLE_SEARCH_FIELDS_MISMATCH

时间:2018-01-21 05:59:00

标签: ibm-mobilefirst mobilefirst-adapters jsonstore mobilefirst-studio mfp

我正在使用Javascript JSONStore在IBM Mobile First Platform 8.0.0中初始化JsonStore集合。我面临的问题是代码在某些设备上工作正常,对于某些设备而言,它给出了以下错误。

01-19 19:49:43.487 11622-11646 / com.mobiInspect D / JSONSTORE:JSONStoreLogger.java:197中的JSONStoreLogger.logTrace ::现有集合的表模式不匹配。 01-19 19:49:43.492 11622-11646 / com.mobiInspect D / JSONSTORE:JSONStoreLogger.java:197中的JSONStoreLogger.logTrace ::调度操作" provision" 01-19 19:49:43.498 11622-11646 / com.mobiInspect D / JSONSTORE:JSONStoreLogger.java:197中的JSONStoreLogger.logTrace ::调用动作调度程序" provision"带参数: 01-19 19:49:43.501 11622-11646 / com.mobiInspect D / JSONSTORE:JSONStoreLogger.java中的JSONStoreLogger.logTrace:197 :: dbName = inspectorList 01-19 19:49:43.505 11622-11622 / com.mobiInspect D / WebView:evaluateJavascript = cordova.callbackFromNative(' LoggerPlugin1661877744',true,1,[" OK"],false ); 01-19 19:49:43.506 11622-11646 / com.mobiInspect D / JSONSTORE:JSONStoreLogger.java中的JSONStoreLogger.logTrace:197 :: schema = {" name":" string" } 01-19 19:49:43.512 11622-11646 / com.mobiInspect D / JSONSTORE:JSONStoreLogger.java中的JSONStoreLogger.logTrace:197 :: options = [未记录的值] 01-19 19:49:43.515 11622-11646 / com.mobiInspect D / JSONSTORE:JSONStoreLogger.java中的JSONStoreLogger.logTrace:197 :: additionalSearchFields = {} 01-19 19:49:43.519 11622-11646 / com.mobiInspect D / JSONSTORE:JSONStoreLogger.java中的JSONStoreLogger.logTrace:197 :: dropCollection = false 01-19 19:49:43.523 11622-11646 / com.mobiInspect D / JSONSTORE:JSONStoreLogger.java中的JSONStoreLogger.logTrace:197 :: username = jsonstore 01-19 19:49:43.529 11622-11646 / com.mobiInspect D / JSONSTORE:JSONStoreLogger.java中的JSONStoreLogger.logTrace:197 :: collectionPassword = xxxxxxxx 01-19 19:49:43.533 11622-11646 / com.mobiInspect E / null:初始化失败:任务列表集合{" src":" initCollection","错误& #34;: - 2," MSG":" PROVISION_TABLE_SEARCH_FIELDS_MISMATCH"" COL":" myTasks"" USR&#34 ;:" jsonstore""文档":{}," RES":{}} 01-19 19:49:43.535 11622-11646 / com.mobiInspect E / wl.jsonstore:{" src":" initCollection"," err": - 2," MSG":" PROVISION_TABLE_SEARCH_FIELDS_MISMATCH"" COL":" myTasks"" USR":&#34 ; jsonstore""文档":{}," RES":{}} 01-19 19:49:43.753 11622-11633 / com.mobiInspect I / art:背景粘滞并发标记扫描GC释放41582(2MB)AllocSpace对象,0(0B)LOS对象,10%免费,15MB / 17MB,暂停3.657 ms总共148.294ms 01-19 19:49:43.768 11622-11646 / com.mobiInspect D / wl.response:WLResponse。在WLResponse.java:69 :: Response中不包含Content-Encoding标头。试图阅读响应机构。 01-19 19:49:43.814 11622-11646 / com.mobiInspect D / wl.request:WLRequestSender.java中的WLRequestSender.run:43 ::发送请求https://www.serverurl.com/mfp/api/az/v1/token

$scope.init_collection = function () {
    ProgressIndicator.showSimpleWithLabel(false, 'Loading...');

    //Data Collection

    collections1['COLLECTION_NAME'] = {
        searchFields: {'id': 'string', 'processid': 'string', 'state': 'integer'}
    };

    WL.JSONStore.init(collections1, options)
    .then(function () {
        WL.Logger.info("Inside Task Submission Collection");

        WL.JSONStore.fileInfo()
                                .then(function (res) {
                                WL.Logger.debug(" Success response of Task Submission Collection fileInfo :" +JSON.stringify(res));
                                  //res => [{isEncrypted : true, name : carlos, size : 3072}]
                                })

                                  .fail(function (failRes) {
                                  WL.Logger.debug("Failure response of Task Submission Collection fileInfo :" +JSON.stringify(failRes));
                                  // Handle failure.
                                });
    })
    .fail(function (errorObject) {
        //WL.Logger.error(Messages.ERR_LGN_FAIL_INI_DTA_STRG);
        WL.Logger.error("Initialization failure on : Task Submission Collection "+JSON.stringify(errorObject));
    });
    //WL.Logger.info(Messages.INF_LGN_INI_DTA_STRG);
    //Data Collection

    //Image Collection

    collections2["COLLECTION_IMAGE"] = {
        searchFields: {'id': 'string', 'processid': 'string', 'isImageSubmitted': 'boolean'}
    };

    WL.JSONStore.init(collections2, options)
    .then(function () {
        WL.Logger.info("Inside Image Submission Collection");

        WL.JSONStore.fileInfo()
                                    .then(function (res) {
                                    WL.Logger.debug(" Success response of Image Submission Collection fileInfo :" +JSON.stringify(res));
                                      //res => [{isEncrypted : true, name : carlos, size : 3072}]
                                    })

                                      .fail(function (failRes) {
                                      WL.Logger.debug("Failure response of Image Submission Collection fileInfo :" +JSON.stringify(failRes));
                                      // Handle failure.
                                    });
    })
    .fail(function (errorObject) {
        //WL.Logger.error(Messages.ERR_LGN_FAIL_INI_IMG_CLL);
        WL.Logger.error("Initialization failure on : Image Submission Collection "+JSON.stringify(errorObject));
    });
    //WL.Logger.info(Messages.INF_LGN_CLL_INI);

    //Image Collection


    //TODAY Collection

    collections3["COLLECTION_TODAY"] = {
        searchFields: {'id': 'string', 'processid': 'string', 'state': 'integer', 'insname': 'string'}
    };
    WL.JSONStore.init(collections3, options)
    .then(function () {
        WL.Logger.info("Inside Task List Collection");

        WL.JSONStore.fileInfo()
        .then(function (res) {
            WL.Logger.debug("Success response of Task List Collection fileInfo :" +JSON.stringify(res));
                                      //res => [{isEncrypted : true, name : carlos, size : 3072}]
        })
        .fail(function (failRes) {
            WL.Logger.debug("Failure response of Task List Collection fileInfo :" +JSON.stringify(failRes));
            // Handle failure.
        });
    })
    .fail(function (errorObject) {
        //WL.Logger.error(Messages.ERR_LGN_FAIL_INI_IMG_CLL);
        WL.Logger.error("Initialization failure on : Task List Collection "+JSON.stringify(errorObject));
    });
    //WL.Logger.info(Messages.INF_LGN_CLL_INI);

    //TODAY Collection

    //List Collection
    collections4["COLLECTION_LIST"] = {
        searchFields: {'name': 'string'}
    };
    WL.JSONStore.init(collections4, options)
    .then(function () {
        WL.Logger.info("Inside Inspector List Collection");

        WL.JSONStore.fileInfo()
        .then(function (res) {
            WL.Logger.debug("Success response of Inspector List Collection fileInfo :" +JSON.stringify(res));
                                      //res => [{isEncrypted : true, name : carlos, size : 3072}]
        })
        .fail(function (failRes) {
            WL.Logger.debug("Failure response of Inspector List Collection fileInfo :" +JSON.stringify(failRes));
            // Handle failure.
        });
    })
    .fail(function (errorObject) {
        //WL.Logger.error(Messages.ERR_LGN_FAIL_INI_IMG_CLL);
        WL.Logger.error("Initialization failure on : Inspector List Collection " +JSON.stringify(errorObject));
    });
    WL.Logger.info(Messages.INF_LGN_CLL_INI);
    //List Collection

};

我是否在IBM MFP 8.0中缺少JsonStore初始化的任何内容?任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:0)

错误信息' PROVISION_TABLE_SEARCH_FIELDS_MISMATCH'

时会发生
  

搜索字段不是动态的。在使用新搜索字段调用init或openmethod之前,无法在不调用destroy方法或removeCollection方法的情况下更改搜索字段。如果更改搜索字段的名称或类型,则会发生此错误。例如:{key:'string'}到{key:'number'}或{myKey:'string'}到{theKey:'string'}。

请点击此处了解更多详情: http://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/troubleshooting/jsonstore/