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.

asked 05 Jul '11, 21:01

SYCHEE's gravatar image

SYCHEE
1112
accept rate: 0%


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.

permanent link

answered 05 Jul '11, 21:36

Tom%20Slee's gravatar image

Tom Slee
1.3k21629
accept rate: 29%

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!

(06 Jul '11, 10:36) PhilippeBert...

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.

permanent link

answered 05 Jul '11, 21:21

PhilippeBertrand%20_SAP_'s gravatar image

PhilippeBert...
1.8k42139
accept rate: 22%

edited 05 Jul '11, 21:32

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.

permanent link

answered 05 Jul '11, 21:52

SYCHEE's gravatar image

SYCHEE
1112
accept rate: 0%

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.

permanent link

answered 05 Jul '11, 22:13

SYCHEE's gravatar image

SYCHEE
1112
accept rate: 0%

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!

(06 Jul '11, 10:39) PhilippeBert...
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×160
×84
×79

question asked: 05 Jul '11, 21:01

question was seen: 8,295 times

last updated: 06 Jul '11, 10:39