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