dev@glassfish.java.net

Re: Debugging Glassfish itself

From: Dies Koper <diesk_at_fast.au.fujitsu.com>
Date: Wed, 5 May 2010 10:12:34 +1000

> I am still trying to get debugging to work, but I have no idea how to
> set a class-level breakpoint in Eclipse. I have found the sources for
> both JDBCRealm and JDBCLoginModule, but I can't set a breakpoint as I
> have no idea how to open these in Eclipse in the way that it's attached
> to the running Glassfish instance...

I don't know if it is any easier with NetBeans, but I think with Eclipse
you can't just import the root folder of the unzipped sources, it will
not know where your code is.
If you're just interested in the JDBCRealm stuff, you could create a
project and add a linked source folder pointing to security\core\src in
your unzipped GF sources.

Then find JDBCRealm.java in the project's Package Explorer in Eclipse
and double-click left of the "public class JDBCRealm ..." line (in the
are with the line numbers if you have them enabled). That will set the
breakpoint.

In the Debug Configuration (in the tab next to where you specified your
debugger port number) you add this Java project.
Eclipse will then open the source file for you when the class is executed.

I usually work with breakpoints on lines, not on classes, so I'd put the
breakpoint on the methods you expect will be invoked.

Regards,
Dies