users@glassfish.java.net

Re: problem launching remote debugging of EJB with Eclipse IDE and Glass Fish

From: <glassfish_at_javadesktop.org>
Date: Fri, 04 Dec 2009 13:39:09 PST

> I am new to trying to debug a deployed EJB on a
> running glassfish server from Eclipse. Here is what
> I tried.
>
> (1) Go to JVM settings in Glassfish and click "enable
> debugging".

That is correct. I guess you restarted Glassfish afterwards and it is running before you go the the Eclipse debugging session.

> (2) Create debug configuration and pass it these
> arguments in the JVM:
>
> -Xdebug
> -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9009

This is the configuration of the Java program to be debugged (i.e. the server).

But the Eclipse launch configuration is the client which wants connect to port 9009.
So you simply tell Eclipse the port where it finds Glassfish:

1. Select Debug configuration for "Remote Java application"
2. Fill in host (localhost) and port (9009)

and you are done! Press "Debug" and Eclipse will connect via port 9009 to the running Glassfish instance.

With regard to Ludos answers: He presumes that you have the Glassfish plugin for Eclipse installed, which is a good idea and may support you in managing the server completely from Eclipse.

But the above launch configuration is independent of any GF plugin installed.

Cheers, Jörg

> Then when I press F-11 to step through the code I get
> this error message in Eclipse:
>
> ERROR: Cannot load this JVM TI agent twice, check
> your java command line for duplicate jdwp options.
[Message sent by forum member 'jthoennes' ]

http://forums.java.net/jive/thread.jspa?messageID=374821