Reputation: 1091
I have a Filter implementation that has worked previously in a single instance Glassfish 3.1.1.
It has been annotated with @WebFilter and is as follows:
@WebFilter(urlPatterns = { "/*" })
public class SomeFilter implements Filter {
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
ServletException {
HttpServletRequest req = (HttpServletRequest) request;
...
}
@Override
public void init(FilterConfig filterConfig) throws ServletException {
// do nothing
}
@Override
public void destroy() {
// do nothing
}
It should be invoked with every request.
Now I have a Glassfish setup that has two separate instances for FRONT and SERVICE. I deploy the WAR containing the filter to FRONT and the Filter does not seem to work. I tried logging and debugging, but it seems the filter, or at least the doFilter-method is never invoked. I also tried to put some logging to init method but it also isn't showing up on the logs at all.
Anyone know what might cause such behaviour. Is there a way to log the Glassfish filterchain somehow?
Upvotes: 1
Views: 652
Reputation: 6289
Did you check the Glassfish server.log for errors regarding initialization of the filter? I've encountered similar problems and got a hunch that filter initialization is the cause of your problem.
Upvotes: 1