on 06-17-2013 7:54 PM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
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
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.
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 .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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();
Hi Lucia,
Do you face this problem only in device or in emmulator alone.
Regards,
Srinivas Divakarla
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.