How to Start Jboss 5.1.0.GA in Debug Mode for Remote Debug in Intellij

10,178

Solution 1

We have to do 2 changes to debug remote java application that is running in JBoss

  1. Configure in JBoss
  2. Creating remote debugger in in eclipse

    1. Open run.conf.bat(windows) or run.conf(Linux) file in JBoss bin folder.

go to the below lines

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

and remove hash in JAVA_OPTS

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

Restart the server if it is started.
2. In Eclipse, Run -> Debug configuration -> Remote Java Application and create a new. Note that you have to give port that is mentioned in run.conf.bat file

Solution 2

I know this is an old post but just answering it speciffic to intelliJ IDE

Step 1 In the JBOSS start-up we add the below line JPDA options. Uncomment and modify as appropriate to enable remote debugging. set JAVA_OPTS=-classic -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=5000,server=y,suspend=n %JAVA_OPTS%

Step 2 Run JBoss with the above script

Step 3 In intelliJ under run/debug configuration add jboss like the screen grab below enter image description here

Step 4 Start the JBoss config in debug mode by clicking on the debug icon.

Share:
10,178
David Williams
Author by

David Williams

Updated on June 05, 2022

Comments

  • David Williams
    David Williams about 2 years

    I want to set up breakpoints and remote debugging for a Jboss application in Intellij. From this blog post, I believe the first step is to run jboss in debug mode. I have Jboss 5.1.0.GA. so I don't have the same files (standalone.sh) as mentioned in How to start JBOSS 7 in debug mode?">this Stack Overflow which covers it for Jboss 7.

    How do I do this for Jboss-5.1.0.GA? In run.conf, I see these two lines:

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

    Is all I need to do uncomment one of those? Then in Intellij what would be the corresponding settings? Here: