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? Thanks, Nick (BTW, thankfully it doesn't matter to us which method we use, so we're just switching to a different method. But if it's a problem, WebLogic still needs to fix it.)
smime.p7s
Description: S/MIME cryptographic signature