Contents Index Methods Handling MobiLink server errors in Java

MobiLink Synchronization User's Guide
  Writing Synchronization Scripts in Java
    Writing Java synchronization logic

Debugging Java classes


MobiLink provides various information and facilities that you may find helpful when debugging your Java code. This section describes where you can find this information and exploit these capabilities.

Information in the MobiLink synchronization server's log file 

The MobiLink synchronization server writes various related information to its output log file. The synchronization server log file contains the following information:

Using a Java debugger 

You can debug your Java classes using a standard Java debugger. Specify the necessary parameters using the -sl java option on the dbmlsrv9 command line.

For more information, see -sl java option.

Specifying a debugger causes the Java virtual machine to pause and wait for a connection from a Java debugger.

Printing information from Java 

Alternatively, you may choose to add statements to your Java methods that print information to the MobiLink output log, using java.lang.System.err or java.lang.System.out. Doing so can help you track the progress and behavior of your classes.

Performance tip 
Printing information in this manner is a useful monitoring tool, but is not recommended in a production scenario.

The same technique can be exploited to log arbitrary synchronization information or collect statistical information on how your scripts are used.

Writing your own test driver 

You may wish to write your own driver to exercise your Java classes. This approach can be helpful because it isolates the actions of your Java methods from the rest of the MobiLink system.


Contents Index Methods Handling MobiLink server errors in Java