How to enable Eclipse/Glassfish remote debugging

You would normally enable jdb by adding debug options into your Java start up command by attaching debugging into JVM process, like the following:

DEBUG_OPTS=”-Xdebug -Xrunjdwp:transport= dt_socket,address=1044,server=y,suspend

You would consider adding this into your Glassfish’s(V2, in my case) start up script asadmin as below:

“$AS_JAVA”/bin/java “$DEBUG_OPTS” -Dcom.sun.aas.instanceName=server -Djava.libra
ry.path=”$AS_NSS”:”$AS_INSTALL/lib”:”$AS_ICU_LIB” -Dcom.sun.aas.configRoot=”$AS_
CONFIG” -Djava.endorsed.dirs=”$AS_INSTALL/lib/endorsed” -Dcom.sun.aas.processLau
ncher=”SE” -cp “$AS_DERBY_INSTALL/lib/derby.jar”:”$AS_INSTALL/jbi/lib/jbi-admin-
ib/install/applications/jmsra/imqjmsra.jar” -Dcom.sun.appserv.admin.pluggable.fe
n.enterprise.cli.framework.CLIMain “${@}”

Actually this will not work.

You have to log into the Glassfish admin console, under:

Application server

JVM General Settings

Enabled (check it)

Hit save

Restart Glassfish.

You’ll see Glassfish start up script spits the following message:

Listening for transport dt_socket at address: 9009
Application server is listening at address 9009 for debugger to attach using transport dt_socket

It started to listen at port 9009 by default instead of 1044.

You’ll configure your Eclipse accordingly to do remote debugging. Remember the port number 9009 instead of 1044.

Tags: , , , , ,

6 Responses to “How to enable Eclipse/Glassfish remote debugging”

  1. school grants Says:

    Great information! I’ve been looking for something like this for a while now. Thanks!

  2. Kniplyvipsy Says:

    Just want to say what a great blog you got here!
    I’ve been around for quite a lot of time, but finally decided to show my appreciation of your work!

    Thumbs up, and keep it going!

    Christian, Satellite Direct Tv

  3. Software Says:

    Congratulations! You have just won a new rss reader :) .. really delicious article, Mike.

  4. Casey Says:

    Howdy, I found your own website by using Bing when searching for 1st aid for a heart attack and your post seems pretty interesting for me. Yours trully, Casey.

  5. Fivezone2 Says:


    Fantastic blog post, saw on…

  6. Gabster2 Says:


    Wonderful blog post, saw on…

Leave a Reply

You must be logged in to post a comment.