cancel
Showing results for 
Search instead for 
Did you mean: 

Error when creating Offline Store

Former Member
0 Kudos

Hey,

I want to integrate an Offline Store in my Kapsel App. But when I start my App and call the method

store.open(openStoreSuccessCallback, openStoreErrorCallback);

I get the following error (console):


An error occurred: "Unknown network error occured[-10210] The operation failed due to an error on the server: ata/offline/resource/LocalizedMessage : cannot initialize class becau"


When I look into my server logfile I can see the following error message:

#2.0#2016-07-25 01:41:42 PM#ERROR####Offline#1469446902920000#66ee0c01-818b-44f9-af79-07ac9c120758##com.sap.mobile.platform.server.mobilink.MLSMPLogger:error########345#####[-10225] User exception: com/sap/odata/offline/resource/LocalizedMessage : cannot initialize class because prior initialization attempt failed#

Can anyone help me fixing this issue?

Thank you very much and best regards,

David

Accepted Solutions (0)

Answers (1)

Answers (1)

rakshit_doshi
Active Contributor
0 Kudos

Hi David,

Can you share the code that you use to initialize the offline store and can you increase the log level on sap management cockpit and keeping the offline component to debug and then replicating the issue.

This will help in trouble shooting.

Thanks,

Rakshit Doshi

Former Member
0 Kudos

function initOfflineStore() {

                var properties = {

                    "name": "...",

                    "host": applicationContext.registrationContext.serverHost,

                    "port": applicationContext.registrationContext.serverPort,

                    "https": applicationContext.registrationContext.https,

                    "serviceRoot": appId

                };

               

                store = sap.OData.createOfflineStore(properties);

           

                store.open(openStoreSuccessCallback, openStoreErrorCallback);

            }

I use just this simple method.

Best regards,

David

rakshit_doshi
Active Contributor
0 Kudos

Hi David,

Does your application connection use any authentication mechanism when u register the user on SMP

Try this set of code,

var authStr = "Basic " + btoa(username + ":" + password);  //This is the username and password if you use any for authentication during registration

var properties = {

      "name": "OfflineStore",

      "host": "SMP HOST",

      "port": SMP PORT,   Do not add port in inverted commas

      "https": false,

      "serviceRoot": APPID,   //This is the application id that you create on management cockpit

      "streamParams": "custom_header=Authorization:" + authStr + ";custom_header=X-SMP-APPCID:" + appCID + ";",

      "definingRequests": {

        "Set1": "/EntitySet"

      }

    };

  

    store = sap.OData.createOfflineStore(properties);

    store.open(this.openStoreSuccessCallback, this.openStoreErrorCallback);

Test if this piece of code works.

Hope this helps

Thanks,

Rakshit Doshi.

Former Member
0 Kudos

Hey Rakshit,

I've tested your code in my app, but still getting the same error.

I also tested the demo app from the tutorial . When I try it with the example "OData Based App with the Kapsel Offline OData Plugin" I am still getting the same error.

Can you give my any further hints how to fix this issue?

Thank you very much and best regards,

David

rakshit_doshi
Active Contributor
0 Kudos

Hi David,

Can you turn the log settings for SMP for offline component to debug and share the log file here.

Maybe it will help to troubleshoot

Thanks,

Rakshit Doshi

Former Member
0 Kudos

Hey Rakshit,

here is the logfile.

Thank you very much for your help and best regards,

David

rakshit_doshi
Active Contributor
0 Kudos

Do you have an email id where we can conversate?

Thanks,

Rakshit Doshi