Remote Debugging
This guide has been reviewed and reformatted for Ruk-Com Cloud PaaS. Screens may vary slightly by platform version.
Click or tap a screenshot to view it at its original size.
Objective
This guide explains how to use Remote Debugging on Ruk-Com Cloud PaaS, with ordered procedures and practical verification points.
Before you begin
- Sign in with an account permitted to manage the relevant environment.
- Confirm the target environment, region and resources before saving changes.
- Create a backup or rollback plan before changing a production system.
Using a public IP enables remote debugging. You can debug your application within the Ruk-Com Cloud platform by connecting to the code in your IDE. As a first step, let's consider the basics of remote debugging.
How does Remote Debugging work?
Java provides this feature using a listener binding mechanism. The basic idea is quite simple and basic:
- The application to be debugged attaches a socket to itself and then listens for debugging instructions on that socket.
- The Debugger binds itself to that socket and sends instructions on that socket.
Creating the Environment
1. Login to Ruk-Com Cloud Dashboard.
2. Click New Environment to set a new environment.

3. Select the instance you want to use. (For example,Tomcatapplication server) view cloudlets limits and openIPThen enter the environment name and click the button.Create

Within a few minutes the environment will be created.
4. Expand the Application Servers list to see the number.Public IPyour

Deploy Application
Click the Deployment button on your environment, then upload the Java package and pressDeploy

As an example, we take a simple application that starts with three variables (a, b, c).
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 Debugging
1 Open the application in your IDE (for exampleNetBeans) and create a new Debugger (Debug main project > Attach Debugger)

2. Select the Connector type, enter your Public IP address (host), port number, and specify the Timeout setting (Not required)

3. Return to the dashboard, click the button.ConfigFor Tomcat

4. Go to filevariables.confand add 2 arguments:-Xdebugand-Xrunjdwp
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5000

Note:port number invariables.confanddebuggershould be the same
5. Save changes andRestartTomcat
6. Put a break point in your code to test Remote Debugging and start the newly created debugger in our case. Applications should initialize only two variables instead of three.
Check the Tomcat logs to make sure debugging is working properly.
You can see that two variables have been initialized.
7. If you place the break point one row down, three variables will be initialized in your app.
Tips:The above instructions are suitable for the Jetty application server.
In case you are using GlassFish as a server application, you must specify arguments:-Xdebugand-XrunjdwpThrough the admin panel page
- When you create an environment, an email with credentials will be sent to the GlassFish Admin Console. You can log in with these credentials.
- go togfcluster-config > JVM Settingsand selectGeneral tab > Debug optionsThen specify your debug mode and debug parameters.
- go toJVM optionsand added 2 arguments: -Xdebug and -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5000
- Save all changes andRestartGlassfish
Hope this guide is helpful for you.