PROVISION_TABLE_SEARCH_FIELDS_MISMATCH для IBM Mobile First JsonStore Initialization
Я использую Javascript JSONStore для инициализации коллекции JsonStore в IBM Mobile First Platform 8.0.0. Проблема, с которой я сталкиваюсь, заключается в том, что код ниже работает нормально для некоторых устройств, а для некоторых устройств - это ошибка ниже.
01-19 19: 49: 43.487 11622-11646 / com.mobiInspect D / JSONSTORE: JSONStoreLogger.logTrace в JSONStoreLogger.java:197:: Несоответствие схемы таблицы для существующей коллекции. 01-19 19:49:43.492 11622-11646/com.mobiInspect D/JSONSTORE: JSONStoreLogger.logTrace в JSONStoreLogger.java:197:: диспетчерское действие "предоставление" 01-19 19:49:43.498 11622-11646/com.mobiInspect D/JSONSTORE: JSONStoreLogger.logTrace в JSONStoreLogger.java:197:: вызов диспетчера действий "provision" с параметрами: 01-19 19:49:43.501 11622-11646/com.mobiInspect D/JSONSTORE: JSONStoreLogger.logTrace в JSONStoreLogger.j:197:: dbName=inspectorList 01-19 19:49:43.505 11622-11622/com.mobiInspect D/WebView:valuJavascript=cordova.callbackFromNative('LoggerPlugin1661877744',true,1,["OK"],false); 01-19 19:49:43.506 11622-11646/com.mobiInspect D/JSONSTORE: JSONStoreLogger.logTrace в JSONStoreLogger.java:197:: schema={"name":"string"} 01-19 19:49:43.512 11622-11646/com.mobiInspect D/JSONSTORE: JSONStoreLogger.logTrace в JSONStoreLogger.java:197:: options=[значение не зарегистрировано] 01-19 19:49:43.515 11622-11646/com.mobiInspect D/JSONSTORE: JSONStoreLogger.logTrace в JSONStoreLogger.java:197:: AdditionalSearchFields={} 01-19 19:49:43.519 11622-11646/com.mobiInspect D/JSONSTORE: JSONStoreLogger.logTrace в JSONStoreLogger.java:197:: dropCollection=false 01-19 19:49:43.523 11622-11646/com.mobiInspect D/JSONSTORE: JSONStoreLogger.logTrace в JSONStoreLogger.java:197:: username=jsonstore 01-19 19:49:43.529 11622-11646/com.mobiInspect D/JSONSTORE: JSONStoreLogger.log в JSONStoreLogger.java:197:: collectionPassword=xxxxxxxx 01-19 19:49:43.533 11622-11646/com.mobiInspect E/null: Ошибка инициализации: Коллекция списка задач {"src":"initCollection","err":-2,"сообщение":"PROVISION_TABLE_SEARCH_FIELDS_MISMATCH","col":"myTasks","usr":"jsonstore","doc":{},"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":"jsonstore","doc":{},"res":{}} 01-19 19:49:43.753 11622-11633/com.mobiInspect I/art: Развертка фоновой липкой одновременной пометки Освобождение GC 41582(2 МБ) объектов AllocSpace, 0(0 Б) объектов LOS, 10% свободно, 15 МБ /17 МБ, приостановлено 3.657 мс, всего 148 294 мс, 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.run в WLRequestSender.java: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
};
Я что-то здесь упускаю для инициализации JsonStore в IBM MFP 8.0? Любая помощь будет оценена.
1 ответ
Сообщение об ошибке "PROVISION_TABLE_SEARCH_FIELDS_MISMATCH" может возникнуть, когда
Поля поиска не являются динамическими. Невозможно изменить поля поиска без вызова метода destroy или метода removeCollection, прежде чем вызывать init или openmethod с новыми полями поиска. Эта ошибка может возникнуть, если вы измените имя или тип поля поиска. Например: от {key: 'string'} до {key: 'number'} или от {myKey: 'string'} до {theKey: 'string'}.
Смотрите здесь для получения более подробной информации: http://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/troubleshooting/jsonstore/