Adam Bien's Weblog

Thursday Aug 31, 2006

How to remotely debug java applications - almost without additional tools

Developers ask me often, how to debug remote Enterprise Java Beans, Servlets or MBeans. This is really easy and possible since JDK 1.3. You have only to provide some command line options (which I always forget - this is actually the motivation for this post :-)):

-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y

Than you can connect to the remote process or server using eclipse, netbeans or other tools (you have to choose the remote debugging option). You have only to know the IP-address and remember the port-number. The last parameter suspend=y specifies whether the server process will wait for a connection of the debugger or not. You can attach and detach the debugger to you process without killing it.
There is also a great, opensource, debugger jswat which can be used for debugging pursposes.


[my tweets]  Rss My book: Real World Java EE - Rethinking Best Practices

Kommentare:

Senden Sie einen Kommentar:
  • HTML Syntax: Ausgeschaltet
Meta-stuff / Interviews
My Recent Book
Java One 2009
CommunityOne East N.Y.C
JavaONE 2008 Interview
Search
...the last 150 posts
...the last 10 comments
greenfire.dev.java.net
Links
my.netbeans.org
Visitors
License