JBoss Remote Debug and Port Configuration

Is quite common you need debug JBoss remotely, basically you may have an Linux server running it for Development or QA environment.

In order to be able to debug JBoss in your machine you just need change one configuration file.

Open the file $JBOSS_HOME\bin\run.conf in your favorite text editor an serach for this lines:

# Sample JPDA settings for remote socket debugging
# JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"

You new uncoment the last line, like the following sample:

# Sample JPDA settings for remote socket debugging<br>JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"<br>

The parameter address is the port that JBoss will be listing to remote debug. Now you can open eclipse an run and remote debug like the following sample:

1. Create a new Remote Java Application Debug configuration.
2. Select your project, remember that must be an EAR or WAR(You can use jar but in this case must be on EJB or JMX).
3. Set up the ip and port adress

And this is it you are ready to debug your JBoss remotely.

Creating a New Profile or Change Port Configuration

Sometimes is very useful create new profiles for your application. JBoss let you do that very easly use can copy and paste any of the standard profiles like: default, web or all and you just need chnage the port.

Open the following file in your favorite text editor:

: This is your profile folder could be: default, all ,ejb or other that you created in the previous step.

Look for this;

<constructor><br>     <!-- The name of the set of bindings to use for this server --><br>      <parameter>${jboss.service.binding.set:ports-default}</parameter><br>

Change for the following configuration:

<constructor><br>      <!-- The name of the set of bindings to use for this server --><br>      <parameter>${jboss.service.binding.set:ports-01}</parameter> 

JBoss have 4 pre-built port configurations available that you can use. If you need more than 4 you can play with the offset configuration:
<!-- The port offset --><br><parameter>100</parameter>

Enjoy. :D


Popular posts from this blog

Podman in Linux

Java Agents

Manage Work not People