cancel
Showing results for 
Search instead for 
Did you mean: 

MobiLink communication error Android SUP

Former Member
0 Kudos
268

Can anyone help me in solving the error

com.sybase.persistence.SynchronizeException: com.ianywhere.ultralitejni12.implementation.JniException: UltraLiteJ Error[-1305]: MobiLink communication error -- code: 63, parameter: , system code: 110Details:

02-06 10:54:16.434: W/System.err(758): StreamErrorCode = 63

We have been trying to pull data from the Unwired Server Platform to our android app, but so far it does not work.The application registration is being done successfully but we have a problem while synchronizing.

We have followed the sample codes that SUP provided.  But when we run the sample application, we got the above error.

The process we are following is like this:

1.Establishing Connection/Registration


     Application app = Application.getInstance();

  XXXDB.registerCallbackHandler(new CustomerDBCallback());

  XXXDB.setApplication(app);

    XXXDB.getSynchronizationProfile().setServerName(HOST);

     ConnectionProperties connProps = app.getConnectionProperties();

     LoginCredentials loginCredentials = new LoginCredentials(USERNAME, PASSWORD);

     connProps.setLoginCredentials(loginCredentials);

     connProps.setServerName(HOST);

     connProps.setPortNumber(PORT); //5001

     if (app.getRegistrationStatus() != RegistrationStatus.REGISTERED) {

      app.registerApplication(600);

     } else {

      app.startConnection(600);

     }

THIS Step 1 is always successful.

2. Synchronization:

ConnectionProfile cp =   XXXDB.getSynchronizationProfile();

        cp.setUserName(USERNAME);

                         cp.setPassword(PASSWORD);

      cp.setServerName(HOST);

      cp.setPortNumber(2480);

      cp.setNetworkProtocol("http");

      cp.setAsyncReplay(true);

      cp.setDomainName("default");

      cp.save();

Now, it tries for a while to Syncronize from the server and it fails with Mobilink Communication Error Code 63.


Am attaching the error log.Any help and info regarding this error is greatly appreciated.

Thanks

priti

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Midhun,

                Thanks for the reply we are using SCC credentials only for registration and synchronization.Details of load parameters and sync parameters are shown below.

midhun_vp
Active Contributor
0 Kudos

Delete the sync parameter created.

You need to pass the PK > sync,

ex:

PersonalizationParameters param = CustomerListDB.getPersonalizationParameters();

            param.setPk_maxrows("99");

            param.save();

      CustomerListDB.subscribe();

      CustomerListDB.synchronize();

- Midhun VP

Former Member
0 Kudos

Hi Midhun,

             

                 I have added the parameters but still the problem exists.

Regards

Priti

midhun_vp
Active Contributor
0 Kudos

Right click on MBO> preview. Pass input and check whether you are getting data. The SCC logs have more information on this issue. SCC> server> logs.

To make length of input equal to length of input data pre append zeroes.ex.0000099.

Are you getting output when you are testing the RFC in SAP?

Former Member
0 Kudos

Hello Midhun,

We have removed the sync parameter and checked in preview for MBO too. It is fetching records as well.Am getting the same exception when calling subscribe method before calling synchronization.Please do the needful.

Plz check the below screen shot.

midhun_vp
Active Contributor
0 Kudos

Use the below code:

Registration:

try {

      

       ConnectionProperties connProps = app.getConnectionProperties();

       connProps.setFarmId("0");

       connProps.setServerName("10.10.10.10");

       connProps.setPortNumber(5001);

       CustomerListDB.setApplication(app);

       LoginCredentials loginCredentials = new LoginCredentials(

         "supAdmin", "s3pAdmin");

       connProps.setLoginCredentials(loginCredentials);

     

        if (app.getRegistrationStatus() != RegistrationStatus.REGISTERED) {

         app.registerApplication(600);

        } else {

         app.startConnection(600);

        }

       } catch (Exception e) {

        returnMsg = e.getMessage();

       }

Sync:

try {

       

        if (!CustomerListDB.databaseExists()) {

        CustomerListDB.createDatabase();

         Log.d("Database 2", "Value is"

           + CustomerListDB.databaseExists());

        } else {

        CustomerListDB.openConnection();

        }

        ConnectionProfile connectionProfile = CustomerListDB

        .getSynchronizationProfile();

        connectionProfile.setServerName("10.10.10.10");

        connectionProfile.setPortNumber(2480);

        connectionProfile.setNetworkProtocol("http");

        connectionProfile.setAsyncReplay(true);

       

        connectionProfile.setDomainName("default");

        connectionProfile.save();

   

            PersonalizationParameters param = CustomerListDB.getPersonalizationParameters();

            param.setPK_Customer_Input("10");

            param.save();

      CustomerListDB.subscribe();

      CustomerListDB.synchronize();

Keep an external break point in the RFC by logged in as the same user set in the SAP connection profile in Sybase SDK. When you sync check whether the RFC is triggering, if yes debug the RFC. Since the error comes at subscribe the RFC may not trigger.

Delete the MBO package, application (Server>Applications>applicaitons) and redeploy the MBO package and try. Also check the domain logs under defaultin SCC.

- Midhun VP

Former Member
0 Kudos

Hello Midhun,

           

         Can u Please check the code  we are using and tell us if we are missing something

public class SUP101SampleActivity extends Activity

{

    private static final int REQUEST_DETAIL = 99;

    private static String USERNAME ="supadmin";

    private static String PASSWORD ="sappass";

    private static String HOST = "host";

    private static int PORT = 5001;

    private static int TIMEOUT = 600;

    private CustomerListAdapter adapter;

    private static volatile boolean initializationDone = false;

    /** Called when the activity is first created. */

    @Override

    public void onCreate(Bundle savedInstanceState)

    {

        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_sup);

        initializeApplication();

    }

    protected void onActivityResult(int requestCode, int resultCode, Intent data)

    {

        if (requestCode == REQUEST_DETAIL)

        {

            if (resultCode == RESULT_OK)

            {

                SUP101SampleActivity.this.adapter.refreshUI(true);

            }

        }

    }

    private void initializeApplication()

    {      

        final ProgressDialog dialog = new ProgressDialog(this);

        dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);

        dialog.setTitle("on boarding ...");

        dialog.setMessage("Please wait while download initial data...");

        dialog.setIndeterminate(false);

        dialog.setProgress(100);

        dialog.setCancelable(true);

        dialog.show();

        new Thread()

        {

            @Override

            public void run()

            {

                try

                {

                    int count = 0;

                    while (!initializationDone)

                    {

                        dialog.setProgress(++count);

                        Thread.sleep(100);

                        if (count == 100)

                        {

                            count = 0;

                        }

                    }

                    dialog.cancel();

                }

                catch (Exception e)

                {

                    dialog.cancel();

                }

            }

        }.start();

        Application app = Application.getInstance();

        app.setApplicationIdentifier("test");

        app.setApplicationContext(SUP101SampleActivity.this);

        new Thread(new Runnable()

        {

            public void run()

            {

                try

                {

                    Application app = Application.getInstance();

                    xxxDB.registerCallbackHandler(new CustomerDBCallback());

                    xxxDB.setApplication(app);

                    xxxDB.getSynchronizationProfile().setServerName(HOST);

                    ConnectionProperties connProps = app.getConnectionProperties();

                    LoginCredentials loginCredentials = new LoginCredentials(USERNAME, PASSWORD);

                    connProps.setLoginCredentials(loginCredentials);

                    connProps.setServerName(HOST);

                    connProps.setPortNumber(PORT);

                    if (app.getRegistrationStatus() != RegistrationStatus.REGISTERED) {

                        Log.d("TAG", "registering app");

                        app.registerApplication(600);

                    } else {

                        Log.d("TAG", "connecting app");

                        app.startConnection(600);

                    }          

                    try {

                        if (!xxxDB.databaseExists()) {

                            xxxDB.createDatabase();

                            Log.d("TAG", "createDatabase");

                        } else {

                            xxxDB.openConnection();

                            Log.d("TAG", "openConnection");

                        }

                    } catch (Exception e1) {

                        e1.printStackTrace();

                        Log.d("TAG", e1.getMessage());

                    }

                    try {

                        // Set synchronization profile

                        ConnectionProfile cp = xxxDB.getSynchronizationProfile();

                        cp.setUserName(USERNAME);

                        cp.setPassword(PASSWORD);

                        cp.setServerName(HOST);

                        cp.setPortNumber(2480);

                        cp.setNetworkProtocol("http");

                        cp.setAsyncReplay(true);

                        cp.setDomainName("default");

                        cp.save();

                        PersonalizationParameters param = xxx.getPersonalizationParameters();

                   

                        param.setPk_maxrows(10);

                        param.save();

                    } catch (Exception e) {

                        e.printStackTrace();

                        Log.d("TAG", e.getMessage());

                    }

                    try {

                        Log.d("Subscribe","Start");

                        xxxDB.subscribe();

                        Log.d("Subscribe","End");

                        System.out.println("Submit pending");

                        xxxDB.submitPendingOperations();

                        System.out.println("Submit pending 2");

                        System.out.println("Subscribe");

                        SynchronizationGroup sg = xxxDB

                                .getSynchronizationGroup("default");

                        sg.setEnableSIS(true);

                        sg.save();

                        xxxDB.synchronize();

                    } catch (Exception e) {

                        e.printStackTrace();

                        Log.d("TAG", e.getMessage());

                    }

                } 

                finally

                {

                    initializationDone = true;

                }

                SUP101SampleActivity.this.runOnUiThread(new Runnable()

                {

                    public void run()

                    {

                        adapter = new CustomerListAdapter(SUP101SampleActivity.this);

                        ListView listView = (ListView) findViewById(R.id.listView1);

                        listView.setAdapter(adapter);

                        listView.setOnItemClickListener(new OnItemClickListener()

                        {

                            public void onItemClick(AdapterView<?> a, View v, int position, long id)

                            {

                                Intent intent = new Intent(SUP101SampleActivity.this, DetailActivity.class);

                                intent.putExtra("pk", adapter.getPk(position));

                                SUP101SampleActivity.this.startActivityForResult(intent, REQUEST_DETAIL);

                            }

                        });

                    }

                });

            }

        }).start();

    }

    private class CustomerDBCallback extends DefaultCallbackHandler

    {

        @Override

        public int onSynchronize(GenericList<SynchronizationGroup> groups, SynchronizationContext context)

        {

            if (context.getStatus() == SynchronizationStatus.STARTING)

            {

                SUP101SampleActivity.this.runOnUiThread(new Runnable()

                {

                    public void run()

                    {

                        Toast.makeText(SUP101SampleActivity.this, "Synchronizing ... ", Toast.LENGTH_SHORT).show();

                    }

                });

            }

            else if (context.getStatus() == SynchronizationStatus.FINISHING || context.getStatus() == SynchronizationStatus.ASYNC_REPLAY_UPLOADED)

            {

                SUP101SampleActivity.this.runOnUiThread(new Runnable()

                {

                    public void run()

                    {

                        Toast.makeText(SUP101SampleActivity.this, "Synchronize done", Toast.LENGTH_SHORT).show();

                    }

                });

                if (SUP101SampleActivity.this.adapter != null)

                {

                    SUP101SampleActivity.this.adapter.refreshUI(false);

                }

            }

            return SynchronizationAction.CONTINUE;

        }

    }

Regards

Priti

Former Member
0 Kudos

IN <servername>-server log file

2014-02-07 09:18:12.907 INFO    MMS          Thread-181 [com.sybase.sup.jmo.notification.MessagingQueueNotificationProcessor] [] [] Number of batched messaging notifications processed 2

2014-02-07 09:21:40.421 INFO    MMS          Thread-82 [com.sybase.sup.jmo.services.Registration] [] [] Registration successful for Device: Simulator613a9bc5-6b6d-4d45-b0a9-a9a1521da706__customer User: supAdmin DevType: android ( iMO )

2014-02-07 09:21:44.812 INFO    MMS          Thread-181 [com.sybase.sup.jmo.notification.MessagingQueueNotificationProcessor] [] [] Pre-batching processed 1 items

2014-02-07 09:22:15.297 INFO    MMS          Thread-181 [com.sybase.sup.jmo.notification.MessagingQueueNotificationProcessor] [] [] Number of batched messaging notifications processed 1

TmHttpclientPool-323 [com.sybase.sup.server.http.TmApplicationHandler] [] [] On connection expired .....

2014-02-07 09:27:17.310 INFO    MMS          TmHttpclientPool-323 [com.sybase.sup.server.http.TmApplicationHandler] [] [] On connection expired .....

TmHttpclientPool-323 [com.sybase.sup.server.http.TmApplicationHandler] [] [] On connection expired .....

2014-02-07 09:27:17.310 INFO    MMS          TmHttpclientPool-323 [com.sybase.sup.server.http.TmApplicationHandler] [] [] On connection expired .....v

Thanks

Sunil

midhun_vp
Active Contributor
0 Kudos

Can you download the code sample code provided in this tutorial and compare the code to understand where you are missing,

- Midhun VP

midhun_vp
Active Contributor
0 Kudos

Give more details on the MBO you created, Load parameters if any,Personalization keys and sync keys. Use the SCC credentials for registration and synchronization.

- Midhun VP

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hey..

can you look at this discussion

Rgrds,

Jitendra