Travelling, and not Arriving

          ... a good traveler has no fixed plans and is not intent upon arriving... (Lao Tzu)

Posted
17 February 2007 @ 8am

Tagged
Java, Open Source, TechArticles

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

Posted by
Chris
9 March 2007 @ 5am

Hi, I love your blogs on Java EE they have been very useful so far.

One task that I cannot get to work is the debugging of a Java EE project from eclipse (I’m new to Eclipse and I’m trying to deploy a java project to a Glassfish server and debug it. I can create ejbs in plain old java jar files which when I export run fine on Glassfish, but I cannot figure out how to do this so that I can debug my code in Eclipse) Could you expand your notes on how to go about this, you’re the only resource I can find on the internet that says you can in fact do this via Eclipse.

Any further notes would be greatly appreciated.

Thanks very much
Chris


Posted by
sud
8 June 2007 @ 4am

How do I debug an web service application? When I hit debug, the web service project is not deployed into the remote glassfish instance.


Posted by
keith
7 May 2008 @ 11pm

Sorry I did the above and just get

—————————————————-
Launching ‘XYZ’
Connection refused connect

Failed to connect to remote VM. Connection refused
Connection refused connect
—————————————————-

I think it’s trying to tell me the connection was refused :-)


Leave a Comment

No more dead times with gAnt! February meeting of the Java User Group Milano