问题
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?
回答1:
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.
回答2:
I am assuming you have an IDE to do the debugging from - which in most case people use Eclipse.
- Need to set up your JBoss to allow debug connection
- Connect to your JBoss, on its debugging port, through Eclipse.
Check out this post JBoss debugging in Eclipse
来源:https://stackoverflow.com/questions/11568756/how-do-i-debug-a-war-file-on-a-remote-machine