Dynamic Debugging of Services and Applications on Enterprise Server

Related Topics:

The Enterprise Server Dynamic Debugging option enables you to attach to, and debug, any application or service running on a local, or a remote, enterprise server. It requires no changes to the code of your program. It does however require that you turn on Dynamic Debugging for your enterprise server, that you compile for debug and that you deploy the dictionary (.idy) files for your application.

How it Works

When you start a debug session for a project that uses an enterprise server configured for Dynamic Debugging, you can tell the server that you want to debug any service or application instance that matches criteria that you supply. For example, you can specify that you want to debug instances of a given web service that are started from a particular client machine.

Each time an application or service is started the enterprise server checks to see if it matches the criteria that you supplied. If it does, the enterprise server attaches it to your debug session. You can then step through the application in the normal way.

How it Matches a Service or Application Instance to a Debug Session

Your match criteria can be specific or general. However, we recommend that you be as specific as possible to avoid conflicts with other users. If more than one user specifies details that match a particular service or application instance, the most specific match (that is, the session that provided the most specific information) will be attached to the instance.

Example
USERA specifies Web Services started from a particular client IP address
USERB specifies Web Services started from the same client IP address, but also specifies the service name.
When a matching web service is started, the enterprise server will attach USERB's debug session to the service.

When you specify the match criteria, you will be warned if they are similar to those provided by another user. If you specify identical match criteria to those provided by another user, you will receive an error message and the criteria will be rejected.

Note: You can view the active dynamic debug sessions and the associated debug criteria on your enterprise server by using the Dyn-Dbg button in ESMAC. You can also use the screen to remove debug criteria that are no longer required. To access ESMAC, see To start ESMAC for a server.

Overview of the Procedure

The process of dynamic debugging is very similar for all types of deployed applications.

How to use Enterprise Server Dynamic Debugging

  1. Connect to Enterprise Server Administration.

    To access Enterprise Server Administration

  2. Enable dynamic debugging for the enterprise server that you want to use for debugging.

    To enable dynamic debugging

  3. If you have not already done so, deploy the service or application to the server.

    You can deploy service interfaces by using the Deploy tool.

    To deploy a service interface using the Deploy tool

    For guidance on deploying CICS and JCL, please see the chapter CICS Walkthrough in your Mainframe Transaction Option Developer's Guide, and the chapter JCL Walkthrough also in your Mainframe Transaction Option Developer's Guide.

    Note: Please make sure to include the .idy files for the program in the set of files that you deploy.

  4. If your program is a service (Web Service or J2EE), as opposed to a CICS or JCL application, you will need to create a client program to submit requests for that service.

    To generate a COBOL client from a Web service interface

  5. In the Net Express IDE, make sure that you have a project open. The project does not have to contain the files for your application. For example, you could create an empty project to use for the debug session. However, if it does not contain the source or the .idy files for the application, you must ensure that the debugger can locate these files. To do this,

    You can set the environment variables in the Project Properties dialog.

  6. Configure the project to use the enterprise server.

  7. Click Animate->Start Animating from the IDE menus.
  8. Click the tab for the type of service or application that you want to debug and enter its details.

    For a Web Service, you can enter any combination of the following:

    For J2EE, enter the fully qualified name of the service.

    For CICS, you can enter any combination of the following:

    Note: For non-facility tasks (i.e. those which are not running on a terminal or printer) specify '....' for the value of the terminal ID.

    For JCL, you can enter any combination of the following:

  9. Click OK

    Net Express now passes the details that you entered to the enterprise server and waits for the service to start.

    Each time a service or application is started, the enterprise server will check to see if it matches the details that you provided. If it does, the enterprise server attaches the Net Express debugger to it.

  10. Start the service or application on your enterprise server. How you do this depends on what type of application it is.

    For example:

    When the service or application starts, the enterprise server will attach your Net Express debugging session to it.
  11. You can step through the deployed program(s) in the usual manner.
  12. When debugging reaches the exit program statement and no line is highlighted, the service or application has exited.

    The IDE debugger now waits for the next matching service or application to start.

  13. When you have finished debugging, click Animate > Stop from the IDE menus.

Related Topics:

Breakpoints and Monitors

You cannot set breakpoints prior to the time that the relevant program is loaded into your debugging session. In this context, the session starts when you start animating and ends when you close the project. As a consequence of this, you cannot save breakpoints or monitors between sessions. However, you can repeatedly debug the application or service during the debug session.

The Files Needed by the Enterprise Server

When you deploy your application to the enterprise server you must include the .idy files along with all the other files required by the application. The .idy files are created during the first stage of compilation and contain information required for debugging.

The Files Needed by the Debugger

The source files and the .idy files for the application must be available to the debugger.

Error Messages for Web Services

You may find, when you are debugging a Web service, that the client returns error 0015. This is a time-out, and is caused by the service not returning to the client in the expected time, because you were debugging it. If you find this a problem, you can change the time-out interval - edit the file mfclient.dat in Net Express\Base\bin and insert:

[default]
timeout=nn 

where nn is the desired timeout period in seconds (at run time the figure is rounded up to a multiple of 5).

Alternative Debugging Methods

If your enterprise server is running on the same machine as your debugger, you can use the following alternative methods for debugging.

Note: For examples of debugging methods for CICS applications, see the chapter of your Mainframe Transaction Option Developer's Guide.

For JCL applications, you can also start a debug SEP/initiator by using the ESMAC interface. For more information, see To use a debug service execution process for Enterprise Server debugging.

As an alternative to inserting the CBL_DEBUGBREAK command into the code of your program, you can compile it with the compiler directive INITCALL"CBL_DEBUGBREAK".

Related Topics: