Tracing a WebFaced Application


As discussed before, you want to investigate the reasons why your WebFaced application behaves differently than the 5250 application.

Locating the Tracing Files

  • Start Development Studio Client and go to the WebFacing perspective.

Before you start this exercise, make sure the application server in the test environment is stopped .

To stop the server,

  • Click the Server tab in the note book at the bottom right workbench pane.

If the application server is in Started status,

  • Right click the application server entry.

  • Select the Stop option from the pop-up menu, as shown in Figure 14.1.

    click to expand
    Figure 14.1: Stopping the server

Now use the Navigator view in the left upper pane of the workbench. If the Navigator view is not visible,

  • Click the Navigator tab at the bottom of the WebFacing Projects view.

  • Expand the wflabxx project.

  • Expand folder Web Content.

  • Expand folder WEB-INF.

  • Expand folder lib , as shown in Figure 14.2.

    click to expand
    Figure 14.2: Location of WFRun files shown in Navigator view

In the lib folder, you will find the WFRun.jar file. This is the WebFacing run time used to support your WebFaced user interface. There is also a WFRun_g.trace file. This is the same WebFacing run time but compiled with tracing enabled.

You need to disable the current run time by renaming it so that it becomes a dummy file, and then rename the tracing run time to WFRun.jar.

Tip  

A file called TracingReadMe.txt is also inside this folder. I strongly suggest that you read through this file to find more in-depth information about tracing in the WebFacing environment.

  • Right-click the WFRun.jar file icon.

  • Select Rename from the pop-up menu.

  • The cursor will be at the file name ; rename the file WFRun.jat.

  • Press the Enter key.

If you receive a message dialog as shown in Figure 14.3,

click to expand
Figure 14.3: Message that appears during rename of the WFRun.jar file
  • Click the Yes push button.

After the rename operation is completed,

  • Right-click the WFRun_g.trace file icon.

  • Select Rename from the pop-up menu.

  • The cursor will be at the file name; rename the file WFRun.jar. Your screen should look like Figure 14.4.

    click to expand
    Figure 14.4: WFRun files renamed

If the rename was successful,

  • Go to Changing Trace Flags (page 296).

If the rename does not work and an error displays,

  • Right-click WFRun_g.trace.

  • Select the Rebuild Project option from the pop-up menu.

After the rebuild is complete:

  • Right-click the WEB-INF folder icon.

  • Select the Refresh option from the pop-up menu.

Tip  

If you continue to encounter problems deleting the WFRun.jar file, I suggest that you shut down Development Studio Client and restart it; this will unlock all files.

Check the list in folder lib again. Three situations might occur:

  1. You might have the following three files in the list:

    • WFRun_g.trace

    • WFRun.jar

    • WFRun.jat

    This could happen if WFRun.jar was locked when you tried to edit the name.

    • Delete WFRun.jar.

    • Rename WFRun_g.trace to WFRun.jar as described in the previous section.

  2. You might have the following two files:

    • WFRun_g.trace

    • WFRun.jar

    This could also happen because of locked files. Begin the renaming task again. Go back up to the heading Locating the Tracing Files (page 296).

  3. You may have the following two files:

    • WFRun.jar

    • WFRun.jat

    If so, you are in good shape and may proceed to the next section.

Changing Trace Flags

Now that you have enabled the new WebFacing run time, you need to increase the flag values that indicate the level of tracing you desire .

In the Navigator view (Figure 14.5),

click to expand
Figure 14.5: Navigator view with tracing.properties file
  • Expand the wflabxx project icon.

  • Expand the Web Content folder.

  • Expand the Web-INF folder.

  • Expand the classes folder.

  • Expand the conf folder.

  • In the conf folder, locate the tracing.properties file.

  • Double-click tracing.properties to open the file in a text editor.

In the text editor, look for the lines containing the tracing flag settings. They are circled in Figure 14.6:

click to expand
Figure 14.6: Editor window with changed tracing flags
  • Change the JT_ERR level to 3 .

  • Change the JT_DBG level to 3 .

  • Change the JT_EVT level to 3 .

Find the JT_LOG flag.

  • Change the level to 1 , to indicate that you want to use a LOG file to record the trace data. You could also feed the trace data to the DOS console. The Trace Readme file contains details about how to set up the DOS console.

  • Save the tracing.properties file.

Now run the application again. In the Navigator or WebFacing Projects view,

  • Right-click the wflabxx project.

  • Select the Run on Server option from the pop-up menu.

If you encounter publishing errors,

  • Click the Navigator tab.

  • Right click the wflabxx project icon.

  • Select the Rebuild Project option from the pop-up menu.

After the rebuild is completed, run the application as described above.

  • Click on a link in the index.html page.

Because tracing is enabled, the application will run more slowly.

  • Go through a scenario to add one order:

    • Select a customer,

    • Select one part.

    • Confirm the order.

    • Exit the application.

Go to the Navigator view and look at the log file:

  • Right-click the wflabxx icon.

  • Select the Refresh option from the pop-up menu.

  • Expand the wflabxx project.

  • Expand the Web Content folder.

  • Expand the WEB-INF folder.

  • Expand the trace folder.

You should find a log file similar to the one shown in Figure 14.7.

click to expand
Figure 14.7: Log file in the Web Projects folder structure

To view the log file,

  • Double-click the .log file in the trace folder.

This opens an editor window with the content of the .log file. As you can see in Figure 14.8, there are many details captured in the log at this tracing level. For example, you can see the values the entry fields contain as they are passed to the program.

click to expand
Figure 14.8: .log file in editor window

You might have noticed that the WAS console also displays the following level of detail. You do not need to access the log file; you could just look at the console output and work with that information, shown in Figure 14.9.

click to expand
Figure 14.9: WAS console with detailed trace information

During normal operations, the tracing run time does not need to be enabled, but if problems occur in your environment or in the WebFacing run time, the trace information can give valuable feedback to determine the source of the problem.

Switching Back to the Default Run Time

Now that you know how to set up tracing capabilities in the WebFacing Tool, you can go back and work with the regular WebFacing run time.

First, stop the application server as described near the beginning of this chapter.

Then in the Navigator view,

  • Expand the wflabxx project.

  • Expand the Web Content folder

  • Expand the WEB-INF folder

  • Expand the lib folder.

  • Rename the WFRun.jar file back to WFRun_g.tracing.

  • Rename the WFRun.jat file back to WFRun.jar.

If you receive error messages during the renaming of these files,

  • Right click any file in the project.

  • Select the Rebuild Project option from the pop-up menu.

  • Try the rename again.

After successfully renaming these two files,

  • Expand the classes folder and then the conf folder.

  • Edit the tracing.properties files.

  • Change all tracing settings back to .

  • Save the file.

Your WebFacing project will return to nontracing mode.




Understanding the IBM WebFacing Tool. A Guided Tour
Understanding the IBM WebFacing Tool: A Guided Tour (IBM Illustrated Guide series)
ISBN: 1931182094
EAN: 2147483647
Year: 2003
Pages: 153

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net