dev@glassfish.java.net

Re: Debugging Glassfish itself

From: Justin Lee <justin.d.lee_at_oracle.com>
Date: Tue, 04 May 2010 12:29:27 -0400

Edit domain.xml and look for "suspend=n". Change that to 'y'. Start
glassfish in a debug VM (pass --debug to start-domain). Using your IDE
debugger, attach to a remote process with 9009. The VM will pause until
you attach with a debugger but then all your breakpoints should work
just fine.

Now your IDE may support glassfish natively (netbeans does, iirc) but
this is portable across IDEs at least and will get you started.

On 5/4/10 12:26 PM, Stijn de Witt wrote:
> Hi,
>
> Does anyone here know how to debug Glassfish itself?
>
> I am having trouble setting up a JDBCRealm so I would like to attach a debugger to a running Glassfish server, tell the debugger where the source is and then set a breakpoint in the JDBCRealm and JDBCLoginModule classes so I can figure out what is happening.
>
> I am using Glassfish v3 and have already downloaded the source code from the SVN repository at
> https://svn.dev.java.net/svn/glassfish-svn/trunk/v3
>
> ..as described here:
> http://wiki.glassfish.java.net/Wiki.jsp?page=V3FullBuildInstructions
>
> I would prefer to debug using Eclipse, but I'm willing to switch to Netbeans or any other IDE, so if you have instructions for some other IDE no problem.
>
> I have already asked this question on the Users list, but nobody there seemed to know how to do it. I also couldn't find anything on the net, most people are describing how to debug apps running inside Glassfish, but not how to debug Glassfish itself.
>
> Thanks in advance for any help! With kind regards,
>
> -Stijn
>
>