I've about we can debug on eclipse into process that is running on Jboss. But I think standard debug is very perfect. I can't find any reason for the existing of debug as remote server.
Anyone can help me explain this feature?
- Yes, I've understood.Thanks for all.R.Kaka– R.Kaka2013-04-26 09:10:14 +00:00Commented Apr 26, 2013 at 9:10
5 Answers
When you deploy your code to run on a remote server, Eclipse is no longer managing the JVM. Hence the ability to step through code is lost.
To combat this, Eclipse offers remote debugging, which allows you to connect to a socket on the remote server and control the debug session. This requires that the remote JVM was started with socket-based debugging enabled.
Eclipse then lets you control the debug session locally and you will be able to step through your code as per normal. It's rather neat, really.
Comments
If you have source code in Eclipse which is deployed on a server and you want to debug specific functionality on server (say submit a request which hits your servlet, REST resource etc), you can add breakpoint in classes to be debugged.
To debug, You start your server with
-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n option and configure Eclipse to attache it via debug as Remote Application by providing Host,Port and valid connection type.
Comments
There are times when you have placed your servers far away from your location (It actually happens in almost every large project), and you would like to debug or resolve an issue from there only. Or you want some expert to look into the problem from their location. This is actually very useful feature.
Comments
The code you develop for real applications will be deployed and executed on remote servers and remote debugging is extremely useful to track down an issue in such a case. The source code you need to have in Eclipse must be the exact code that's running in remote server. (Code must be in sync). Also the remote machine (where the code is running) must enabled the debug port for remote access so that it can be accessed from the machine which Eclipse is running.