JBoss application server remote debugging from eclipse

21 07 2012

Eclipse and JBoss supports standard debug mechanism: JPDA. Here is how to connect both and debug web application developed in Eclipse, deployed on JBoss.

Debugging gives you possibility to stop your webapp execution at any point you want – just by setting breakpoints in eclipse, that works just like breakpoints in standalone apps – stops execution at specific line of code.

Setting it up takes few minutes. Here is how to do it:

1. Turn on debugging in JBoss

set JAVA_OPTS in your operating system. You can do it in two ways:

– uncomment line in JBoss run.bat file () – just find in this file line, where entry similar to this appears, and uncomment it, restart JBoss:

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

(various JBoss versions can have this line located in various places. for example in JBoss 5.1.0 it is in run.conf.bat file somewhere near line 51).

– or you can execute command in command line:

set "JAVA_OPTS=%JAVA_OPTS% -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"

restart JBoss if needed

2. Set up eclipse

Create new debug configuration according to settings below:

Create new ‘Remote Java Application‘ config, according to screenshot below:

3. That’s all

Then click ‘Apply’ and Debug to connect to JBoss instance.

If does not work – let me know I’ll try to help you. And if my article is not enough – try exploring this one – everything is very well described there.

Did I help you?
I manage this blog and share my knowledge for free sacrificing my time. If you appreciate it and find this information helpful, please consider making a donation in order to keep this page alive and improve quality

Donate Button with Credit Cards

Thank You!




One response

20 09 2016

Hello I was able to start jboss server with remote debugging enabled on port 8787.

However when I try connecting from eclipse it’s not connecting. Any idea what might be an issue?

Give Your feedback:

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: