Monitoring a remote JBoss Server from Eclipse
Sometimes you need to debug something running on another machine or outside of eclipse but you still want the handy debugging facilities of the IDE. This is very simple to do and requires only one small alteration to the jboss startup script.
Edit the run.bat/run.sh file and uncomment the line "rem set JAVA_OPTS=-classic -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y %JAVA_OPTS%".
Start Eclipse (I'm using ver 3.1 with JBoss IDE 1.5 M2) and open your workspace.
Click on the Run--->Debug... menu.
Select "Remote Java Application" in the left pane and then click new.
Name the configuration, fill in the IP address and the port number (this must be the same as the one defined on the server, e.g. 8787 by default).
Click apply but keep the window open.
Start the JBoss Server (or restart it if it's already running). The server will block waiting for the connection from the remote client.
Go back to the dialog box in eclipse and click Debug.
and that's it!
You now have eclipse debugging a remote instance of JBossAS, simple!
NOTE: Ensure firewalls are open for comms on the specified port - e.g. Norton Internet Secuirty/Windows Firewalls etc etc....otherwise you'll waste time trying to figure out why things are not working.