0

I have a problem with Tomcat 7, where all my requests are going twice through our filters. This results in a web-page where static text is displayed twice and all our ajax requests are also displayed twice. This started happening when we implemented the security filter shown below:

<filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/system/*</url-pattern>
    <url-pattern>/admin/*</url-pattern>
</filter-mapping>

When I deploy the same war-file on jetty 9 or tomcat 6 it works just fine! Does anyone know how to solve this issue?!

Setup:

  • Tomcat: 7.0.52
  • Spring: 3.2.8.RELEASE
  • Spring-security: 3.2.1.RELEASE
  • Apache Tiles: 3.0.3

We have tried the following with no luck:

  • reimplementing apache tiles
  • added this to /conf/context.xml: <Context resourceOnlyServlets="">
  • changed the order of our filters
Jan-Terje Sørensen
  • 14,468
  • 8
  • 37
  • 37
  • Add some logging to your filters that simply dumps the current stacktrace to the logs. For the second trip through the filter look back up the stack trace to see why it has been called twice. – Mark Thomas Mar 12 '14 at 09:31
  • @MarkThomas - any suggestions to what to look for? I do believe it is something Tomcat7 specific, so i cant understand that logging my application filters is going to help... ? – Jan-Terje Sørensen Mar 12 '14 at 09:42
  • If I knew what to look for, I'd have the answer to the question. Given you are sure a single request is including the same content in a response twice then what you want to gather is the stack trace for each of the times that content is added to see if that provides some clues as to why it is added twice. It should do. – Mark Thomas Mar 12 '14 at 09:57

0 Answers0