Wednesday, March 18, 2015

Remote Debug with Eclipse

How many times has it happened with us developers that it all runs fine in local and the moment the code gets into QA or PROD it behaves like a step-bro. The same has been happening with me and debugging is hell in such scenarios, unless i realised how simple its to debug remote applications using eclipse debugger.
    1. Normally we have our local apps deployed in http://localhost:8080 and debug port at 8787,
    2. Suppose the QA or PROD app is deployed at http://my-qa-site.com, you would have to restart the web application with additional JVM parameters to
    -Xrunjdwp:transport=dt_socket,address=8888,server=y,suspend=n
    and restart the application
    3. Once the server is up in debug profile assuming u have the same version of code in your local eclipse, open debug configuration
    4. Under host:my-qa-site and Port:8888
    5. Thats it you are good to go!! But mind it everyone else accessing this site will now be stopped at your breakpoints
Good luck!!