MobileFirst 6.3:找不到方法org.json.JSONException。<init> </init>

时间:2015-03-18 11:15:26

标签: ibm-mobilefirst jsonstore

Windows中的IBM MobileFirst 6.3.0

当我使用Json Store时,我几乎没有警告和例外。

可以忽略或任何修复可用,因为我使用从Eclipse Market安装的最新MobileFirst工作室

JSON STORE代码:

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 /郎/ Throwable的;)V

此外,当我第一次调用openJSON()时,我曾经像以前那样获得跟踪日志的数据。

  

03-18 06:50:05.518:D / JSONSTORE(1053):JSONStoreLogger.logDebug in   JSONStoreLogger.java:174 ::配置数据库“people”(已经   存在:错误)

1 个答案:

答案 0 :(得分:0)

第一个只是一个警告,它总是显示出来。它不会影响任何事情。第二个只是一条调试消息,告诉您先前创建的集合是否已创建;如果它已经存在,它将只返回那个,并说'#34;已经存在:true&#34;。

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