cancel
Showing results for 
Search instead for 
Did you mean: 

Communication error, problem synchronizing with Android using SUP2.2

Former Member
0 Kudos

Hello, I'm having problem synchronizing my application.

I followed the steps explained in this post http://scn.sap.com/community/mobile/blog/2012/05/02/sup-212-native-android-mbo-non-doe-based-approac... to configure the application to go through relay server. I had a previous installation that worked great buy now I'm having some difficulties.

I manage to register the application correctly, I can see it in SCC but when it tries to synchronize I get a communication error.

The exception is as follows:

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

StreamErrorCode = 63

StreamErrorMessage = null

I read it may have something to do with a socket that cannot be opened but I don't know how to search for the communication error. Any ideas?

When I try the deploy on a different sup server with the relay server in the same computer, the application works. I'm not sure what it may be.

Thanks in advance,

Lucia Cianelli

Accepted Solutions (0)

Answers (5)

Answers (5)

nicola_balloni
Explorer
0 Kudos

Hi Lucia,

this code works (I had to open a ticket for it) :

private static String USERNAME = "supAdmin";

private static String PASSWORD = "yourPWD";

private static String HOST = "99.99.99.99";

private static int CONN_PORT = 80; // 5001

private static int SYNC_PORT = 80; // 2480

private static String RBS_FARM = "RBS-farm";

private static String MBS_FARM = "MBS-farm";

private static int TIMEOUT = 40;

private static String ENCRYPT_KEY = "12345678901234567890";

private static String SYNC_NETSTREAMPARAMS = "url_suffix=/ias_relay_server/client/rs_client.dll/"+ RBS_FARM; // + "/";

private static final int REQUEST_DETAIL = 99;

private static volatile boolean initializationDone = false;

@Override

public void onCreate(Bundle savedInstanceState) {

          super.onCreate(savedInstanceState);

          initializeApplication();

}

private void initializeApplication() {

          Log.i("Log", "@@@ Startd Dialog ");

          app = Application.getInstance();

                    if (app.getApplicationIdentifier() == null) {

                              app.setApplicationIdentifier("XXXXXX");

                    }

                    app.setApplicationContext(this);

                    new Thread() {

                              public void run() {

                                        try {

                                                  Log.i("Log", "@@@ Application ");

                                                  Application app = Application.getInstance();

                                                  ConnectionProperties connProps = app.getConnectionProperties();

                                                  LoginCredentials loginCredentials = new LoginCredentials(USERNAME, PASSWORD);

                                                  connProps.setLoginCredentials(loginCredentials);

                                                  connProps.setServerName(HOST);

                                                  connProps.setPortNumber(CONN_PORT);

                                                  connProps.setFarmId(MBS_FARM);

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

                                                            Log.i("Log", "@@@ START - Register application ");

                                                            app.registerApplication(TIMEOUT);

                                                            Log.i("Log", "@@@ END - Register application ");

                                                  } else {

                                                            Log.i("Log", "@@@ START - Start application ");

                                                                      app.startConnection(TIMEOUT);

                                                            Log.i("Log", "@@@ END - Start application ");

                                                  }

                                                  XXXXXXXXXDB.registerCallbackHandler(new CustomerDBCallback());

                                                  XXXXXXXXXDB.setApplication(app);

                                                  ConnectionProfile connProfile = XXXXXXXXXDB.getConnectionProfile();

                                                  // encrypt the database

                                                  connProfile.setEncryptionKey(ENCRYPT_KEY);

                                                  // use 100K for cache size

                                                  connProfile.setCacheSize(102400);

                                                  connProps.setFarmId(RBS_FARM);

                                                  connProfile.save();

                                                  ConnectionProfile syncConn = XXXXXXXXXDB.getSynchronizationProfile();

                                                  syncConn.setServerName(HOST);

                                                  syncConn.setNetworkStreamParams(SYNC_NETSTREAMPARAMS);

                                                  syncConn.setPortNumber(SYNC_PORT);

                                                  syncConn.setEncryptionKey(ENCRYPT_KEY);

                                                  syncConn.enableTrace(true);

                                                  syncConn.setMaxDbConnections(6);

                                                  syncConn.save();

                                                  XXXXXXXXXDB.openConnection();

                                                  XXXXXXXXXDB.getLogger().setLogLevel(LogLevel.OFF);

                                                  Log.i("Log","@@@ Controllo che il db sia sincronizzato");

                                                  if (!XXXXXXXXXDB.isSynchronized("default")) {

                                                            Log.i("Log", "@@@ Database non sincronizzato ");

                                                            XXXXXXXXXDB.disableChangeLog();

                                                            Log.i("Log", "@@@@ pre syn/sub");

                                                            XXXXXXXXXDB.synchronize();

                                                            Log.i("Log", "@@@@ post syn/sub");

 

                                                            // Repeat for all your Sync Group!!!

                                                            SynchronizationGroup sg = XXXXXXXXXDB.getSynchronizationGroup("default");

                                                            sg.setEnableSIS(true);

                                                            sg.setInterval(5);

                                                            sg.save();

  

                                                            // Set your Synchronization Parameter

                                                            ONEOFYOURSMBOSynchronizationParameters cp = ONEOFYOURSMBO

                                                                                .getSynchronizationParameters();

                                                            cp.setDevicename(MyProperties.getInstance().getDevice_number());

                                                            cp.save();

                                                            XXXXXXXXXDB.synchronize();

                                                  }

                                                  Log.i("Log", "@@@ Database sync ");

                                                  if (!XXXXXXXXXDB.databaseExists()) {

                                                            Log.i("Log", "@@@ Database not exist ");

                                                  }

                                                  XXXXXXXXXDB.enableChangeLog();

                                        } catch (Exception e) {

                                                  e.printStackTrace();

                                                  Log.e("Log", "Log", e);

                                        } finally {

                                                  initializationDone = true;

                                        }

                                        MainActivity.this.runOnUiThread(new Runnable() {

                                                  public void run() {

                                                  // Initialize Activity graphics

                                                            initGraphics();

                                                  }

                                        });

                              }

                    }.start();

          }

I hope this help!

Regards,

Nicola.

Former Member
0 Kudos

I tried everything you suggested but it's still not working. The application subscribes correctly but it does not synchronize. I attach the images from our sup configuration for the relay server and the file rs.config to see if you can find anything that might be wrong. Any help would be great! we have no idea what else to try!

Thanks in advance,

Lucía Cianelli

Former Member
0 Kudos

I attach more images from SCC and some log files from rsoe to see if you can help.

Thanks,

Lucía

midhun_vp
Active Contributor
0 Kudos

Finally, Are you synchronizing using the "supAdmin" user if no please try with the "supAdmin" user?

If you try to use a user without admin role you will not be able to sync ( Ex: If you have created a user under application connections ). In the production environment you need to use LDAP user.

- Midhun VP

Former Member
0 Kudos

Hi Midhun,

Thanks for your help but I'm using "supAdmin" so it's something else.

Any other ideas?

Regards,

Lucía Cianelli

midhun_vp
Active Contributor
0 Kudos

Former Member  The log tells that "The backend farm is disabled according to the relay server configuration". That means the farm ID you are providing is wrong or it is not configured correctly.

Please check it.

- Midhun VP


Former Member
0 Kudos

Lucia,

Do you see any errors at your RSOE, is it's status is showing as running? you are using sybase hosted relayserver or you have a relayserver of your own.. by any chance your subscription of the relayserver is expired !!! you have to renew it then!!!

Regards,

Srinivas Divakarla

Former Member
0 Kudos

We checked that, it was because of a change we had made to test the behaviour but now it doesn't show that error anymore.

Any other ideas?

Thanks,

Lucía

Former Member
0 Kudos

Hi Srinivas,

I don't see any errors in my RSOE logs, I attach them here. The only thing that could be something wrong is an HTTP message with code 204 but I'm not sure.

I have my own installation of the relay server.

Any other ideas? Any help would be great!

Lucía Cianelli

brenton_ocallaghan
Active Participant
0 Kudos

Hi Lucia,

Had a quick glance through your code, I'm not seeing where you are setting the protocol being used to do the synchronisation.

So you say it is connecting - this is good as it means you are getting past the first stage and your problems lie in the sync settings. For synchronising you need to provide your host, port and also your protocol (as well as some network stream parameters in certain scenarios).

If the app is trying to connect over HTTPS (using SSL) and your relay server only accepts HTTP then you might see an error 63 or vise versa for that matter.

If you are connecting over HTTPS then if the server's CA is not embedded in the app and set in the stream parameters of your synchronisation connection you would also see errors like this.

This URL is a really good reference for understanding error codes BTW.

Hope that helps,

Brenton.

DoanManhQuynh
Active Contributor
0 Kudos

Hi Lucia.

I used to got this error too. I solved by input stream parameter like this:

trusted_certificates=;compression=zlib;url_suffix=ias_relay_server/client/rs_client.dll

hope it work with yours .

midhun_vp
Active Contributor
0 Kudos

Have you debugged the program? In which line of code the issue comes?

Can you try calling the subscribe() method where you are doing the registration.

- Midhun VP

Former Member
0 Kudos

Hi Midhun,

I debugged it and the issue comes in the line where we are making the first synchronization.

I attach the files. The exception happens in line 278 of the file main.

Where do I do the subscribe() ? How would the line to add be?

Regards,

Lucía

midhun_vp
Active Contributor
0 Kudos

Can you please try after adding below code after the line "cprof.save();"

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

                                                  PlanFiaV2DB.subscribe();

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

                                                  PlanFiaV2DB.submitPendingOperations();

- Midhun VP

Former Member
0 Kudos

Hi Lucia,

Ensure to call subscribe() before calling synchronize()

Regars,

Srinivas Divakarla

Former Member
0 Kudos

Hi Lucia,

Do you face this problem only in device or in emmulator alone.

Regards,

Srinivas Divakarla

Former Member
0 Kudos

Hi Srinivas,

The issue happens in the device.

Regards,

Lucía