+1  A: 

It seems that everything is fine:

  1. Check the logs for any hints
  2. Add a logging message / System.out.println / breakpoint after the chain.doFilter(..) line and see if it is actually executed.
Bozho
I would also like to add, Try putting code in Try block and printstacktrace in catch block also check if logger is configured properly
org.life.java
i tried adding the system.out.line and yes it is not executed.
Amr
@Amr then paste here your web.xml fragment. And the Filter code
Bozho
if one of the filters throw an exception it will stop the filter chain execution, am i right?
Amr
because it seems that one of the filters throw an exception on the testing servers , while that did not happen on the local machine.so if i am right and the chain will stop execution after throwing an exception.. then its clear now where the problem is...unfortunately,i have no idea about the other filters ... sorry for bothering you ...
Amr
@Bozho: does it make sense? or still want to see the fragments and the code.
Amr
the chain does not stop, but the exception is thrown up, and ends in the log files. Hence the 1st point in my answer ;)
Bozho
after tracing the code with the "out" statements... i found nothing but the filter runs before the servlet processing...
Amr
yes, the filter runs before the servlet, then chain.doFilter() invokes the servlet, and the code after it is ran after the servlet
Bozho
@Bozho, yes chain.doFilter() is the first line in do filter method..
Amr
@Amr: you need to fix the cause of this exception, then the filter will continue its code logic as expected. If you have trouble fixing this exception, ask a question and include all detail about the exception and trace.
BalusC
I fixed the cause of the exception and then i added three "system.out" statements , one before chain.doFilter(), one after chain.doFilter(), and one inside the filter: and they were printed like the following, 1. Inside the servlet 2. before the chain.doFilter 3.after the chain.doFilter
Amr
I figured out the cause of the problem, it is because that i have another filters that works on the url mapping pattern differently on production servers from the local machine .. which cuts the chain of execution , and probably that's why i suffer... Thanks you all how tried to help
Amr