lprado
lprado

Reputation: 35

JSONSTORE Mobilefirst 7.1 error java.lang.NoClassDefFoundError: com.worklight.jsonstore.util.JSONStoreUtil

I am having the error java.lang.NoClassDefFoundError: com.worklight.jsonstore.util.JSONStoreUtil when I initialize a function of JSONSTORE.

I am using Mobilefirst Studio 7.1.0.00-20160323-1606

In main.js I have this code:

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
    });
}

EDIT

I am seeing in the android studio project that int the file .idea/libraries/libs.xml the jsonstore.jar is not imported

libs.xml

Also in the folder libs the file jsonstore.jar exists

libs

I don´t know if that could be a problem.

Upvotes: 0

Views: 157

Answers (2)

lprado
lprado

Reputation: 35

I resolve my problem, the JSONSTORE was not imported in the Android Project. So I imported the jsonStore.jar with the android Studio and the problem was solved.

Add Libraries

Upvotes: 3

Idan Adar
Idan Adar

Reputation: 44516

You did not specify whether you have added the JSONStore feature to your project...

Select the application-descriptor.xml file and click on the Editor tab.
Select your environment from the UI and add the JSONStore feature to it from the Optional section.

See full instructions here: https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-1/foundation/data/jsonstore/jsonstore-javascript-api/#add-feature

Upvotes: 1

Related Questions