10

How can I configure remote debugging in Eclipse with JBOSS server 4.x version?

So far,

Step1: I have modified the run.confg file. By uncommenting the below line. Sample JPDA settings for remote socket debugging:

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

Step2 : Then I configured Eclipse in debug configurations. It's saying:

Failed to connect to remote VM. Connection refused.
ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
Ravi
  • 169
  • 1
  • 2
  • 6

1 Answers1

17

What you are asking is not specific to either Java EE or JBoss 4.x - you can debug any Java process in case you specified the remote debugging runtime parameters when starting the JVM.

In your setting the -Xdebug parameter is missing, so your line would be:

JAVA_OPTS="$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"

Now it should be able to connect, in case you are using the correct host and your specified port 8787. In case it's still not working, it's most likely a firewall issue blocking the port.

Alexander Rühl
  • 6,769
  • 9
  • 53
  • 96
  • 1
    I just had a similar problem and came across this answer. It is good. It is worth noting, however that the -Xdebug parameter is not needed for JDK versions later than 1.4.x. Something like this should work in newer JDKs: `-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8787` – mmaynar1 Mar 21 '18 at 19:08