Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Filters and UnavailableException

 
Rick DeBay
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic