If you really need to, you can wrap one exception inside the other, e.g.

        throw new ServletException(new UnavailableException("my unavaiable
message"));

and I think you'll find that the Tomcat error page (or your own custom error
page, if configured) will automatically strip the outer ServletException
layer off and report the underlying UnavailableException.

I think your problelm might be related to my previous post regarding a
similar issue with ServletException:
http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]
he.org&msgNo=158528

I have also submitted a report to the JSR154 team as suggested by Yoav.  Let
me know if your problem is similar, and I'll add it to my report.

> -----Original Message-----
> From: Shapira, Yoav [mailto:[EMAIL PROTECTED] 
> Sent: Monday 25 October 2004 14:18
> To: Tomcat Users List
> Subject: RE: Where do UnavailableExceptions get reported?
> 
> 
> 
> Hi,
> UnavailableExceptions are a bit of an unusual beast in how they're
> handled by the server, especially when thrown by users.  Try throwing
> the exception type actually declared by the init method
> (ServletException) ;)
> 
> Yoav Shapira http://www.yoavshapira.com
>  
> 
> >-----Original Message-----
> >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> >Sent: Friday, October 22, 2004 6:44 PM
> >To: [EMAIL PROTECTED]
> >Subject: Where do UnavailableExceptions get reported?
> >
> >Hi all --
> >
> >   I just installed Tomcat, and created a servlet, and installed it.
> It
> >worked.
> > I then added an init() method, which also worked.  Finally, 
> I changed
> my
> >init
> >method to throw an "UnavailableException" if a configuration variable
> >wasn't
> >specified.
> >   Now, obviously, I get an "The requested resource (Servlet 
> hemlock is
> not
> >available) is not available" error.  But the message I 
> specified in the
> >exception I threw does not show up -- not in the logs, not when I
> reload
> >the
> >servlet in the manager, not on the page when I try to run 
> the servlet.
> I
> >searched all the available files in the Apache install directory, and
> it's
> >not
> >in any of them.  Where does it go?  If it disappears, what good is
> having
> >UnavailableExceptions being thrown?
> >
> >-- Chris
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> This e-mail, including any attachments, is a confidential 
> business communication, and may contain information that is 
> confidential, proprietary and/or privileged.  This e-mail is 
> intended only for the individual(s) to whom it is addressed, 
> and may not be saved, copied, printed, disclosed or used by 
> anyone else.  If you are not the(an) intended recipient, 
> please immediately delete this e-mail from your computer 
> system and notify the sender.  Thank you.
> 
> 
> ---------------------------------------------------------------------
> 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]

Reply via email to