You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jim Cox <sh...@gmail.com> on 2007/09/20 16:47:32 UTC

Filter mapped to "/*" not seeing Axis requests (Tomcat 5.0.19)

I developed a simple logging filter to debug some performance problems
on a Tomcat 5.0.19 installation. It works well for the requests it
sees, but the filter does not see requests serviced by a
.wsdd-deployed Axis servlet.

Anyone have any help/info/pointers to offer?

Only one webapp is defined on this server, the filter is mapped in
web.xml with the following:

<filter>
  <filter-name>MyLogFilter</filter-name>
  <filter-class>blah.blah.blah.MyLogFilter</filter-class>
  <init-param>
    <param-name>ignoredUrls</param-name>
    <param-value>
    </param-value>
  </init-param>
  <init-param>
    <param-name>ignoredPatterns</param-name>
    <param-value>
    </param-value>
  </init-param>
</filter>
<filter-mapping>
  <filter-name>MyLogFilter</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping>

Axis is configured in the same web.xml file via:
  <servlet>
    <servlet-name>AxisServlet</servlet-name>
    <display-name>Apache-Axis Servlet</display-name>
    <servlet-class>
        org.apache.axis.transport.http.AxisServlet
    </servlet-class>
  </servlet>  <servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>/top/*</url-pattern>
  </servlet-mapping>

The Axis details are specified by a "server-config.wsdd" file in the
webapp's WEB-INF directory.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Filter mapped to "/*" not seeing Axis requests (Tomcat 5.0.19)

Posted by Jim Cox <sh...@gmail.com>.
I conveniently found two relevant stack traces in the log files, as
you suspected they do show a crucial difference:

excerpt from a request that the filter sees:
 ...
 at blah.blah.blah.MyLogFilter.doFilter(MyLogFilter.java:164)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
 ...

excerpt from a request the filter does not see:
 ...
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
 ...

Essentially, in the 5.0.19 source for ApplicationFilterChain line 233
is invoked when a filter is found for the request, line 284 is a
section of code prefaced by the comment "We fell off the end of the
chain -- call the servlet instance"

On 9/20/07, David Delbecq <de...@oma.be> wrote:
> Hello
>
> Filter mapped to /* should see everything that reach it's application.
> This include your axis service.
> I suggest you investigate to possibility that your ignoredUrls or
> ignoredPatterns apply to all your axis request, making your filter
> ignore them. If you see not output from your filter for axis request,
> then check the code of filter, because tomcat will trigger it.
>
> If you have doubt, try to get stackTrace during an axis request (either
> by making a fault during axis response, either by using a slow response
> and sneding signal 3 to JVM)
>
>
> En l'instant précis du 20/09/07 16:47, Jim Cox s'exprimait en ces termes:
> > I developed a simple logging filter to debug some performance problems
> > on a Tomcat 5.0.19 installation. It works well for the requests it
> > sees, but the filter does not see requests serviced by a
> > wsdd-deployed Axis servlet.
> >
> > Anyone have any help/info/pointers to offer?
> >
> > Only one webapp is defined on this server, the filter is mapped in
> > web.xml with the following:
> >
> > <filter>
> >   <filter-name>MyLogFilter</filter-name>
> >   <filter-class>blah.blah.blah.MyLogFilter</filter-class>
> >   <init-param>
> >     <param-name>ignoredUrls</param-name>
> >     <param-value>
> >     </param-value>
> >   </init-param>
> >   <init-param>
> >     <param-name>ignoredPatterns</param-name>
> >     <param-value>
> >     </param-value>
> >   </init-param>
> > </filter>
> > <filter-mapping>
> >   <filter-name>MyLogFilter</filter-name>
> >   <url-pattern>/*</url-pattern>
> > </filter-mapping>
> >
> > Axis is configured in the same web.xml file via:
> >   <servlet>
> >     <servlet-name>AxisServlet</servlet-name>
> >     <display-name>Apache-Axis Servlet</display-name>
> >     <servlet-class>
> >         org.apache.axis.transport.http.AxisServlet
> >     </servlet-class>
> >   </servlet>  <servlet-mapping>
> >     <servlet-name>AxisServlet</servlet-name>
> >     <url-pattern>/top/*</url-pattern>
> >   </servlet-mapping>
> >
> > The Axis details are specified by a "server-config.wsdd" file in the
> > webapp's WEB-INF directory.
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
>
>
> --
> http://www.noooxml.org/
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Filter mapped to "/*" not seeing Axis requests (Tomcat 5.0.19)

Posted by David Delbecq <de...@oma.be>.
Hello

Filter mapped to /* should see everything that reach it's application.
This include your axis service.
I suggest you investigate to possibility that your ignoredUrls or
ignoredPatterns apply to all your axis request, making your filter
ignore them. If you see not output from your filter for axis request,
then check the code of filter, because tomcat will trigger it.

If you have doubt, try to get stackTrace during an axis request (either
by making a fault during axis response, either by using a slow response
and sneding signal 3 to JVM)


En l'instant précis du 20/09/07 16:47, Jim Cox s'exprimait en ces termes:
> I developed a simple logging filter to debug some performance problems
> on a Tomcat 5.0.19 installation. It works well for the requests it
> sees, but the filter does not see requests serviced by a
> wsdd-deployed Axis servlet.
>
> Anyone have any help/info/pointers to offer?
>
> Only one webapp is defined on this server, the filter is mapped in
> web.xml with the following:
>
> <filter>
>   <filter-name>MyLogFilter</filter-name>
>   <filter-class>blah.blah.blah.MyLogFilter</filter-class>
>   <init-param>
>     <param-name>ignoredUrls</param-name>
>     <param-value>
>     </param-value>
>   </init-param>
>   <init-param>
>     <param-name>ignoredPatterns</param-name>
>     <param-value>
>     </param-value>
>   </init-param>
> </filter>
> <filter-mapping>
>   <filter-name>MyLogFilter</filter-name>
>   <url-pattern>/*</url-pattern>
> </filter-mapping>
>
> Axis is configured in the same web.xml file via:
>   <servlet>
>     <servlet-name>AxisServlet</servlet-name>
>     <display-name>Apache-Axis Servlet</display-name>
>     <servlet-class>
>         org.apache.axis.transport.http.AxisServlet
>     </servlet-class>
>   </servlet>  <servlet-mapping>
>     <servlet-name>AxisServlet</servlet-name>
>     <url-pattern>/top/*</url-pattern>
>   </servlet-mapping>
>
> The Axis details are specified by a "server-config.wsdd" file in the
> webapp's WEB-INF directory.
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>   


-- 
http://www.noooxml.org/


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Filter mapped to "/*" not seeing Axis requests (Tomcat 5.0.19)

Posted by Steve Souza <ja...@gmail.com>.
I suspect it is not working due to the axis servlets location under /top/.
  '<url-pattern>/*</url-pattern>' might only work for the root context and
not any subcontexts/subdirectories.

Something else that might be of interest.  Today, I am going to release
JAMon 2.7 which contains a Tomcat valve that will keep aggregate stats for
all pages/resources in tomcat.  It will also allow you to to view stack
traces via a web app, and view the slowest and most recent pages that were
invoked.

Valves work at the server level as opposed to servlet filters which work at
the wep app level, so you shouldn't have this problem.   You simply add a
valve line to your server.xml file.  In addition jamon can also monitor jdbc
connections, ejb calls, and log4j calls declartively without changes to your
code.

http://www.jamonapi.com

On 9/20/07, Jim Cox <sh...@gmail.com> wrote:
>
> I developed a simple logging filter to debug some performance problems
> on a Tomcat 5.0.19 installation. It works well for the requests it
> sees, but the filter does not see requests serviced by a
> .wsdd-deployed Axis servlet.
>
> Anyone have any help/info/pointers to offer?
>
> Only one webapp is defined on this server, the filter is mapped in
> web.xml with the following:
>
> <filter>
>   <filter-name>MyLogFilter</filter-name>
>   <filter-class>blah.blah.blah.MyLogFilter</filter-class>
>   <init-param>
>     <param-name>ignoredUrls</param-name>
>     <param-value>
>     </param-value>
>   </init-param>
>   <init-param>
>     <param-name>ignoredPatterns</param-name>
>     <param-value>
>     </param-value>
>   </init-param>
> </filter>
> <filter-mapping>
>   <filter-name>MyLogFilter</filter-name>
>   <url-pattern>/*</url-pattern>
> </filter-mapping>
>
> Axis is configured in the same web.xml file via:
>   <servlet>
>     <servlet-name>AxisServlet</servlet-name>
>     <display-name>Apache-Axis Servlet</display-name>
>     <servlet-class>
>         org.apache.axis.transport.http.AxisServlet
>     </servlet-class>
>   </servlet>  <servlet-mapping>
>     <servlet-name>AxisServlet</servlet-name>
>     <url-pattern>/top/*</url-pattern>
>   </servlet-mapping>
>
> The Axis details are specified by a "server-config.wsdd" file in the
> webapp's WEB-INF directory.
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>