users@glassfish.java.net

Re: Debugging Glassfish itself: SOLVED

From: Stijn de Witt <StijnDeWitt_at_chello.nl>
Date: Wed, 5 May 2010 22:10:11 +0200

Dies, thank you so much!!!

Your tip to create a new project and link a source folder did the trick for
me. If it hadn't been for me getting sidetracked and working on my blog for
a while I would have got it working in 10 minutes after reading your mail (I
really needed a break from the problem).

When I returned to the problem, following your instructions, I was finally
able to debug and put breakpoints in the JDBCRealm. I have found the problem
that prevented my logins from succeeding.

*drumroll*

My password of "secret" got Hex encoded to "736563726574" before trying the
match... causing the match to fail.

I thought I had to choose either "Hex" or "Base64" as encoding because in
the admin console it says for the Encoding attribute of the JDBCRealm
configuration:

"Encoding (allowed values are Hex and Base64)"

I figured that I had to choose either one. I took it *very* literally to
mean that an empty value was not allowed here. Stupid may be, because the
field is not marked as mandatory... still it might have defaulted to any of
the two.

But it's a bit weird I think. I would have expected the encoding to only be
used when Digest was set to some digest algorithm (such as MD5) and not when
it was set to "none".

Ah well, at least I am now able to move beyond this JDBCRealm configuration
issue and, maybe even better, I will be able to debug similar problems to
this one in the future.

Thanks to everyone who helped me during the last couple of days and I will
cross-post this to the users list as well, because I had initially asked it
there but no-one knew. Maybe it can help someone in the future.

HTH,

-Stijn


----- Original Message -----
From: "Dies Koper" <diesk_at_fast.au.fujitsu.com>
To: <dev_at_glassfish.dev.java.net>
Sent: Wednesday, May 05, 2010 2:12 AM
Subject: Re: Debugging Glassfish itself


>> 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
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>
>