2017 June Release

Debugging Fabasoft app.ducx projectsPermanent link for this heading

Fabasoft app.ducx allows you to debug use case implementations written in Java or Fabasoft app.ducx Expressions from within your development environment.

Debugging the Java implementation of an Fabasoft app.ducx projectPermanent link for this heading

Before you can debug an app.ducx project in Eclipse, make sure that the COOJAVA_JVMOPTIONS environment variable is set to -agentlib:jdwp=server=y,transport=dt_socket,address=8000,suspend=n. You may also use a port other than “8000” by setting the address parameter to the desired value. Keep in mind, that only one JVM can be bound to the same socket, otherwise the JVM will not be initialized.

Note: You can also use the COOJAVA_JVMOPTIONS environment variable to set other parameters for the Java virtual machine, e.g. the -Xms and -Xmx parameters for defining the size of the heap space. Adjusting the size of the heap space might be necessary if you run into the following Java runtime error:

java.lang.OutOfMemoryError: Java heap space

The COOJAVA_JVMOPTIONS environment variable can also be individually defined for each web service instance in order to avoid conflicts if multiple web services are hosted on a single machine.

To define the COOJAVA_JVMOPTIONS environment variable for a particular web service instance, add the following entries to the registry:

[HKEY_LOCAL_MACHINE\SOFTWARE\Fabasoft\FscWeb\Modules\FSC]
@="C:/Program Files/Fabasoft/Components/Web/
1_FSC/ASP/content/bin/fscvext.dll"

[HKEY_LOCAL_MACHINE\SOFTWARE\Fabasoft\FscWeb\Modules\FSC\COOJAVA_JVMOPTIONS]
@="
-agentlib:jdwp=server=y,transport=dt_socket,address=8000,suspend=n"

Note: If you are manually adding the described entries to the registry using the Registry Editor, you have to create the keys that do not exist yet. The “@” character in the example refers to the “(Default)” registry value.

Adapt the path to the virtual directory associated with your web service as appropriate. The correct path can be obtained by carrying out the following steps:

  1. Start the Fabasoft app.ducx Tracer.
  2. Restart the Fabasoft Folio Web Service.
  3. Point your web browser to the Fabasoft Folio Web Service.
  4. Search the trace output for the modulepath variable. Copy the value into the default registry value of the registry key [HKEY_LOCAL_MACHINE\SOFTWARE\Fabasoft\FscWeb\Modules\FSC].

After setting the environment variable, the Fabasoft Folio Web Service must be restarted. If you are using Microsoft Internet Information Services to host the Fabasoft Folio Web Service, do not issue an iisreset command but restart the “World Wide Web Publishing Service” in the “Services” snap-in instead.

In order to verify that the remote debugging listening port has been installed correctly issue netstat -a | more and search the output for the specified listening port (e.g. 8000).

Furthermore, you have to create a new debug launch configuration in Eclipse. To do this, select the Debug from the Run menu. This will bring up the dialog box depicted in the next figure. Select “Remote Java Application” and click New Launch Configuration. Enter a Name for the debug launch configuration, select the Project, enter the name of the web server hosting the Fabasoft Folio Web Service in the Host field, click Apply to save your settings, and Debug to attach the remote debugger to the remote Java virtual machine.

Figure 22: Creating a new debug launch configuration in Eclipse

Once a debug launch configuration has been created, you can start debugging your Java use case implementations.

You can set breakpoints in your Java code by clicking Toggle Breakpoint in the context menu in the corresponding line of code. When you click Debug from the Run menu, select your debug launch configuration and click Debug to run your Fabasoft app.ducx project. Execution will stop when a breakpoint is reached to take you to the Eclipse Debugger (see next figure).

Figure 23: Debugging a Java use case implementation in Eclipse

For further information on how to debug Java projects in Eclipse, please refer to http://www.ibm.com/developerworks/library/os-ecbug/index.html.

Debugging the Fabasoft app.ducx Expression implementation of an app.ducx projectPermanent link for this heading

Debug configurationsPermanent link for this heading

You have to create a new debug configuration before you can debug an Fabasoft app.ducx project in Eclipse. To do so, click “Debug Configurations“ on the “Run” menu.

In the dialog box, select “Fabasoft app.ducx” click the “New launch configuration” symbol and enter a Name for the new launch configuration and select the Project by clicking “Choose“. To specify how the Fabasoft app.ducx project should be debugged, click the “Debug” tab. Following options are available:

  • Attach
    If this check box is selected, the Fabasoft app.ducx project is not uploaded before the debugging session starts.
  • Suspend
    • On error
      If this check box is selected, the execution stops on errors.
    • On warning
      If this check box is selected, the execution stops on warnings.
    • On commit
      If this check box is selected, the execution stops on commits of transactions.
    • On abort
      If this check box is selected, the execution stops on aborts of transactions.
    • On query
      If this check box is selected, the execution stops when a search query is executed.
    • Block until command
      If this check box is selected, the execution stops on break points.
  • Transport
    • Include result nodes
      If this check box is selected, the debug output is rich in detail. Keep in mind that the data to be transferred may be extensive.

Click “Apply” to save your settings, and “Debug” to debug the Fabasoft app.ducx project.

BreakpointsPermanent link for this heading

Breakpoints can be set in every app.ducx Expression block with one of the following methods:

  • Insert the %%DEBUGGER; directive in the Fabasoft app.ducx Expression.
  • Double-click on the left margin of the source code editor.
  • Select the desired line and use the shortcut Ctrl + Shift + B.
  • Open the “Run” menu and click “Toggle Breakpoint”.

Note: Microsoft Windows: To extend the time a thread is kept in the application pool when waiting on a break point, set the (Default) value to 2147483647 of following registry key:

[HKEY_LOCAL_MACHINE\SOFTWARE\Fabasoft\FscWeb\Modules\FSC\FSCVEXT_MAXREQUESTMSECS]
In normal circumstances this should not be necessary.

Debug perspectivePermanent link for this heading

The debug information is displayed in the debug perspective. To switch to the debug perspective, open the “Window” menu, point to “Open Perspective” and click “Other”. Select “Debug” and click “OK”. The Debug perspective provides you debugging information like the call stack, values of variables and so on.

Figure 24: Debugging an app.ducx Expression use case implementation in Eclipse

Following common debug commands are available:

  • “Resume”
    Resumes the execution until the next thread suspending event like a break point is reached.
  • “Terminate”
    Terminates the debugging session and the suspended threads resume.
  • “Step Into”
    The currently selected line is executed and the thread suspends on the next executable line of the called method, if the method is also implemented as Fabasoft app.ducx Expression within the same Fabasoft app.ducx project. Otherwise “Step Over” is carried out.
  • “Step Over”
    The currently selected line is executed and the thread suspends on the next executable line of the Fabasoft app.ducx Expression.
  • “Step Return”
    The currently selected line is executed and the thread suspends on the next executable line of the calling Fabasoft app.ducx Expression.