jueves, 19 de febrero de 2015

Remote debugging in java

Remote debugging is something most people doesn't need every day, but being able to debug an application deployed in another server is unvaluable. It saves a lot of time and effort making trial-and-error attempts to discover where is the problem and how to fix it.

Here i will show you how to do it in a few steps; lets say you have a JAR file called "application.jar":



Start the application enabling remote debbuging:

Start the application with the following command.
This command starts a server socket at port 8998 and broadcasts the debugging messages using JDWP (Java Debug Wire Protocol).



Configure Eclipse


  •  Go to Run -> Debug Configurations
  •  Create a Remote java Application
  •  Configure the details:
    •  Connection Type: Standard
    •  Host: Server of the remote app
    •  Port: Chosen when launching the jar (8998 in this example).
  •  Check "Allow termination of remote VM"
  •  Check Common->Debug if you want it on your favorites menu.


Click "apply" and...voi-la! you can now debug your application by launching this configuration!

No hay comentarios:

Publicar un comentario