What are the options of remote debugging like:-Xrunjdwp, server, suspend? : Adam Bien's Weblog
To debug an application remotely, you will have to set options like: -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4242
. This allows remote debuggers (jdb even ships with JDK) to attach to a running Java process.
There are two flavors of transports: dt_socket
and dt_shmem
. The dt_shmem
option only works in case both processes are running on the same platform and is only available on Windows.
With suspend=y
the Java-process will wait until the debugger connects, with suspend=n
you will be also able to debug the application servers startup process.
The option server=y
opens a socket and listens for incoming debugger requests. With server=n
the debugged application will try to connect actively to a debugger and run therefore as a client.
So there is no black magic involved in debugging application servers. As long they are implemented in Java, you will be always able to debug them. Even without any fancy tools.
Read full article from What are the options of remote debugging like:-Xrunjdwp, server, suspend? : Adam Bien's Weblog
No comments:
Post a Comment