Reputation: 8654
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:
Upvotes: 2
Views: 11310
Reputation: 247
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
Step 4 Start the JBoss config in debug mode by clicking on the debug icon.
Upvotes: 1
Reputation: 4520
We have to do 2 changes to debug remote java application that is running in JBoss
Creating remote debugger in in eclipse
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
Upvotes: 5