Based on what I saw so far ... In JNDIRealm authenticate(String, String) gets a DirContext and calls authenticate(DirContext, String, String).
Your code snippet which I assume overrides, authenticate(DirContext, String, String) which calls super.authenticate(String, String).
Then ... super.authenticate(String, String) calls authenticate(DirContext, String, String) which you had overridden which is indirect recursion.
-Tim
Hart, Justin wrote:
Ok, why?
What am I doing that should cause a stack overflow?
Justin
-----Original Message----- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: Monday, November 24, 2003 7:26 PM To: Tomcat Users List Subject: Re: Extending JNDIRealm
Odd, based on what I see so far, I would expect it to crash with a StackOverFlow exception.
-Tim
Hart, Justin wrote:
Whoops, the code is actually as follows...
No sure what's going on with this code... I'm attempting to extend JNDIRealm so I can add a few features I need for my site, I have an interesting issue, however.
If, I try this :
public Principal authenticate(DirContext context, String username, String credentials) throws NamingException { Principal authPrincipal = null; System.out.println(username); authPrincipal = super.authenticate(username, credentials); return authPrincipal; }
username gets printed, and the system works properly
However, if I try something akin to this
public Principal authenticate(DirContext context, String username, String credentials) throws NamingException { Principal authPrincipal = null; System.out.println(username.length()); authPrincipal = super.authenticate(username, credentials); return authPrincipal; }
It crashes with a null pointer exception.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]