dev@glassfish.java.net

Re: Debugging Glassfish itself

From: Andreas Loew <Andreas.Loew_at_Sun.COM>
Date: Tue, 04 May 2010 21:04:30 +0200

Stijn de Witt schrieb:

> If I start Glassfish from the
> commandline with this command:
> >asadmin start-domain --debug
> It looks like it's working:
>
> Waiting for DAS to start ..........
> Started domain: domain1
> Domain location: C:\Program
> Files\Glassfish\glassfish-v3-web\glassfish\domains\domain1
> Log file: C:\Program
> Files\Glassfish\glassfish-v3-web\glassfish\domains\domain1\logs\server.log
> Admin port for the domain: 4848
> Debug port for the domain: 9009
> Command start-domain executed successfully.
> In Eclipse's Debug perspective I now see a stack-like thing that I feel
> must be Glassfish... So it seems I made some progress! Woohoo!

Exactly - that's the way to do it.

> I would like to start debugging at the incoming request to my secured
> page that will lead to the JAAS login page and eventually the
> JDBCLoginModule and JDBCRealm... Any idea how I can set a breakpoint and
> attach soure?

> Any tips where to go from here?

You need to find out classnames on which to put class-level breakpoints,
i.e. the debugger will stop at any method execution within that class.

You may want to find out the (fully qualified) class name of your
compiled JSP (keepgenerated=true in jsp-config in sun-web-app.xml), but
more importantly look up/search the source tree for the the full class
names of the JDBCLoginModule and the JDBCRealm implementations, and
start with these breakpoints.

Then have a look at the stack traces you have at these breakpoints to
get an impression about the control flow.

HTH & best regards,

Andreas

-- 
Andreas Loew
Senior Java Architect
Sun Microsystems (Germany)