users@glassfish.java.net

ServerAuthModule - Handling AuthException from initialize in Web Tier

From: <glassfish_at_javadesktop.org>
Date: Mon, 23 Aug 2010 20:03:14 PDT

I have a ServerAuthModule that could potentially throw an exception in the initialize method. Just working with a simple test case:

public void initialize(MessagePolicy requestPolicy, MessagePolicy responsePolicy,
            CallbackHandler handler, Map options) throws AuthException {

    AuthException ae = new AuthException();
    ae.initCause(new Throwable("Error: No login context name defined."));
    throw ae;
}

In this example, I don't see any stack trace in the log files and I get a http 500 error (as expected). My error page defined in my web.xml file is also not being forwarded to:
 <error-page>
        <error-code>500</error-code>
        <location>/error.html</location>
  </error-page>

Can anyone point me to why my custom error page will not work in this example, and explain why this exception does not show up in the log file?

Thanks in advance.
[Message sent by forum member 'unistd_h']

http://forums.java.net/jive/thread.jspa?messageID=480849