【问题标题】:JSONSTORE Mobilefirst 7.1 error java.lang.NoClassDefFoundError: com.worklight.jsonstore.util.JSONStoreUtilJSONSTORE Mobilefirst 7.1 错误 java.lang.NoClassDefFoundError: com.worklight.jsonstore.util.JSONStoreUtil
【发布时间】:2016-07-19 08:40:34
【问题描述】:

我在初始化 JSONSTORE 函数时遇到错误 java.lang.NoClassDefFoundError: com.worklight.jsonstore.util.JSONStoreUtil。

我正在使用 Mobilefirst Studio 7.1.0.00-20160323-1606

在 main.js 我有这个代码:

function wlCommonInit(){    
    var collectionCart = {
        cartCellphones : {
            searchFields: {id: 'integer', model: 'string', precio:'integer', caracteristicas:'string',image:'string',brand:'string'}
        }
    };

    WL.JSONStore.init(collectionCart).then(function (collectionCart) {
      // handle success - collection.people (people's collection)
    }).fail(function (error) {
      // handle failure
    });

    /************************JSON STORE Datos personales**********************************/

    var collectionData = {
        personalData : {
            searchFields: {name: 'string', lastName:'string', photo:'string',telephone:'string',email:'string', datebirth: 'string',}
        }
    };

    WL.JSONStore.init(collectionData).then(function (collectionData) {
      // handle success - collection.people (people's collection)
    }).fail(function (error) {
      // handle failure
    });
}

编辑

我在 android studio 项目中看到文件 .idea/libraries/libs.xml 未导入 jsonstore.jar

libs.xml

在文件夹 libs 中也存在 jsonstore.jar 文件

libs

我不知道这是否是个问题。

【问题讨论】:

    标签: javascript android ibm-mobilefirst jsonstore


    【解决方案1】:

    我解决了我的问题,Android 项目中没有导入 JSONSTORE。于是我用android Studio导入了jsonStore.jar,问题就解决了。

    Add Libraries

    【讨论】:

      【解决方案2】:

      您没有指定是否已将 JSONStore 功能添加到您的项目中...

      选择 application-descriptor.xml 文件并单击编辑器选项卡。
      从 UI 中选择您的环境,然后从 Optional 部分向其中添加 JSONStore 功能。

      在此处查看完整说明:https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-1/foundation/data/jsonstore/jsonstore-javascript-api/#add-feature

      【讨论】:

      • 我忘了说,但我从 UI 将 JSONSTORE fetuare 添加到 application-descritptor.xml 中,并且我还直接在源代码中添加了该功能。但我继续遇到问题。我更新了 mobilefirst 工作室以查看问题是否是错误,因为我找到了此链接 www-01.ibm.com/support/docview.wss?uid=swg1PI52743 但我仍然遇到同样的问题
      猜你喜欢
      • 2016-04-27
      • 2016-05-21
      • 1970-01-01
      • 1970-01-01
      • 2016-04-13
      • 2023-03-05
      • 1970-01-01
      • 2017-08-17
      • 1970-01-01
      相关资源
      最近更新 更多