Home Step 05

Remote debugging tutorial

This tutorial is a feature of JBuilder Enterprise.

Step 6: Starting the server process and the client in debug mode and stepping into the cross-process breakpoint

This step tells you how to start both the server process and the client in debug mode in JBuilder, and then step into the cross-process breakpoint. Once you've started stepping, JBuilder allows you to step between the client and server. You will:

To start the server process in debug mode on the client computer (the computer running JBuilder),

  1. Click the down arrow to the right of the Debug Program button    on the main toolbar.

  2. Choose the Windows Run SimpleRMIServer configuration.

    Note: You do not need to start the RMI Registry on the client computer. It's already running on the remote computer.

  3. The debugger starts and pauses execution.

  4. Click the Resume Program button    on the debugger toolbar. The message SimpleRMIImplReady is displayed on the remote computer.

To start the client in debug mode on the client computer (the computer running JBuilder),

  1. Right-click the down arrow to the right of the Debug Program button    on the main toolbar.

  2. Choose the Windows Run SimpleRMIClient configuration.

  3. The debugger starts, and stops execution at the call to the server's getDate() method.

To step into the cross-process breakpoint,

  1. Click the debugger tab for the SimpleRMIClient process.

  2. Click the Step Into icon    on the client's debugger toolbar to step into the server-side breakpointed method. If you use Step Over, the debugger will not stop.

  3. Click the Step Into button three more times. The message SimpleRMIImpl getDate() is displayed on the remote computer.

  4. Continue to click Step Into until the client runs to completion. The SimpleRMIClient process in the debugger will look like this:

    The output from the server running on the remote computer will look like this:

    SimpleRMIImpl ready

    SimpleRMIImpl.getDate()

While starting the server or client in debug mode in JBuilder, you may see one of the following error messages:

RMI client/server error messages

Error message Description
connection refused The RMI Registry on the remote computer might not yet be running. Stop all processes and run the RMI Registry on the remote computer by entering start rmiregistry from the command line. (The Jdk1.3\bin folder must be in your path.) Restart the remote server and begin the debug process again.
Java exception: java.rmi.NotBoundException SimpleRMIImpl Instance You haven't yet started the server debug process. Click the Resume Program button    on the server's debugger toolbar. Start the client again in debug mode.

Congratulations! You have completed the tutorial. Using preset runtime configurations, you ran a RMI server on a remote computer. You then debugged the program using JBuilder's remote debugging features.

Home Step 05