File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Filters and UnavailableException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Filters and UnavailableException" Watch "Filters and UnavailableException" New topic

Filters and UnavailableException

Rick DeBay
Ranch Hand

Joined: Jul 11, 2003
Posts: 70
If an implementation of javax.servlet.Filter.init() throws javax.servlet.UnavailableException(), shouldn't the container not add the filter to the FilterChain? I'm getting an HTTP 503 error from OC4J in this case.
Siyaa Hoffman

Joined: Jan 15, 2004
Posts: 23
If your filter is not initializing successfully, then I don't think that the context would be even successfully loaded....not sure about OC4J...but tomcat behaves that way. It would not even let you load the web application context successfully if the filter cannot be initialized.
Rick DeBay
Ranch Hand

Joined: Jul 11, 2003
Posts: 70
The filter requires parameters to be set correctly, so inside init() if the parameters are incorrect or missing, I throw the exception. I was hoping that the container would continue without the filter. But I guess it makes more sense that it wouldn't.
I agree. Here's the link:
subject: Filters and UnavailableException
jQuery in Action, 3rd edition