On 23/09/2013 13:47, Nick Williams wrote: tldr: I'd say that is a WebLogic bug
> This is very off topic, and for that I apologize. I'm working on > fixing a bug in Log4j 2, and we've discovered something that just > doesn't make any sense to me. I /believe/ it's a problem with > WebLogic's implementation of the Servlet 3.0 specification, but I > could be wrong, and based on my previous experience trying to > communicate with WebLogic support, I figured I'd solicit some > feedback from the Servlet spec experts on this list to see if I'm in > the wrong before I try to bark up that tree again. > > What we discovered is that if you add a filter programmatically using > addFilter(String filterName, String className) or addFilter(String > filterName, Class<? extends Filter> filterClass), everything works > fine. The filter's init method is called during application startup, > it is invoked in the proper place in the chain, and the destroy > method is called during application shutdown, all in the right order. > However, if you add the filter using addFilter(String filterName, > Filter filter), this is not the case. The filter _is_ still invoked > in the proper place in the chain, but its init method is _never_ > called. WebLogic ignores the init method completely. The destroy > method, however, _is_ still called on application shutdown. > > Again, this is the _WebLogic_ behavior. I have not been able to > duplicate this in Tomcat. Tomcat appears to function the same no > matter which method I use to add the filter. Furthermore, I can't > find anything in the spec that would support WebLogic's behavior. One > thought thrown out was that WebLogic assumed you had already called > the init method since you were passing in an instance, but I don't > see anything in the spec that supports such an assumption. > > Am I missing something? Or is WebLogic broken here, as I suspect? Servlet 3.0 section 6.2.1 is fairly strong evidence for a WebLogic bug. As is the Javadoc for Filter.init() You might want to check the equivalent addServlet method as well. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org