Remote Debugging
Remote Debugging
How Remote Debugging Works
- The application opens a socket and listens for debugging instructions.
- The debugger in the IDE connects to the same socket and sends debug commands.
- The debug port configured on the server must match the port used by the IDE.
Create the Environment
1Create a new environment
Sign in to the dashboard and click Create environment.

2Select the application server
Choose the required instance, such as Tomcat, configure the Cloudlet limit, enable a public IP, enter the environment name, and click Create.

3Copy the public IP
Expand the environment and open the additional node information to view the assigned public IP address.

Deploy the Application
1Upload the Java archive
Upload the Java package through Deployment Manager.

2Deploy the application
Select the newly created environment and deploy the uploaded package.

The example application initialises three variables one after another:
package com;
public class RemoteDebugger {
public void start () {
int a, b, c;
a = 1;
System.out.println("a = " + a);
b = 2;
System.out.println("b = " + b);
c = 3;
System.out.println("c = " + c);
}
}
Configure Remote Debugging
1Attach a debugger in the IDE
Open the project in an IDE such as NetBeans and select Debug Main Project > Attach Debugger.

2Configure the socket connection
Select the connector type, enter the public IP as the host, specify the debug port, and optionally define a timeout.

3Open Tomcat configuration
Return to the dashboard and click Config for the Tomcat node.

4Add debug JVM arguments
Open variables.conf and add:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5000

variables.conf must be identical to the port configured in the IDE debugger.Save the configuration and restart Tomcat.
Test with Breakpoints
1Add a breakpoint
Place a breakpoint before the final variable assignment and start the attached debugger.

Check the Tomcat logs. Only the first two values should be printed while execution is paused:

2Move the breakpoint
Move the breakpoint one line lower and continue debugging.


GlassFish Configuration
For GlassFish, add the debug arguments through the GlassFish Administration Console.
- Use the credentials sent when the environment was created to sign in to the GlassFish Admin Console.
- Open gfcluster-config > JVM Settings.
- On the General tab, configure the debug mode and debug options.
- Open JVM Options and add
-Xdebug. - Add
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5000. - Save all changes and restart GlassFish.



