Debugging Glassfish with Eclipse - Reloaded
A years ago I published on this blog a pretty successful screencast explaining how to debug a Glassfish application with Eclipse; unfortunately, some months later, a cracker decided to break into Wordpress instance, and deleted every content. So, no more screencast available, and I obviously didn’t have a backup.
Anyway, since the post is still there, from time to time I have comments or emails in my mailbox asking “Where the screencast? I need to debug my Glassfish app with Eclipse!”; so in this post I’m going to explain briefly how to do that.
Glassfish setup
First, login into the Glassfish administration console (default url is http://localhost:4848, user admin, password adminadmin).
Then, in the left menu, choose Application Server and, in the main frame, choose the JVM Settings tab. Finally, check the Debug: Enabled checkbox, and you’re done with the Glassfish setup. Note that you need to restart Glassfish after this configuration change.
Eclipse setup
Open your Eclipse instance, and choose Run -> Debug… in the menu.
When the panel appears, right-click on the Remote Java Applications option in the left menu, and choose New. Then fill in the form, choosing the Project you want to debug (use Browse to locate it) and insert 9009 as port.
Now click on Debug, create your breakpoints in Eclipse, and you’re successfully debugging your Glassfish application!

3 Comments