cancel
Showing results for 
Search instead for 
Did you mean: 

MobiLink communication error when calling synchronize() in Android Virtual Device (using UltraliteJ)

Former Member
0 Kudos
8,757

Hi, I need some help, hopefully someone can help me get over this error as I have tried searching Sybase documentation but can't find a solution to it.

I have already setup my mobiLink server to listen using HTTP protocol at Port 80 (When I deploy the Synchronization Model) and use the .bat file to startup the mobiLink server. The server is up and running but when it hits conn.synchronize() method, I was thrown with an error.

SyncParms syncParms = conn.createSyncParms(SyncParms.HTTP_STREAM, "OPS_ML_USER", "OPS_SYNC_SCRIPT_VERSION" ); StreamHTTPParms streamParms = syncParms.getStreamParms(); streamParms.setHost("10.0.2.2"); streamParms.setPort(80); conn.synchronize(syncParms); << ---- Error got thrown in my Android Logcat when it hits this line.

Error display at the Logcat: 07-05 16:07:45.532: VERBOSE/com.test.ops.dbase.PersonDB(339): com.ianywhere.ultralitejni12.implementation.JniException: UltraLiteJ Error[-1305]: MobiLink communication error -- code: 58, parameter: , system code: %3

I am running my code (UltraliteJ) in Android Emulator and using SQL Anywhere 12.0.1.

Is there anything that I have done wrong. Please help me. Thanks.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member

MobiLink communication error code 58 is "unable to create a TCP/IP socket" (see http://dcx.sybase.com/index.html#1201/en/saerrors/mlcommerr58.html).

That makes me wonder if you have given your application permission to access the Internet. One symptom of this cause is that you see the error on synchronize() thrown immediately the function is called in your code (rather than, for example, after some timeout).

To give your application permission to access the Internet, open your AndroidManifest.xml file, click Permissions on the tabs (along the bottom), click Add and choose "Uses Permission" from the list in the modal dialog. You are given a dropdown list; select android.permission.INTERNET.

philippefbertrand
Participant
0 Kudos

I tried looking up the error code but saw "Each error has a numeric error code. Negative codes are errors, and positive codes are warnings." which threw me off. Server error codes are negative. Communication error codes are positive!

Former Member
0 Kudos

Thank you all for helping me. 🙂

I manage to solve the problem. I found out that I have not grant INTERNET permission to my app.

philippefbertrand
Participant
0 Kudos

I'm use to older BlackBerry simulators/devices which have sane defaults for the permissions. Newer BlackBerry devices are like Androids and require resetting the permissions everytime you re-install the app. Argh!

Glad you solved it. Drop me or Tom a line about what your project is about - firstname.lastname at sybase.com. Best of luck on your project!

Former Member
0 Kudos

Hi, thanks for the reply 🙂

The following is the startup script: mlsrv12 -v+ -zu+ -c "DSN=OPS_DSN;UID=OPS;PWD=PASSWORD" -x http(port=80) -ot ml.mls

When I try http://10.0.2.2:80 on the emulator browser, it shows the following error: Document Not Found The document cannot be found

I manage to get CustDB to sync on my android.

I follow all the steps to setup the synchronization model and deploy it to get the .bat files.

Kindly advise. Thanks.

philippefbertrand
Participant
0 Kudos

The first step would be to check the MobiLink log to see if the client attempted to connect.

Double check the MobiLink batch file to ensure it is using "-x http".

Using the browser on the emulator, can you reach the MobiLink server?

Where you able to get the tutorial to work?

Another thing that frequently happens when using port 80 is that the port may already be in use (IIS on Windows). Make sure MobiLink launched properly and stayed up.