Apama 10.3 | Apama Documentation | Using Apama with Software AG Designer | Debugging JMon Applications | Preparing the correlator for remote debugging
Preparing the correlator for remote debugging
Launching the correlator with the –j option enables the Java Virtual Machine (JVM) as a subprocess in correlator execution. When launching an Apama project in Software AG Designer, specification of the -j option launches the correlator and launches its JVM as an external process. Consequently, you must enable a socket connection to the JVM so that you can connect the Software AG Designer debugger to it. This also applies to launching a correlator through any other means.
Enable debugging in the correlator JVM by specifying the Java options for the correlator component in the launch configuration. The Java Debug Wire Protocol (JDWP) is the protocol used for communication between a debugger and the Java virtual machine (VM) that it debugs. Oracle's VM implementations require command-line options to load the JDWP agent for debugging. JDWP is optional; it might not be available in some implementations of the Java™ 2 SDK. The existence of JDWP can allow the same debugger to work.
From Java 5.0 (or 1.5.0) onwards, specify the -agentlib:jdwp option to load and specify options to the JDWP agent. For Java releases prior to 5.0, the -Xdebug and -Xrunjdwp options are used. (The 5.0 implementation also supports the -Xdebug and -Xrunjdwp options but the newer -agentlib:jdwp option is preferable as the JDWP agent in 5.0 uses the JVMTI interface to the VM rather than the older JVMDI interface.) Specify this option in the correlator component in your launch configuration or when launching the correlator independently:
-J -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n
This tells the JVM to use a socket transport on port 8787. You can change this at will and use your own options. For more Java debugging/agent options, see https://docs.oracle.com/javase/8/docs/technotes/guides/jpda/conninv.html#Invocation.
To launch the correlator with Java and remote debugging enabled, you can use a command line or Software AG Designer.
On the command line, invoke the correlator with the following arguments:
correlator -l ApamaServerLicense.xml -j -J
In Software AG Designer, invoke the correlator as follows:
1. From the Software AG Designer menu, select Run > Run Configurations.
2. Click the Components tab.
3. Select the correlator you want to start and click Edit.
4. Enter the following in the Extra command line arguments field:
-J -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n
5. Select OK and then Run to start the correlator.
The correlator is now enabled for Java debugging. The next section discusses how to connect to the correlator with the Software AG Designer debugger.

Copyright © 2013-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.