The Adelia Cloud debugger works in a similar way to the Java multithreading daemon: the Tomcat JVM is started up with the support of Java and Adelia debugging.
A special Java Middleware daemon connects to it and serves as a proxy for the debugger. One or more Adelia debugger instances may connect to the proxy.
It is therefore possible to run several instances of the Adelia debugger, working with different profiles and/or in different Cloud sessions.
Application server JVM setup
Java and Adelia debugging support must be started up on the application server JVM. This is done by adding the following parameters to the Java command line:
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 -Xdebug -Xnoagent -Djava.compiler=NONE -Dadelia.debuggingsupport
The specified parameters activate JDI (Java debug interface) support on port 8000 and tell Adelia to generate additional information for the debugger.
At this stage, it is potentially possible to debug a program but the debugger is not active.
Starting the debugger's "proxy" daemon
The proxy is a classic Adelia daemon through which the user passes an additional parameter to attach it to the JVM he/she wishes to debug. The syntax is the same as for starting up a debugging proxy on the classic Java Middleware server.
A command file (cloudDebugger.bat) is provided in Windows. The call syntax is as follows:
cloudDebugger [-t [adelia_port [jdi_port [server_host_name]]]]
The parameters must be provided from left to right. The final parameters may be omitted. In this case, the default value is used.
Parameter |
Default |
Description |
-t |
Trace mode (running java.exe instead of javaw.exe). |
|
adelia_port |
4000 |
Proxy daemon port. |
jdi_port |
8000 |
JDI port open on the Web application server. |
server_host_name |
localhost |
Host name of the machine hosting the Web application server. |
Generally speaking (manual startup), "adeljrt.jar", "adeljtools.jar" and "tools.jar" jars must be referenced in the classpath:
set CLASSPATH=%ADELIWS%\javarun\adeljrt.jar;%ADELIWS%\javarun\adeljtools.jar;%JAVA_HOME%\lib\tools.jar;%CLASSPATH%
%JAVA_HOME%\bin\java -Dadelia.jdiport=8000 -Dadelia.clouddebugger=true com.hardis.middleware.MwServer 4000 MT
The variable "adelia.jdiport" points to the open JDI port on the Web server. Here our proxy listens to port 4000. Once the proxy has been started, it is possible to debug.
Notes:
- It is highly recommended that the same JDK is used to start the application server and the proxy daemon. This is to make sure that the version of tools.jar used is compatible with the debugged VM.
- The Adelia debugger uses a middleware profile called "DEBUGGER" to connect to the debugging proxy. It is possible to create this profile in a classic client/server configuration.
- It is possible to specify additional parameters to simplify the configuration:
-Dadelia.clouddebugger=true
If this parameter is specified, the daemon will not load the normal server config but will create a server config in which the DEBUGGER user will be created automatically.
-Dadelia.debuggerpassword=<password>
Only if "adelia.clouddebugger=true". If this parameter is specified, the DEBUGGER profile will be protected by the specified password, otherwise it will be created without a password.