How do I debug a war file on a remote machine?
debugging, java, jboss, remote-debugging
Solution
Run jboss with the debug arguments on the remote machine:
-Xdebug -Xrunjdwp:transport=dt_socket,address=54371,server=y,suspend=y
`address` - this will be the port you want to connect on
`server` - signifies it will be the server
`suspend` - will block execution of the application until a debugger connects (specify `n` if you want the application to begin before a debugger connects to it)
If using Eclipse, Debug as a `Remote Java Application`. You simply provide the project to debug, the IP of the remote machine and the port you specified.
Problem
If I have a jboss server running on another machine and I scp my war file to that machine, how do I debug the war? what commands would I use? How do I do this in my terminal?