on 2011 Dec 22 1:36 PM
The following error code is generated when we run the Android Java code for the synchronization:
com.ianywhere.ultralitejni12.implementation.JniException: UltraLiteJ Error[-1305]: MobiLink communication error -- code: 63, parameter: , system code: 101
This is a network level error, right? Source: http://dcx.sybase.com/index.html#1201/en/saerrors/mlcommerr63.html Due to a lack of knowledge of the hardware side, we don't know how to solve this. Which steps have we missed out?
Below some more information how we set up the server and client environment:
SQLAnywhere consolidated (server) database
We use SQL Anywhere database as the consolidated database. This database is set up using the Sybase Central application. We did the following actions:
Mobilink server
We made a new Mobilink project using the Sybase Central application create project wizard.
Ultralite remote (client) database
For the client database we use UltraliteJ with Android OS. The local database was created using Java code. We have generated a publication using the following Java code:
String createQuery = "CREATE PUBLICATION IF NOT EXISTS ActionsPubs (TABLE action, TABLE actionParameter)"; PreparedStatement ps = connection.prepareStatement(createQuery);
We connect using the SyncParms from the UltraliteJ API:
Connection conn = DatabaseManager.getConnection(context); createPublications(conn); SyncParms syncParms = conn.createSyncParms(SyncParms.HTTP_STREAM, config.getUsername(), "1.0" ); syncParms.setPassword(config.getPassword()); syncParms.setPublications(publications); StreamHTTPParms streamParms = (StreamHTTPParms) syncParms.getStreamParms(); streamParms.setHost("109.205.192.1"); streamParms.setPort(config.getPortNumber()); //portnumber is 3306 conn.synchronize( syncParms );
So when we debug, we get the error mentioned above after passing the conn.synchronize(syncParms); line.
Is there any advice on where to look and check for this problem? Thanks in advance!
Request clarification before answering.
The problem is finally solved with the help of Bill Frier, Jeff Albion, Andy Quick and Volker Barth. I will summarize below what I have changed during problem solving.
From this point I have connection the Mobilink server, but I get other errors.
So after these changes I am able to synchronize between the Android Ultralite remote database and the SQLAnywhere database. Thanks to all the persons who contributed in this thread!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
StreamHTTPParms streamParms = (StreamHTTPParms) syncParms.getStreamParms(); streamParms.setHost("109.205.192.1"); streamParms.setPort(config.getPortNumber()); mlsrv12 -c "dsn=mobiel-cmp;uid=xxx;pwd=xxx" -x tcpip(port=3306)
You're requesting HTTP synchronization from your UltraLiteJ client code (which is the only protocol UltraLiteJ supports), but starting a regular TCP listener (-x tcpip) on your MobiLink server. You'll need to start the HTTP protocol instead, using "-x http":
mlsrv12 -c "dsn=mobiel-cmp;uid=xxx;pwd=xxx" -x http(port=3306)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How can I see this Mobilink server can communicate with the application?
This sounds like you have a general networking issue that you need to resolve with traditional network diagnostics. (e.g. WireShark)
Now it appears that the HTTP socket you have specified on the host is no longer open (closed) - it was filtered (open) when I checked it last.
You can check a remote port's status using nmap.
=========== Host is up (0.15s latency). PORT STATE SERVICE 3306/tcp closed mysql ===========
Being a gateway machine, does this mean it has two or more NICs? If yes, MobiLink may not be listening on the one you expect. Try specifying the HTTP (or HTTPS) host option. Something like,
mlsrv12 -c "dsn=mobiel-cmp;uid=xxx;pwd=xxx" -x http(host=109.205.192.1;port=3306)
If this doesn't help you should check the MobiLink log for clues. The mlsrv12 -ot and -v options can help with this.
The host option is used to specify the host name or IP number on which the MobiLink server should listen. The way I read your question, you want the ML server to listen on the public IP. In the sample mlsrv12 command line above, that is done with,
-x http(host=109.205.192.1;port=3306)
It is common to want the ML server and its consolidated database behind a firewall. In such a case you would would specify the internal IP and port and ensure that your router/firewall allows the communication to get through or use something such as Sybase Relay Server to relay the communication across the firewall without the need to open any inbound ports.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The host option is used to specify the host name or IP number on which the MobiLink server should listen. The way I read your question, you want the ML server to listen on the public IP. In the sample mlsrv12 command line above, that is done with,
-x http(host=109.205.192.1;port=3306)
It is not uncommon to want the ML server and its consolidated database behind a firewall. In such a case you would would specify the internal IP and port and ensure that your router/firewall allows the communication to get through or use something such as Sybase Relay Server to relay the communication across the firewall.
Thank you all so much for the quick responses!
So far I tried to connect with the following command: mlsrv12 -c "dsn=mobiel-cmp;uid=xxx;pwd=xxx" -x http(host=109.205.192.1;port=3306) I got the error that the host is a public address.
So I tried using the internal address 109.205.192.234, which is an Ethernet adapter 109. No error upon that and the Mobilink server runs.
Now I still have to test the connection, but come across other problems which I need to resolve first. So I will keep this thread updated when I progress.
I will reply in a new comment about the progress.
There are two NICS, currently it is listening to the correct NIC called 109 with the following address: IPv4 address: 109.205.192.234 It is not possible to PING to that address due to security reasons, so instead the port has been opened in the firewall. A telnet connection to that address should be okay anyway.
The SQL Anywhere database is started with: dbsrv12 "mobiel-cmp.db"
The Mobilink server is started with: mlsrv12 -c "dsn=mobiel-cmp;uid=xxx;pwd=xxx" -x http(host=109.205.192.234;port=3306)
Now when I run the application I get the following new error: com.ianywhere.ultralitejni12.implementation.JniException: UltraLiteJ Error[-857]: Synchronization failed due to an error on the server: [-10368] Unable to complete the request
Any idea what is going on?
The -857 error indicates a server error. You will need to check the ML server log to diagnose server side problems. Generally it is easiest if you log output to a file. In the log file, error lines start with 'E.'. Warnings can also be helpful and they are prefixed with 'W.'.
I get the error message previously I had again, which is so annoying... >_< com.ianywhere.ultralitejni12.implementation.JniException: UltraLiteJ Error[-1305]: MobiLink communication error -- code: 63, parameter: , system code: 101
I specified the log option when starting the mobilink using the command: mlsrv12 -o mlsrv.log -c "dsn=mobiel-cmp;uid=xxx;pwd=xxx" -x http(host=109.205.192.234;port=3306)
I don't see errors in the log file: mlsrv.log.
I have a question about the SQLAnywhere database. I saw it is started automatically on the port 2638. Database server started at Tue Jan 17 2012 19:39 Trying to start SharedMemory link ... SharedMemory link started successfully Trying to start TCPIP link ... Starting on port 2638 TCPIP link started successfully
So should the ports of the Mobilink and the database server be the same?
No, MobiLink and SQL Anywhere Server must be different ports if they are running on the same machine.
It looks like the communication from the client app is once again not getting through to the MobiLink server. If you add a -v to your MobiLink command line you will see lines like the following in the log file when the client attemps to connect,
I. 2012-01-17 14:46:44. <1> Request from "UL 12.0.1.3505" for: remote ID:...
I. 2012-01-17 14:46:44. <1> Synchronization connection connected
Has the client app been update to use the new IP address?
The client app is using the new IP address.
Anyway after putting -v into the mobilink command line I get the following:
I. 2012-01-18 10:34:17. <1> Request from "UL 12.0.1.3457" for: remote ID: d5b17150-2c2a-11e1-8000-afbeb0a6b374, user name: mobielcmp, version: Mobiel-CMP 1.0 E. 2012-01-18 10:34:18. <1> [-10013] Version 'Mobiel-CMP 1.0' not found in the ml_script_version table. Cannot synchronize I. 2012-01-18 10:34:18. <1> Synchronization failed
Does this mean the connection is made successfully?
For the remote ID, unless it you have multiple clients trying to sync, I would expect the remote ID is for the remote you are syncing. A simple way to check is to sync a couple of times. If the remote IDs listed in the log match and correspond to the times you initiate a sync, then the ID is associated with the instance with which you are working. If you want to check more precisely, the actual remote ID is stored in the ml_database table. To map it back to a MobiLink user, you will need to trace it through the ml_subscription table to the ml_user table.
See writing download_cursor scripts for details on writing them yourself. Normally these are defined in the MobiLink synchronization model. This is described in Modifying the download type.
In your original post, you said deployment was successful. Did you add the action table after you created and deployed your model? Do you have multiple versions of your scripts?
Note: If you specifically want to ignore required scripts such as download_cursor, you can tell MobiLink to ignore them using the --{ml_ignore} prefix.
Okay I have figured out when I get this particular error. "com.ianywhere.ultralitejni12.implementation.JniException: UltraLiteJ Error[-1305]: MobiLink communication error -- code: 63, parameter: , system code: 101"
When I use the internet connection at home I receive the above error. I have turned off the firewall on my computer but still receives that error. Maybe the port is blocked on the modem. At work I can make the Mobilink connection, but I still need to fix errors like the error about the download cursor script.
Back to your comment. I generated the synchronization model using the Sybase Central wizard. I can't remember if I created the table action after the deployment. But I did an update on the synchronization schema, so I think this way the table action is added in the synchronization table? When I click on the synchronization model I see a table mappings with consolidated tables, the action table is in the list and the direction of synchronization is bi-directional. I've made a screenshot of it: http://s14.postimage.org/xmrwvy6up/Screen_shot_2012_01_18_at_21_37_39.png
As for the versions, I'm not sure if I have multiple versions, but I can see there are two version_id rows in the ml_script_version table: Mobiel-CMP-Sync Mobiel-CMP-Synchronization Here is the screenshot: http://s13.postimage.org/rtuoaboyv/Screen_shot_2012_01_18_at_21_58_04.png
What can I try next?
Based on the screen shots it looks like your most recent deployment of your sync model would be using the Mobiel-CMP-Synchronization script version. Make sure your client app uses this script version. If you are still getting errors about missing scripts, please check that you are deploying to the right consolidated database.
I just changed the script version to Mobiel-CMP-Synchronization and the synchronization is done successfully! Now I'm getting other Ultralite errors, but that is off topic and I can fix that.
Thank you very much for the help. How do I close this thread? Which reply should I mark as the answer?
I guess it's common practise here to "close" threads by just accepting one answer - you can also "close" the question itself, but that is rarely used.
If none of the answers here seems fitting as "solution", feel free to add one answer on your own to "summarize" the steps that helped to get you going, and accept that one:)
FWIW: That's just my way of acting here, please treat that as a mere suggestion, fortunately there's no "right or wrong behaviour" in this forum...
FWIW, I moved up some details to this answer from a comment, because I think the essence of the solution around the -63 error was around gateway and firewall in this issue. However, I upvoted Jeff's answer because that would have been the next problem to solve. There were a few other things that came up along the way too. A team effort. Thanks everyone!
Yanny,
Yes, this is a network error. Please provide details about the MobiLink server and client. Is the UltraLiteJ application running in the emulator? Or, is it running on a device? If so, what is the network being used? Is the server reachable via that IP address from a web browser? Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The default gateway IP address is 109.205.192.1. This is the address of the computer where the SQLAnywhere and Mobilink is installed. If we type in the default gateway address in the web browser we can see it's up and running. Try it yourself.
But I'm wondering if the Mobilink server is using the same address as the default gateway address?
Anyway, we started the Mobilink server using this command line: mlsrv12 -c "dsn=mobiel-cmp;uid=xxx;pwd=xxx" -x tcpip(port=3306)
The UltraliteJ application is running on a mobile device. What address this one is using I really don't have any idea.
The fact that you can browse to the host that is running MobiLink indicates that you have network connectivity.
Does your application have permissions to make an internet connection? This line should be in your AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET"/>
You could also try a Wifi connection, if the host running MobiLink is addressible on a Wifi network.
User | Count |
---|---|
52 | |
8 | |
5 | |
5 | |
5 | |
5 | |
5 | |
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.