【问题标题】:MobileFirst 6.3: Could not find method org.json.JSONException.<init>MobileFirst 6.3:找不到方法 org.json.JSONException.<init>
【发布时间】:2015-05-21 03:36:47
【问题描述】:

Windows 中的 IBM MobileFirst 6.3.0

当我使用 Json Store 时,我很少遇到警告和异常。

由于我使用的是从 Eclipse 市场安装的最新 MobileFirst 工作室,因此可以忽略此问题或提供任何修复程序

JSON 存储代码:

var jsonStoreObject = { };

jsonStoreObject.collectionName = 'people';

jsonStoreObject.collections = {
            people : {
                searchFields : {name: 'string', age: 'integer'}
            }
};  

jsonStoreObject.options = {
            username : "Hello",
            password : "123"
};


function openJSON(){
WL.JSONStore.init(jsonStoreObject.collections, jsonStoreObject.options)
.then(function(data) {          
    WL.Logger.info("After Init::"+ JSON.stringify(data));
    return WL.JSONStore.get(jsonStoreObject.collectionName).findAll();
})  
.then(function(findAllResult) {
    WL.Logger.info("findAllResult::"+ JSON.stringify(findAllResult));
    if (findAllResult.length == 0) {
        var data = [{name: 'carlos', age: 10}];
        return WL.JSONStore.get(jsonStoreObject.collectionName).add(data);
    }
})
.fail(function (errorObject) {
    console.log("Json Failure:: " + WL.JSONStore.getErrorMessage(errorObject));
});
}

例外/警告:

03-18 05:23:17.332: I/dalvikvm(1669): 找不到方法 org.json.JSONException.,从方法中引用 com.worklight.androidgap.jsonstore.security.DPKBean.

03-18 05:23:17.332: W/dalvikvm(1669): VFY: 无法解析直接方法 34098: Lorg/json/JSONException;。 (Ljava/lang/Throwable;)V

另外,当我第一次调用 openJSON() 时,我曾经得到以下日志,比如数据库已经存在。

03-18 06:50:05.518: D/JSONSTORE(1053): JSONStoreLogger.logDebug in JSONStoreLogger.java:174 :: 供应数据库“人”(已经 存在:假)

【问题讨论】:

    标签: ibm-mobilefirst jsonstore


    【解决方案1】:

    第一个只是一个警告,它总是会出现。它不会影响任何事情。第二个只是一条调试消息,告诉您您正在创建的集合是否以前创建过;如果它已经存在,它只会返回那个,并说“已经存在:true”。

    它们都不影响执行,所以你不必担心它们。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多