tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Malks <dan.ma...@sun.com>
Subject Re: Filters in Tomcat 4 m4
Date Wed, 13 Dec 2000 21:56:04 GMT
Craig,

"Craig R. McClanahan" wrote:

> Dan Malks wrote:
>
> > All,
> > I've looked around but can't find any discussion about the filter
> > examples in the current release of Tomcat 4 m4.
> >
> > I'd like to test some filters, but when trying to use one, get the
> > following in the name_examples_log_2000_12_13.txt:
> >
>
> Are you just uncommenting the <filter-mapping> entry in the
> "$CATALINA_HOME/webapps/examples/WEB-INF/web.xml" file?

Yes.


> When I do this, it
> works fine.
>
> The only reason this wouldn't work is if the filter class
> (filters.RequestDumperFilter) was not
> visible to the web app's class loader -- in a standard release, this class is
> located at:
>
> $CATALINA_HOME/webapps/examples/WEB-INF/classes/filters/RequestDumperFilter.class
>

Understood.
The first thing I did was verify that the class file was there, and it is.



>
> If you want to use this filter in a different webapp, you will of course have to
> move this class
> into the WEB-INF directory of the web application you want to use it in.

Actually, just noticed that the vm can't seem to load other classes either...here's
the exceptions when I try and execute the numguess example:

A Servlet Exception Has Occurred

Exception Report:

javax.servlet.ServletException: num/NumberGuessBean
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:404)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:180)

        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:255)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:165)
        at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242)
        at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:443)

        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975)
        at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:1876)

        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
        at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:343)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:159)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977)
        at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:785)
        at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:902)
        at java.lang.Thread.run(Thread.java:484)

Root Cause:

java.lang.NoClassDefFoundError: num/NumberGuessBean
        at java.lang.Class.newInstance0(Native Method)
        at java.lang.Class.newInstance(Class.java:237)
        at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.load(JspServlet.java:120)
        at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:158)

        at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:168)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:317)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:396)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:180)

        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:255)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:165)
        at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242)
        at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:443)

        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975)
        at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:1876)

        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
        at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:343)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:159)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977)
        at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:785)
        at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:902)
        at java.lang.Thread.run(Thread.java:484)




>
>
> Note that a standard distribution or build of Tomcat 4.0 installs two other
> filters on the examples
> web application.  Both of them log output to the same log file you are
> checking.  Are they running
> correctly?
>

No.  Similar exceptions.

I'm using JDK 1.3, BTW.  Is there an issue wrt this?
Also, I'm letting the script figure out my CATALINA_HOME by simply running the script
from the bin dir.  This should work right?

Finally, the TOMCAT_HOME env variable is unused in 4.0m4, right?

Thanks,
Dan


>
> > Dan Malks                                 Sun Java Center
> > Enterprise Java Architect            703.208.5794
>
> Craig McClanahan

--
Dan Malks                                 Sun Java Center
Enterprise Java Architect            703.208.5794



Mime
View raw message