You can debug Java services that have compiled successfully using the Eclipse Java debugger. The debugger connects to the server where your service runs, allowing you to step through the source code, investigate variables and the stack, and so forth, just as if you were debugging a local Java class.
However, you cannot debug services executed with the Dialog Service Test Wizard running in the same Eclipse process. The dialog service test wizard does not allow focus to switch to the Java debugger when breakpoints are reached in your Java service implementation.
In addition to using a debugger, you can also add tracing code to the service source. Any output written to System.out is logged in the EAServer log file.
Before beginning the debug process, verify that your Java service compiled successfully and there are no remaining errors.
To debug a Java service:
Create a test client to invoke the service methods, using the Web Service Client Wizard:
Select File|New|Other from the main menu bar.
Select Sybase|Services|Service Test in the Service Selection page and click Next.
Select Create Web Service Client Wizard from the Wizard Selection page and click Next.
Follow the instructions in the wizard to create the web service client.
See Testing a Service Using the Web Service Client Wizard for more information.
If the service is not deployed to the server that you want to debug against, create a service package and deploy it. If the service is already deployed, make sure the deployed implementation matches the source that you are debugging against. Redeploy if you have modified the source.
Configure the EAServer runtime that hosts your service to support remote debugging using the JPDA (Java Platform Debug Architecture) interface. If deploying to Unwired Orchestrator, follow these instructions.
If deploying to the EAServer Web services toolkit:
Start EAServer Manager and connect to the server.
Display the server properties. On the Java Debug tab, select Use JPDA and enter the number of a free port for the JPDA connection.
Restart the server in debug mode.
For more details, see Chapter 3, "Creating and Configuring Servers," in the EAServer System Administration Guide.
In Eclipse, create a Remote Java Application configuration to connect to the runtime server that hosts your service:
Switch to the Java or Debug perspective.
Choose Run | Debug ... from the main menu.
Select Remote Java Application and click New. Configure the following settings on the Connect tab:
Name – Specify a name for the configuration.
Project – Choose the project that contains the source for your service.
Connection type – Choose Standard (Socket Attach).
Host – Enter the host or IP address for the EAServer connection.
Port – Enter the EAServer JPDA port.
Leave other settings at their default values. Click Debug to close the Debug dialog and start the debugging session. The debugging session remains inactive until you run a test that executes a breakpoint in your service implementation.
Set breakpoints in the source for your service implementation using the Java source editor or the Source page in the Java Service editor. Directly to the left of the line where you want to add the breakpoint, right-click the marker bar (vertical ruler) and select Toggle Breakpoint. A new breakpoint marker appears on the marker bar, directly to the left of the line where you added the breakpoint. To remove a breakpoint, right-click on the breakpoint marker and select Toggle Breakpoint.
For more details on configuring breakpoints, see the Java Development User Guide.
Run your test client. When a breakpoint in the Java Service source is reached, Eclipse activates your remote debugging session, switching the to the Debug perspective where you can step through the code, investigate the stack, inspect variables, and so forth. For details on using the debugger, see the Java Development User Guide.
Developing a Services Package Profile
Developing a Deployment Profile
Running the Unwired Orchestrator Server in Java Debug Mode
Troubleshooting Java Service Runtime Errors
Java Development User Guide.
Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com